After changing $_GET['page'] == 'All' into isset($_GET['page']) && $_GET['page'] == 'All' the messages for row 84, 88 and 89 were solved.
Now i have still these faults
Notice: Undefined index: ipp in C:\wamp\www\test\paginator.class.php on line 99
Notice: Undefined index: ipp in C:\wamp\www\test\paginator.class.php on line 100
Fatal error: Call to undefined method Paginator::display_pages() in C:\wamp\www\test\example.php on line 99
I tried the following:
Replaced string ($_GET['ipp'] == 'All') into isset($_GET['ipp']) && $_GET['ipp'] == 'All' in row 99 and 100, but than i got the following message
Fatal error: Call to undefined method Paginator::display_pages() in C:\wamp\www\test\example.php on line 99
If i am using this code isset($_GET['ipp'])?$_GET['ipp']:’0' in row 99 en 100
Then I have message:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\test\paginator.class.php on line 100
I tried to find some solutions but still need your help
php code looks this:
Code: Select all
84 this->return .= ($i == $this->current_page AND isset($_GET['page']) && $_GET['page'] == 'All') ? "<a title=\"Go to page $i of $this->num_pages\" class=\"current\" href=\"#\">$i</a> ":"<a class=\"paginate\" title=\"Go to page $i of $this->num_pages\" href=\"$_SERVER[PHP_SELF]?page=$i&ipp=$this->items_per_page$this->querystring\">$i</a> ";
85 }
86 if($this->range[$this->mid_range-1] < $this->num_pages-1 And $i == $this->range[$this->mid_range-1]) $this->return .= " ... ";
87 }
88 $this->return .= (($this->current_page != $this->num_pages And $this->items_total >= 10) And (isset($_GET['page']) && $_GET['page'] == 'All')) ? "<a class=\"paginate\" href=\"$_SERVER[PHP_SELF]?page=$next_page&ipp=$this->items_per_page$this->querystring\">Next »</a>\n":"<span class=\"inactive\" href=\"#\">» Next</span>\n";
89 $this->return .= (isset($_GET['page']) && $_GET['page'] == 'All') ? "<a class=\"current\" style=\"margin-left:10px\" href=\"#\">All</a> \n":"<a class=\"paginate\" style=\"margin-left:10px\" href=\"$_SERVER[PHP_SELF]?page=1&ipp=All$this->querystring\">All</a> \n";
90 //else
91 {
92 for($i=1;$i<=$this->num_pages;$i++)
93 {
94 $this->return .= ($i == $this->current_page) ? "<a class=\"current\" href=\"#\">$i</a> ":"<a class=\"paginate\" href=\"$_SERVER[PHP_SELF]?page=$i&ipp=$this->items_per_page$this->querystring\">$i</a> ";
95 }
96 $this->return .= "<a class=\"paginate\" href=\"$_SERVER[PHP_SELF]?page=1&ipp=All$this->querystring\">All</a> \n";
97 }
98 $this->low = ($this->current_page-1) * $this->items_per_page;
99 $this->high = (isset($_GET['ipp'])?$_GET['ipp']:’0') ? $this->items_total:($this->current_page * $this->items_per_page)-1;
100 $this->limit = (isset($_GET['ipp'])?$_GET['ipp']:'0') ? "": "LIMIT $this->low,$this->items_per_page" ;
101 }
102
103 function display_items_per_page()
104 {
105 $items = '';
106 $ipp_array = array(10,25,50,100,'All');
107 foreach($ipp_array as $ipp_opt) $items .= ($ipp_opt == $this->items_per_page) ? "<option selected value=\"$ipp_opt\">$ipp_opt</option>\n":"<option value=\"$ipp_opt\">$ipp_opt</option>\n";
108 return "<span class=\"paginate\">Items per page:</span><select class=\"paginate\" onchange=\"window.location='$_SERVER[PHP_SELF]?page=1&ipp='+this[this.selectedIndex].value+'$this->querystring';return false\">$items</select>\n";
109 }
110
111 function display_jump_menu()
112 {
113 $option = '';
114 for($i=1;$i<=$this->num_pages;$i++)
115 {
116 $option .= ($i==$this->current_page) ? "<option value=\"$i\" selected>$i</option>\n":"<option value=\"$i\">$i</option>\n";
117 }
118 return "<span class=\"paginate\">Page:</span><select class=\"paginate\" onchange=\"window.location='$_SERVER[PHP_SELF]?page='+this[this.selectedIndex].value+'&ipp=$this->items_per_page$this->querystring';return false\">$option</select>\n";
119 }
120
121 function display_pages()
122 {
123 return $this->return;
124 }
125 }
126 }