CMXX - Changed history to equipment_history
This commit is contained in:
@@ -236,7 +236,7 @@ elseif ($command == 'delete' && (isAllowed('equipment_manage',$profile,$permissi
|
||||
$stmt = $pdo->prepare('DELETE FROM equipment WHERE rowID = ? '.$whereclause.'');
|
||||
$stmt->execute([ $id ]);
|
||||
//delete history related to equipment
|
||||
$stmt = $pdo->prepare('DELETE FROM history WHERE equipmentid = ?');
|
||||
$stmt = $pdo->prepare('DELETE FROM equipment_history WHERE equipmentid = ?');
|
||||
$stmt->execute([ $id ]);
|
||||
//Add deletion to changelog
|
||||
changelog($dbname,'equipment',$id,'Delete','Delete',$username);
|
||||
|
||||
@@ -67,7 +67,7 @@ $input_insert = substr($input_insert, 1); //Clean clause - remove first comma
|
||||
|
||||
//QUERY AND VERIFY ALLOWED
|
||||
if ($command == 'update' && !isset($post_content['delete']) && isAllowed('history',$profile,$permission,'U') === 1){
|
||||
$sql = 'UPDATE history SET '.$clause.' WHERE rowID = ?';
|
||||
$sql = 'UPDATE equipment_history SET '.$clause.' WHERE rowID = ?';
|
||||
$execute_input[] = $id;
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute($execute_input);
|
||||
@@ -78,7 +78,7 @@ elseif ($command == 'insert' && !isset($post_content['delete']) && isAllowed('hi
|
||||
$stmt->execute($execute_input);
|
||||
}
|
||||
elseif ($command == 'delete' && isAllowed('history',$profile,$permission,'D') === 1){
|
||||
$stmt = $pdo->prepare('DELETE FROM history WHERE rowID = ?');
|
||||
$stmt = $pdo->prepare('DELETE FROM equipment_history WHERE rowID = ?');
|
||||
$stmt->execute([ $id ]);
|
||||
|
||||
//Add deletion to changelog
|
||||
|
||||
@@ -197,7 +197,7 @@ if ($command == 'update' && (isAllowed('user',$profile,$permission,'U') === 1 ||
|
||||
$sql2= 'UPDATE communication SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||
$sql3= 'UPDATE contracts SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||
$sql4= 'UPDATE feedback SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||
$sql5= 'UPDATE history SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||
$sql5= 'UPDATE equipment_history SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||
$sql6= 'UPDATE opportunities SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||
$sql7= 'UPDATE orders SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||
$sql8= 'UPDATE products SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||
|
||||
Reference in New Issue
Block a user