-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript_change_count_row.php
More file actions
42 lines (27 loc) · 1.01 KB
/
script_change_count_row.php
File metadata and controls
42 lines (27 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
$action = $_POST['action'];
include "database.php";
switch ($action){
case '-':
(new CProducts)->len_table_reduce();
break;
case '+':
$db = new CProducts;
$db->len_table_add();
$len = $_POST['len'];
$data = $db->get_data($len);
$json_data = array();
for ($i=0;$i<count($data);$i+=1){
if ($data[$i]["IS_HIDDEN"] == false){
array_push($json_data, array());
array_push($json_data[$i], $data[$i]["ID"]);
array_push($json_data[$i], $data[$i]["PRODUCT_ID"]);
array_push($json_data[$i], $data[$i]["PRODUCT_NAME"]);
array_push($json_data[$i], $data[$i]["PRODUCT_PRICE"]);
array_push($json_data[$i], $data[$i]["PRODUCT_ARTICLE"]);
array_push($json_data[$i], $data[$i]["PRODUCT_QUANTITY"]);
array_push($json_data[$i], $data[$i]["DATE_CREATE"]);
}
}
echo json_encode($json_data);
}