CIM77 - Service reports alleen laatste 5
This commit is contained in:
@@ -119,9 +119,26 @@ elseif (isset($criterias['totals']) && $criterias['totals'] =='' && isset($crite
|
||||
//Request for total rows for history reports
|
||||
$sql ='SELECT count(*) as count from history h LEFT JOIN equipment e ON h.equipmentid = e.rowID '.$whereclause.'';
|
||||
}
|
||||
elseif (isset($criterias['history']) && $criterias['history'] ==''){
|
||||
elseif (isset($criterias['history']) && $criterias['history'] != ''){
|
||||
|
||||
//History INDICATOR
|
||||
/*
|
||||
0 Show All
|
||||
1 Created DESC, LIMIT 5
|
||||
*/
|
||||
|
||||
switch ($criterias['history']) {
|
||||
case 1:
|
||||
$sort = ' ORDER BY h.created DESC LIMIT 0,'.$page_rows_equipment_servicereporst;
|
||||
break;
|
||||
|
||||
default:
|
||||
$sort = '';
|
||||
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.'';
|
||||
$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
|
||||
@@ -205,6 +222,14 @@ if (!empty($criterias)){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// Debuglog
|
||||
//------------------------------------------
|
||||
if (debug){
|
||||
$message = $date.';'.$sql.';'.$username;
|
||||
debuglog($message);
|
||||
}
|
||||
//------------------------------------------
|
||||
//Add paging details
|
||||
//------------------------------------------
|
||||
@@ -213,7 +238,7 @@ if(isset($criterias['totals']) && $criterias['totals']==''){
|
||||
$messages = $stmt->fetch();
|
||||
$messages = $messages[0];
|
||||
}
|
||||
elseif ((isset($criterias['history']) && $criterias['history'] =='') || (isset($criterias['download']) && $criterias['download'] =='')){
|
||||
elseif ((isset($criterias['history']) && $criterias['history'] !='') || (isset($criterias['download']) && $criterias['download'] =='')){
|
||||
//Excute Query
|
||||
$stmt->execute();
|
||||
//Get results
|
||||
|
||||
Reference in New Issue
Block a user