|
6 | 6 | $db = getDbInstance(); |
7 | 7 |
|
8 | 8 | //Get Dynamic qr code rows |
9 | | -if($_SESSION['type'] !== 'super') { |
| 9 | +if($_SESSION['type'] !== 'super') { |
10 | 10 | $db->where("id_owner", $_SESSION['user_id']); |
11 | 11 | $db->orWhere ("id_owner", NULL, 'IS'); |
12 | 12 | } |
13 | 13 | $numQrcode_dynamic = $db->getValue("dynamic_qrcodes", "count(*)"); |
14 | 14 |
|
15 | 15 | //Get Static qr code rows |
16 | | -if($_SESSION['type'] !== 'super') { |
| 16 | +if($_SESSION['type'] !== 'super') { |
17 | 17 | $db->where("id_owner", $_SESSION['user_id']); |
18 | 18 | $db->orWhere ("id_owner", NULL, 'IS'); |
19 | 19 | } |
|
22 | 22 | $total = $numQrcode_dynamic + $numQrcode_static; |
23 | 23 |
|
24 | 24 | //Get Total scan |
25 | | -if($_SESSION['type'] !== 'super') { |
| 25 | +if($_SESSION['type'] !== 'super') { |
26 | 26 | $db->where("id_owner", $_SESSION['user_id']); |
27 | 27 | $db->orWhere ("id_owner", NULL, 'IS'); |
28 | 28 | } |
|
32 | 32 | //I initialize the variables that will contain the daily values to 0 otherwise in the foreach loop they will be reset every time |
33 | 33 |
|
34 | 34 | //Get the number of DYNAMIC qr code created in 7 days and total scan |
35 | | -if($_SESSION['type'] !== 'super') |
36 | | - $createdQrcode_dynamic = $db->query("select `created_at`, `scan` from " . DATABASE_PREFIX . "dynamic_qrcodes where `created_at` > curdate()-7 AND (`id_owner`=" . $_SESSION['user_id'] . " OR `id_owner` IS NULL);"); |
| 35 | +if($_SESSION['type'] !== 'super') |
| 36 | + $createdQrcode_dynamic = $db->query("select `created_at`, `scan` from " . DATABASE_PREFIX . "dynamic_qrcodes where `created_at` > curdate()-7 AND (`id_owner`= " . $_SESSION['user_id'] . " OR `id_owner` IS NULL);"); |
37 | 37 | else |
38 | 38 | $createdQrcode_dynamic = $db->query("select `created_at`, `scan` from ".DATABASE_PREFIX."dynamic_qrcodes where `created_at` > curdate()-7;"); |
39 | 39 |
|
|
0 commit comments