bug fix
This commit is contained in:
committed by
giandonato.inverso@edempg.it
parent
57930cf9db
commit
0360176490
+5
-5
@@ -6,14 +6,14 @@ require_once 'includes/auth_validate.php';
|
||||
$db = getDbInstance();
|
||||
|
||||
//Get Dynamic qr code rows
|
||||
if($_SESSION['type'] !== 'super') {
|
||||
if($_SESSION['type'] !== 'super') {
|
||||
$db->where("id_owner", $_SESSION['user_id']);
|
||||
$db->orWhere ("id_owner", NULL, 'IS');
|
||||
}
|
||||
$numQrcode_dynamic = $db->getValue("dynamic_qrcodes", "count(*)");
|
||||
|
||||
//Get Static qr code rows
|
||||
if($_SESSION['type'] !== 'super') {
|
||||
if($_SESSION['type'] !== 'super') {
|
||||
$db->where("id_owner", $_SESSION['user_id']);
|
||||
$db->orWhere ("id_owner", NULL, 'IS');
|
||||
}
|
||||
@@ -22,7 +22,7 @@ $numQrcode_static = $db->getValue("static_qrcodes", "count(*)");
|
||||
$total = $numQrcode_dynamic + $numQrcode_static;
|
||||
|
||||
//Get Total scan
|
||||
if($_SESSION['type'] !== 'super') {
|
||||
if($_SESSION['type'] !== 'super') {
|
||||
$db->where("id_owner", $_SESSION['user_id']);
|
||||
$db->orWhere ("id_owner", NULL, 'IS');
|
||||
}
|
||||
@@ -32,8 +32,8 @@ $numScan = $db->getOne(DATABASE_PREFIX."dynamic_qrcodes", "sum(scan) as numScan"
|
||||
//I initialize the variables that will contain the daily values to 0 otherwise in the foreach loop they will be reset every time
|
||||
|
||||
//Get the number of DYNAMIC qr code created in 7 days and total scan
|
||||
if($_SESSION['type'] !== 'super')
|
||||
$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);");
|
||||
if($_SESSION['type'] !== 'super')
|
||||
$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);");
|
||||
else
|
||||
$createdQrcode_dynamic = $db->query("select `created_at`, `scan` from ".DATABASE_PREFIX."dynamic_qrcodes where `created_at` > curdate()-7;");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user