Merge branch 'development'

This commit is contained in:
“VeLiTi”
2024-12-03 11:11:52 +01:00
5 changed files with 12 additions and 12 deletions

View File

@@ -204,7 +204,7 @@ if (!empty($post_content['sn']) && !empty($post_content['testdetails'])) {
} }
else { else {
// Insert Equipment // Insert Equipment
$sql = "INSERT INTO history (equipmentid,type,description,createdby ) VALUES (?,?,?,?)"; $sql = "INSERT INTO equipment_history (equipmentid,type,description,createdby ) VALUES (?,?,?,?)";
$stmt = $pdo->prepare($sql); $stmt = $pdo->prepare($sql);
$stmt->execute([$rowID,$historytype,$testdetails,$user]); $stmt->execute([$rowID,$historytype,$testdetails,$user]);
$last_id = $pdo->lastInsertId(); $last_id = $pdo->lastInsertId();
@@ -322,7 +322,7 @@ if (!empty($post_content['sn']) && !empty($post_content['testdetails'])) {
if($total_servicetool != 0){ if($total_servicetool != 0){
// Insert historyitem // Insert historyitem
$sql = "INSERT INTO history (equipmentid,type,description,createdby) VALUES (?,?,?,?)"; $sql = "INSERT INTO equipment_history (equipmentid,type,description,createdby) VALUES (?,?,?,?)";
$stmt = $pdo->prepare($sql); $stmt = $pdo->prepare($sql);
$stmt->execute([$rowID_servicetool,$historytype,$testdetails,$user]); $stmt->execute([$rowID_servicetool,$historytype,$testdetails,$user]);
//Update status to InUse //Update status to InUse

View File

@@ -108,7 +108,7 @@ switch ($action) {
if ($rowID){ if ($rowID){
//check if under warranty //check if under warranty
$warranty = getrowID($dbname,'rowID','history','equipmentid="'.$rowID['rowID'].'" && (type="'.$type9.'" || type="'.$type10.'" || type="'.$type11.'" || type="'.$type12.'")'); $warranty = getrowID($dbname,'rowID','equipment_history','equipmentid="'.$rowID['rowID'].'" && (type="'.$type9.'" || type="'.$type10.'" || type="'.$type11.'" || type="'.$type12.'")');
if ($warranty){ if ($warranty){
// -------------------------------------------- // --------------------------------------------
// Already under contract // Already under contract
@@ -125,7 +125,7 @@ switch ($action) {
$firmware_account_send = 1; $firmware_account_send = 1;
//create history //create history
// Prepare queries // Prepare queries
$sql = 'INSERT INTO history (equipmentid, type, description, created, createdby) VALUES (?,?,?,?,?)'; $sql = 'INSERT INTO equipment_history (equipmentid, type, description, created, createdby) VALUES (?,?,?,?,?)';
$stmt = $pdo->prepare($sql); $stmt = $pdo->prepare($sql);
$stmt->execute([$rowID['rowID'],$type9,$description,$timestamp,$post_content['email']]); $stmt->execute([$rowID['rowID'],$type9,$description,$timestamp,$post_content['email']]);
@@ -218,7 +218,7 @@ switch ($action) {
$rowID = getrowID($dbname,'rowID','equipment','serialnumber="'.$post_content['sn'].'"'); $rowID = getrowID($dbname,'rowID','equipment','serialnumber="'.$post_content['sn'].'"');
if ($rowID){ if ($rowID){
//check if under warranty //check if under warranty
$warranty = getrowID($dbname,'rowID','history','equipmentid="'.$rowID['rowID'].'" && (type="'.$type9.'" || type="'.$type10.'" || type="'.$type11.'" || type="'.$type12.'")'); $warranty = getrowID($dbname,'rowID','equipment_history','equipmentid="'.$rowID['rowID'].'" && (type="'.$type9.'" || type="'.$type10.'" || type="'.$type11.'" || type="'.$type12.'")');
if ($warranty){ if ($warranty){
// -------------------------------------------- // --------------------------------------------
// Already under contract // Already under contract
@@ -232,7 +232,7 @@ switch ($action) {
// -------------------------------------------- // --------------------------------------------
$firmware_account_send = 1; $firmware_account_send = 1;
//create history //create history
$sql = 'INSERT INTO history (equipmentid, type, description, created, createdby) VALUES (?,?,?,?,?)'; $sql = 'INSERT INTO equipment_history (equipmentid, type, description, created, createdby) VALUES (?,?,?,?,?)';
$stmt = $pdo->prepare($sql); $stmt = $pdo->prepare($sql);
$stmt->execute([$rowID['rowID'],$type9,$description,$timestamp,$post_content['email']]); $stmt->execute([$rowID['rowID'],$type9,$description,$timestamp,$post_content['email']]);

View File

@@ -73,7 +73,7 @@ if ($command == 'update' && !isset($post_content['delete']) && isAllowed('histor
$stmt->execute($execute_input); $stmt->execute($execute_input);
} }
elseif ($command == 'insert' && !isset($post_content['delete']) && isAllowed('history',$profile,$permission,'C') === 1){ elseif ($command == 'insert' && !isset($post_content['delete']) && isAllowed('history',$profile,$permission,'C') === 1){
$sql = 'INSERT INTO history ('.$clause_insert.') VALUES ('.$input_insert.')'; $sql = 'INSERT INTO equipment_history ('.$clause_insert.') VALUES ('.$input_insert.')';
$stmt = $pdo->prepare($sql); $stmt = $pdo->prepare($sql);
$stmt->execute($execute_input); $stmt->execute($execute_input);
} }

View File

@@ -190,7 +190,7 @@ if (isset($post_content['sn']) && isset($post_content['payload'])){
} }
else { else {
// Insert Equipment // Insert Equipment
$sql = "INSERT INTO history (equipmentid,type,description,createdby ) VALUES (?,?,?,?)"; $sql = "INSERT INTO equipment_history (equipmentid,type,description,createdby ) VALUES (?,?,?,?)";
$stmt = $pdo->prepare($sql); $stmt = $pdo->prepare($sql);
$stmt->execute([$rowID,$historytype,$testdetails,$user]); $stmt->execute([$rowID,$historytype,$testdetails,$user]);
$last_id = $pdo->lastInsertId(); $last_id = $pdo->lastInsertId();
@@ -308,7 +308,7 @@ if (isset($post_content['sn']) && isset($post_content['payload'])){
if($total_servicetool != 0){ if($total_servicetool != 0){
// Insert historyitem // Insert historyitem
$sql = "INSERT INTO history (equipmentid,type,description,createdby) VALUES (?,?,?,?)"; $sql = "INSERT INTO equipment_history (equipmentid,type,description,createdby) VALUES (?,?,?,?)";
$stmt = $pdo->prepare($sql); $stmt = $pdo->prepare($sql);
$stmt->execute([$rowID_servicetool,$historytype,$testdetails,$user]); $stmt->execute([$rowID_servicetool,$historytype,$testdetails,$user]);
//Update status to InUse //Update status to InUse
@@ -405,7 +405,7 @@ else {
$stmt->execute($execute_input); $stmt->execute($execute_input);
} }
elseif ($command == 'insert' && !isset($post_content['delete']) && isAllowed('history',$profile,$permission,'C') === 1){ elseif ($command == 'insert' && !isset($post_content['delete']) && isAllowed('history',$profile,$permission,'C') === 1){
$sql = 'INSERT INTO history ('.$clause_insert.') VALUES ('.$input_insert.')'; $sql = 'INSERT INTO equipment_history ('.$clause_insert.') VALUES ('.$input_insert.')';
$stmt = $pdo->prepare($sql); $stmt = $pdo->prepare($sql);
$stmt->execute($execute_input); $stmt->execute($execute_input);
} }

View File

@@ -170,7 +170,7 @@ function menu($selected,$selected_child){
foreach ($main_menu as $menu_item){ foreach ($main_menu as $menu_item){
if (in_array($item = $menu_item, $profile,)){ if (in_array($item = $menu_item, $profile,)){
//Main URL //Main URL
$menu .= '<a href="index.php?page='.$urls[$item]['url'].'"' . ($selected == $urls[$item]['selected'] ? ' class="selected"' : '') . '><i class="'.$urls[$item]['icon'].'"></i>'.ucfirst(${$urls[$item]['name']}).'</a>'; $menu .= '<a href="index.php?page='.$urls[$item]['url'].'"' . ($selected == $urls[$item]['selected'] ? ' class="selected"' : '') . '><i class="'.$urls[$item]['icon'].'"></i>'.ucfirst((${$urls[$item]['name']}?? 'not specified')).'</a>';
//DEFINE SUBMENU //DEFINE SUBMENU
$sub_menu = $item.'_sub' ?? ''; $sub_menu = $item.'_sub' ?? '';
@@ -181,7 +181,7 @@ function menu($selected,$selected_child){
foreach($sub_menu as $key){ foreach($sub_menu as $key){
//CHECK IF USER IS ALLOWED //CHECK IF USER IS ALLOWED
if (in_array($key,$profile)){ if (in_array($key,$profile)){
$menu .= '<a href="index.php?page='.$urls[$key]['url'].'"' . ($selected == $urls[$key]['selected'] && $selected_child == 'view' ? ' class="selected"' : '') . '><span>&#9724;</span>'.ucfirst(${$urls[$key]['name']}).'</a>'; $menu .= '<a href="index.php?page='.$urls[$key]['url'].'"' . ($selected == $urls[$key]['selected'] && $selected_child == 'view' ? ' class="selected"' : '') . '><span>&#9724;</span>'.ucfirst((${$urls[$key]['name']}?? 'not specified')).'</a>';
} }
} }
$menu .= '</div>'; $menu .= '</div>';