Revize 7f347c4a
Přidáno uživatelem Tomáš Pašek před více než 3 roky(ů)
application/controller/TableController.php | ||
---|---|---|
21 | 21 |
} |
22 | 22 |
|
23 | 23 |
$output = Array(); |
24 |
$output["data"] = Array(); |
|
24 | 25 |
$temp_value = null; |
25 | 26 |
foreach ($results as $res) { |
26 | 27 |
if ($temp_value != null && $res["id"] != $temp_value->id) { |
27 |
array_push($output, $temp_value); |
|
28 |
array_push($output["data"], $temp_value);
|
|
28 | 29 |
$temp_value = null; |
29 | 30 |
} |
30 | 31 |
if ($temp_value == null) { |
... | ... | |
40 | 41 |
array_push($temp_value->manuscript, $res["manuscript"]); |
41 | 42 |
} |
42 | 43 |
} |
44 |
$output["count"] = count($output["data"]); |
|
45 |
if (array_key_exists("page", $_POST) && array_key_exists("items_per_page", $_POST)) { |
|
46 |
$output["data"] = array_slice($output["data"], $_POST['page'] * $_POST['items_per_page'], $_POST['items_per_page']); |
|
47 |
} else { |
|
48 |
$output["data"] = array_slice($output["data"], 0, 50); |
|
49 |
} |
|
43 | 50 |
echo json_encode(count($output)==0 ? null : $output); |
44 | 51 |
|
45 | 52 |
|
... | ... | |
65 | 72 |
$array['positiondetail'] = $_POST['positiondetail']; |
66 | 73 |
$whereQuery .= " w.positiondetail = :positiondetail AND"; |
67 | 74 |
} |
75 |
if (array_key_exists("finished", $_POST) && $_POST['finished'] != "") { |
|
76 |
$array['finished'] = $_POST['finished']; |
|
77 |
$whereQuery .= " w.finished = :finished AND"; |
|
78 |
} |
|
68 | 79 |
if (array_key_exists("manuscript", $_POST) && $_POST['manuscript'] != "") { |
69 | 80 |
$array['manuscript'] = Array(); |
70 | 81 |
$nums = explode(",", $_POST['manuscript']); |
Také k dispozici: Unified diff
Feature #8345 Implementce filterů dat - Server
stránkování na serveru