CMXX - Changed history to equipment_history
This commit is contained in:
@@ -973,7 +973,7 @@ function serviceEvents ($messages,$page){
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++
|
||||
//GET from DB
|
||||
$pdo = dbConnect($dbname);
|
||||
$sql = 'SELECT description FROM history WHERE rowID = "'.$test.'"';
|
||||
$sql = 'SELECT description FROM equipment_history WHERE rowID = "'.$test.'"';
|
||||
$stmt = $pdo->query($sql);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetch();
|
||||
@@ -1052,7 +1052,7 @@ function serviceReport($history, $request, $country_code)
|
||||
if (isset($json_array->maintenance_test)) {
|
||||
//Get Maintenance Test directly from DB
|
||||
$pdo = dbConnect($dbname);
|
||||
$stmt = $pdo->prepare('SELECT description FROM history WHERE rowID = ?');
|
||||
$stmt = $pdo->prepare('SELECT description FROM equipment_history WHERE rowID = ?');
|
||||
$stmt->execute([$json_array->maintenance_test]);
|
||||
$maintenance_test = $stmt->fetch();
|
||||
$test_fail = $maintenance_test['description'];
|
||||
@@ -1482,7 +1482,7 @@ function serviceReport($history, $request, $country_code)
|
||||
|
||||
//Get visualinspection directly from DB
|
||||
$pdo = dbConnect($dbname);
|
||||
$stmt = $pdo->prepare('SELECT description FROM history WHERE rowID = ?');
|
||||
$stmt = $pdo->prepare('SELECT description FROM equipment_history WHERE rowID = ?');
|
||||
$stmt->execute([$json_array->visualinspection]);
|
||||
$visualinspection = $stmt->fetch();
|
||||
|
||||
@@ -2111,7 +2111,7 @@ function geolocationUpdate($token){
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
|
||||
//GET ALL WARRANTY REGISTRATIONS WHERE NO GEOLOCATION SET
|
||||
$sql = 'SELECT h.equipmentid, h.description FROM equipment e join history h on e.rowID = h.equipmentid where h.type = "Warranty" AND e.geolocation is Null';
|
||||
$sql = 'SELECT h.equipmentid, h.description FROM equipment e join equipment_history h on e.rowID = h.equipmentid where h.type = "Warranty" AND e.geolocation is Null';
|
||||
$pdo = dbConnect($dbname);
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute();
|
||||
@@ -2233,15 +2233,15 @@ function getQuestions($type){
|
||||
}
|
||||
}
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// convert cartest from history to cartest table
|
||||
// convert cartest FROM equipment_history to cartest table
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
function convertCartest(){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
|
||||
//GET CARTEST FROM HISTORY TABLE
|
||||
//GET CARTEST FROM equipment_history TABLE
|
||||
$pdo = dbConnect($dbname);
|
||||
$sql = 'SELECT * FROM history WHERE type="cartest"';
|
||||
$sql = 'SELECT * FROM equipment_history WHERE type="cartest"';
|
||||
$stmt = $pdo->prepare($sql);
|
||||
//Excute Query
|
||||
$stmt->execute();
|
||||
@@ -2283,7 +2283,7 @@ $messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$stmt->execute([$carbrand,$cartype,$header,$questions,$datapoints,$nametester,$accounthierarchy]);
|
||||
|
||||
//MARK HISTORY ITEM FOR DELETATION
|
||||
$sql = 'UPDATE history SET type = "delete" WHERE rowID = '.$message['rowID'];
|
||||
$sql = 'UPDATE equipment_history SET type = "delete" WHERE rowID = '.$message['rowID'];
|
||||
$stmt = $pdo->prepare($sql);
|
||||
//Excute Query
|
||||
$stmt->execute();
|
||||
@@ -2304,7 +2304,7 @@ function traintotalMeasurement(){
|
||||
$pdo = dbConnect($dbname);
|
||||
|
||||
//GET DATA
|
||||
$sql = 'SELECT h.rowID, h.description,h.equipmentid,p.productcode,e.hw_version FROM history h JOIN equipment e ON h.equipmentid = e.rowID JOIN products p ON e.productrowid = p.rowID where p.healthindex = 1 and h.type="Maintenance_Test" and h.description like "%doubletestvalues%"';
|
||||
$sql = 'SELECT h.rowID, h.description,h.equipmentid,p.productcode,e.hw_version FROM equipment_history h JOIN equipment e ON h.equipmentid = e.rowID JOIN products p ON e.productrowid = p.rowID where p.healthindex = 1 and h.type="Maintenance_Test" and h.description like "%doubletestvalues%"';
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute();
|
||||
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
@@ -2566,7 +2566,7 @@ function storeMeasurementEquipment($serialnumber){
|
||||
$clause = (!empty($serialnumber) || $serialnumber !='')? 'e.serialnumber = "'.$serialnumber.'" AND': '';
|
||||
|
||||
//GET DATA
|
||||
$sql = 'SELECT h.rowID, h.description,h.equipmentid,p.productcode,e.hw_version FROM history h JOIN equipment e ON h.equipmentid = e.rowID JOIN products p ON e.productrowid = p.rowID where '.$clause.' type="Maintenance_Test" and description like "%doubletestvalues%"';
|
||||
$sql = 'SELECT h.rowID, h.description,h.equipmentid,p.productcode,e.hw_version FROM equipment_history h JOIN equipment e ON h.equipmentid = e.rowID JOIN products p ON e.productrowid = p.rowID where '.$clause.' type="Maintenance_Test" and description like "%doubletestvalues%"';
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute();
|
||||
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
Reference in New Issue
Block a user