$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;}
//IF rowID is found add to array
if (isset ($responses->rowID)){
$output_excel[$val]['rowID'] = $responses->rowID;
$output_excel[$val]['serialnumber'] = $val;
$output_excel[$val]['order_ref'] = $_POST['order_ref'];
$output_excel[$val]['status'] = $_POST['status'];
$output_excel[$val]['salesid'] = $_POST['salesid'];
$output_excel[$val]['soldto'] = $_POST['soldto'];
$output_excel[$val]['shipto'] = $_POST['shipto'];
$output_excel[$val]['location'] = $_POST['location'];
$output_excel[$val]['section'] = '';
//Count total_rowID
$total_rowID++;
}
else
{
$output_excel_display .= $equipment_label2.' '.$val.' - '.$mass_update_not_found.'
';
//Count total_not_found
$total_not_found++;
}
}
// Update all items of array
foreach ($output_excel as $data_to_update){
$data = json_encode($data_to_update, JSON_UNESCAPED_UNICODE);
//Secure data
$payload = generate_payload($data);
//API call
$responses = ioServer('/v1/equipments', $payload);
if ($responses === 'NOK'){
}
else {
$output_excel_display .= $equipment_label2.' '.$data_to_update['serialnumber'].' - '.$mass_update_correct.'
';
}
}
//Totals
$total_input = $total_rowID + $total_not_found;
$total_summary = '('.$total_rowID.$general_page_of.$total_input.')
';
}
}
// Handle success messages
if (isset($_GET['success_msg'])) {
if ($_GET['success_msg'] == 1) {
$success_msg = $message_eq_1;
}
if ($_GET['success_msg'] == 2) {
$success_msg = $message_eq_2;
}
if ($_GET['success_msg'] == 3) {
$success_msg = $message_eq_3;
}
}
template_header('Mass update', 'equipment_mass_update', 'view');
$view = '
'.$success_msg.'