refactoring of table database, added script for upgrading to versions >= 2.0, added multi-user support
Signed-off-by: giandonato.inverso@edempg.it <giandonato.inverso@studenti.unimi.it>
This commit is contained in:
committed by
giandonato.inverso@edempg.it
parent
cdab7df35d
commit
575a6b3caa
@@ -7,11 +7,17 @@ require_once BASE_PATH . '/lib/DynamicQrcode/DynamicQrcode.php';
|
||||
$db = getDbInstance();
|
||||
$dynamic_qrcode = new DynamicQrcode();
|
||||
|
||||
$select = array('id', 'filename', 'identifier', 'link', 'qrcode', 'scan', 'state', 'created_at', 'updated_at');
|
||||
$select = array('id', 'id_owner', 'filename', 'identifier', 'link', 'qrcode', 'scan', 'state', 'created_at', 'updated_at');
|
||||
$search_fields = array('filename', 'identifier', 'link');
|
||||
require_once BASE_PATH . '/includes/search_order.php';
|
||||
$page = filter_input(INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS) ?? 1;
|
||||
$db->pageLimit = 15;
|
||||
|
||||
if($_SESSION['type'] !== 'super') {
|
||||
$db->where("id_owner", $_SESSION['user_id']);
|
||||
$db->orWhere ("id_owner", NULL, 'IS');
|
||||
}
|
||||
|
||||
$rows = $db->arraybuilder()->paginate('dynamic_qrcodes', $page, $select);
|
||||
$total_pages = $db->totalPages;
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user