36 lines
846 B
PHP
36 lines
846 B
PHP
<?php
|
|
include('includes/config/config.php');
|
|
include_once 'log_entry.php';
|
|
|
|
$device_map_id=$_POST['device_map_id'];
|
|
$device_id=$_POST['device_id'];
|
|
$categories = $_POST['checkup_section'];
|
|
|
|
error_log("COUNT::".count($categories));
|
|
|
|
$query="";
|
|
|
|
|
|
foreach ($categories as $category) {
|
|
if(!empty($device_map_id)){
|
|
$query = "update device_mapping_master set device_id='$device_id',checkup_section='$category' where device_map_id ='".$device_map_id."'";
|
|
}
|
|
else {
|
|
$query = "insert into device_mapping_master (device_id,checkup_section)
|
|
values ('$device_id','$category')";
|
|
}
|
|
error_log("DEVICE MAPPING QUERY::" .$query);
|
|
|
|
//echo $query;
|
|
if (!$result = @mysqli_query($conn,$query)) {
|
|
error_log("Failed to exuecuted device master:". mysqli_error($conn) . " Failing Query:". $query);
|
|
exit(mysqli_error($conn));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|