<?php 
include('includes/config/config.php');
include ('includes/functions.php');
include ('log_entry.php');
error_log ( "Start Printing Request Attributes" );
$requestStr="";
foreach ( $_REQUEST as $key => $value ) {
    $requestStr.=$key . " : " . $value . "\n";
    error_log ( $key . " : " . $value . "<br />\r\n" );
}
save_log($requestStr,'canten Location','SAVE','save_food_handler_canteen_location.php');

$canteen_id = $_POST['canteen_id'];
error_log("Canteterhdgfhdf  " . $canteen_id);
$canteen_location =$_POST['canteen_location'];
$canteen_code =$_POST['canteen_code'];
$type =$_POST['type'];

error_log("location type" . $type);

if(!empty($canteen_id)){
$query = "UPDATE canteen_master set canteen_code='$canteen_code',canteen_location = '$canteen_location', type = '$type' , modified_by = '".$_SESSION['user_id']."' where id = 
'".$canteen_id."'    ";
}
else {                                                                   
$query = "insert into canteen_master(canteen_location, canteen_code ,type, modified_by) 
		  values ('$canteen_location','$canteen_code','$type','".$_SESSION['user_id']."' ); ";
}
error_log("Query canteen**************************************". $query);
if (!$result = @mysqli_query($conn,$query)) {
            exit(mysqli_error($conn));
}
?>