Mass_update - improved logfunction
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -40,13 +40,23 @@ if ($update_allowed === 1){
|
||||
$total_rowID = 0;
|
||||
$total_not_found = 0;
|
||||
|
||||
$output_excel_display .= '<table class="sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.$equipment_label2.'</th>
|
||||
<th>'.$product_code.'</th>
|
||||
<th>'.$product_name.'</th>
|
||||
<th>'.$product_status.'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
|
||||
|
||||
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.'<br>';
|
||||
$output_excel_display .= '<tr><td>'.$val.'</td><td></td><td></td><td>'.$mass_update_not_found.'</td></tr>';
|
||||
//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.'<br>';
|
||||
$output_excel_display .= '<tr><td>'.$data_to_update['serialnumber'].'</td><td>'.$data_to_update['productcode'].'</td><td>'.$data_to_update['productname'].'</td><td>'.$mass_update_correct.'</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
//Totals
|
||||
$total_input = $total_rowID + $total_not_found;
|
||||
$total_summary = '('.$total_rowID.$general_page_of.$total_input.')<br>';
|
||||
$output_excel_display .= '</tbody></table>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,9 +222,9 @@ if ($update_allowed === 1){
|
||||
<div class="block-header">
|
||||
<i class="fa-solid fa-bars fa-sm"></i>'.$tab3.' '.$total_summary.'
|
||||
</div>
|
||||
<div id="excel_table">
|
||||
<div class="table order-table" id="excel_table">
|
||||
'.$output_excel_display.'
|
||||
<table>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user