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']); |
application/model/DB.php | ||
---|---|---|
45 | 45 |
if (array_key_exists("tag", $params)) { |
46 | 46 |
$this->stmt->bindParam(':tag',$params['tag'], PDO::PARAM_STR); |
47 | 47 |
} |
48 |
if (array_key_exists("tag", $params)) { |
|
49 |
$this->stmt->bindParam(':tag',$params['tag'], PDO::PARAM_STR); |
|
50 |
} |
|
51 |
if (array_key_exists("finished", $params)) { |
|
52 |
$this->stmt->bindParam(':finished',$params['finished']); |
|
53 |
} |
|
48 | 54 |
if (array_key_exists("manuscript", $params)) { |
49 | 55 |
for ($x = 0; $x < count($params["manuscript"]); $x += 1) { |
50 | 56 |
$this->stmt->bindParam(':manuscript'.$x,$params["manuscript"][$x], PDO::PARAM_INT); |
application/view/Index.php | ||
---|---|---|
6 | 6 |
function doSearch () { |
7 | 7 |
// (A1) GET SEARCH TERM |
8 | 8 |
var data = new FormData(); |
9 |
data.append("manuscript", "0,3"); //příklad pro filtraci manuscriptů, asi se ještě upraví |
|
10 |
// data.append("lemma", "ok"); |
|
9 |
//data.append("manuscript", "0,3"); //příklad pro filtraci manuscriptů, asi se ještě uprav |
|
10 |
data.append("page", "1"); |
|
11 |
data.append("items_per_page", "50"); |
|
12 |
data.append("finished", "false"); |
|
11 | 13 |
// data.append("tag_pos", "V"); |
12 | 14 |
// data.append("tag_verb_aspect", "P"); |
13 | 15 |
// data.append("tag_number", "S"); |
Také k dispozici: Unified diff
Feature #8345 Implementce filterů dat - Server
stránkování na serveru