Browse Source

improve pages property

Maurits van der Schee 10 years ago
parent
commit
ff0c8ed38d
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      index.php

+ 3
- 2
index.php View File

@@ -161,8 +161,9 @@ switch($action){
161 161
 				if (is_array($filter)) $sql .= " WHERE `$filter[0]` $filter[2] '$filter[1]'";
162 162
 				if ($result = $mysqli->query($sql)) {
163 163
 					$pages = $result->fetch_row();
164
-					$pages = floor($pages[0]/$page[1])+1;
165
-					echo '"pages":"'.$pages.'",';
164
+					$pages = floor($pages[0]/$page[1]);
165
+					$pages = array('current'=>$page[0]+1,'records'=>$page[1]+0,"total"=>$pages+0);
166
+					echo '"pages":"'.json_encode($pages).'",';
166 167
 				}
167 168
 			}
168 169
 			echo '"columns":';

Loading…
Cancel
Save