CIM77 - Update

This commit is contained in:
“VeLiTi”
2024-05-17 10:51:45 +02:00
parent 448c08fec3
commit 2036869663
6 changed files with 33 additions and 22 deletions

View File

@@ -133,12 +133,13 @@ elseif (isset($criterias['history']) && $criterias['history'] != ''){
break;
default:
$sort = '';
$current_page = isset($criterias['p']) && is_numeric($criterias['p']) ? (int)$criterias['p'] : 1;
$start_page = ($current_page - 1) * $page_rows_history;
$sort = ' ORDER BY h.created DESC LIMIT '.$start_page.','.$page_rows_history;
break;
}
//request history
$sql ='SELECT h.rowID as historyID, e.rowID as equipmentID, h.equipmentid as h_equipmentid, e.serialnumber, h.type, h.description, h.created, h.createdby from history h LEFT JOIN equipment e ON h.equipmentid = e.rowID '.$whereclause.$sort;
$sql ='SELECT h.rowID as historyID, e.rowID as equipmentID, h.equipmentid as h_equipmentid, e.serialnumber, h.type, h.description, h.created, h.createdby from history h LEFT JOIN equipment e ON h.equipmentid = e.rowID '.$whereclause.$sort;
}
else {
// GET SORT INDICATOR

View File

@@ -63,6 +63,12 @@ if(isset($get_content) && $get_content!=''){
//build up search
$clause .= ' AND (h.rowID like :'.$v[0].' OR h.createdby like :'.$v[0].')';
}
elseif ($v[0] == 'type' && $v[1] == 'servicereport') {
//Filter out only relevant servicereports
$filter_key_1 = '"%serialnumber%"';
$filter_key_2 = '"ServiceReport"';
$clause .= ' AND h.type = '.$filter_key_2.' AND h.description like '.$filter_key_1;
}
else {//create clause
$clause .= ' AND '.$v[0].' = :'.$v[0];
}