CMXX - Changed history to equipment_history

This commit is contained in:
“VeLiTi”
2024-12-02 15:40:05 +01:00
parent 868d73c6b5
commit ad51669e32
17 changed files with 103 additions and 68 deletions

View File

@@ -194,10 +194,10 @@ if (!empty($post_content['sn']) && !empty($post_content['testdetails'])) {
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Insert or update history item ++++++++++++++++++++++++
// Insert or UPDATE equipment_history item ++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
if ($updateObject_visual == 1){
$sql = "UPDATE history SET description = '$testdetails' WHERE rowID = ?";
$sql = "UPDATE equipment_history SET description = '$testdetails' WHERE rowID = ?";
$stmt = $pdo->prepare($sql);
$stmt->execute([$visualinspectionID]);
$last_id = $visualinspectionID;
@@ -263,7 +263,7 @@ if (!empty($post_content['sn']) && !empty($post_content['testdetails'])) {
changelog($dbname,'equipment',$rowID,'status',$update_status,$user);
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
//Update history type ++++++++++++++++++++++++++
//UPDATE equipment_history type ++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
if ($historyUpdate_type == 1){
//Check if servicereport comes from ServiceTool else inhouse
@@ -275,8 +275,8 @@ if (!empty($post_content['sn']) && !empty($post_content['testdetails'])) {
$visualID = $post_content['testdetails']['visualinspection'];
}
//Update history record
$sql = "UPDATE history SET type = ? where rowID= ? or rowID= ?";
//UPDATE equipment_history record
$sql = "UPDATE equipment_history SET type = ? where rowID= ? or rowID= ?";
$stmt = $pdo->prepare($sql);
$stmt->execute([$type15,$visualID,$maintenanceID]);
}
@@ -305,7 +305,7 @@ if (!empty($post_content['sn']) && !empty($post_content['testdetails'])) {
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Update history of service tool ++++++++++++++++++++++++++
// UPDATE equipment_history of service tool ++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
if ($servicetoolHistoryUpdate == 1 && !empty($sn_service)){
@@ -336,7 +336,7 @@ if (!empty($post_content['sn']) && !empty($post_content['testdetails'])) {
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
if ($sendServiceReport == 1){
//GET STORED SERVICE REPORT
$sql = 'SELECT h.rowID as historyID, h.type, h.description, h.created, h.createdby FROM history h WHERE rowID = ?';
$sql = 'SELECT h.rowID as historyID, h.type, h.description, h.created, h.createdby FROM equipment_history h WHERE rowID = ?';
$pdo = dbConnect($dbname);
$stmt = $pdo->prepare($sql);
$stmt->execute([$last_id]);