getMessage(); // } function ResponseToMeasurement($response) { global $link; $json = json_decode($response); foreach ($json->data as $item) { $comment = json_encode($item->measurement_comment); $worker = json_encode($item->worker); $compliance = intval($item->value_compliance); $is_hw = intval($item->is_hw_measurement); $value = floatval($item->measurement_value); $complete = intval($item->measurement_complete); $qstr = "insert into asusg_measurements ( measurement_id, measurement_name, characteristic_id, characteristic_name, measurement_stage, measurement_complete, measurement_norm, measurement_value, value_type, value_compliance, worker, measurement_date, measurement_comment, work_id, is_hw_measurement, smopp_date_requested ) values ( '$item->measurement_id', '$item->measurement_name', '$item->characteristic_id', '$item->characteristic_name', $item->measurement_stage, $complete, '$item->measurement_norm', $value, '$item->value_type', $compliance, '$worker', $item->measurement_date, '$comment', '$item->work_id', $is_hw, now() )"; mysqli_query($link, $qstr); } }