From 23a4472f12aca3dd34741744509bc024d115fde0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CVeLiTi=E2=80=9D?= <“info@veliti.nl”> Date: Thu, 28 Mar 2024 19:10:47 +0100 Subject: [PATCH] Mass_update - improved logfunction --- api/v1/get/application.php | 2 +- equipments_mass_update.php | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/api/v1/get/application.php b/api/v1/get/application.php index 6c52296..38a7e9b 100644 --- a/api/v1/get/application.php +++ b/api/v1/get/application.php @@ -84,7 +84,7 @@ if(isset($get_content) && $get_content!=''){ //------------------------------------------ switch ($action) { case 'get_rowID': - $sql = 'SELECT e.rowID from equipment e '.$whereclause.''; + $sql = 'SELECT e.rowID, p.productcode, p.productname from equipment e LEFT JOIN products p ON e.productrowid = p.rowID '.$whereclause.''; break; diff --git a/equipments_mass_update.php b/equipments_mass_update.php index 4f488c2..b259d33 100644 --- a/equipments_mass_update.php +++ b/equipments_mass_update.php @@ -40,13 +40,23 @@ if ($update_allowed === 1){ $total_rowID = 0; $total_not_found = 0; + $output_excel_display .= ' + + + + + + + + + '; + + foreach ($excel_data_1 as $key => $val){ //GET ROW ID $api_url = '/v1/application/serialnumber='.$val.'/get_rowID'; $responses = ioServer($api_url,''); - - //Decode Payload if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = null;} @@ -54,6 +64,8 @@ if ($update_allowed === 1){ if (isset ($responses->rowID)){ $output_excel[$val]['rowID'] = $responses->rowID; $output_excel[$val]['serialnumber'] = $val; + $output_excel[$val]['productcode'] = $responses->productcode; + $output_excel[$val]['productname'] = $responses->productname; $output_excel[$val]['order_ref'] = $_POST['order_ref']; $output_excel[$val]['status'] = $_POST['status']; $output_excel[$val]['salesid'] = $_POST['salesid']; @@ -67,7 +79,7 @@ if ($update_allowed === 1){ } else { - $output_excel_display .= $equipment_label2.' '.$val.' - '.$mass_update_not_found.'
'; + $output_excel_display .= ''; //Count total_not_found $total_not_found++; } @@ -86,13 +98,14 @@ if ($update_allowed === 1){ } else { - $output_excel_display .= $equipment_label2.' '.$data_to_update['serialnumber'].' - '.$mass_update_correct.'
'; + $output_excel_display .= ''; } } //Totals $total_input = $total_rowID + $total_not_found; $total_summary = '('.$total_rowID.$general_page_of.$total_input.')
'; + $output_excel_display .= '
'.$equipment_label2.''.$product_code.''.$product_name.''.$product_status.'
'.$val.''.$mass_update_not_found.'
'.$data_to_update['serialnumber'].''.$data_to_update['productcode'].''.$data_to_update['productname'].''.$mass_update_correct.'
'; } } @@ -209,9 +222,9 @@ if ($update_allowed === 1){
'.$tab3.' '.$total_summary.'
-
+
'.$output_excel_display.' - + '; }