ESH/save_city.php

28 lines
1014 B
PHP
Raw Permalink Normal View History

2024-10-23 18:28:06 +05:30
<?php
include('includes/config/config.php');
include('log_entry.php');
$city_id= $_POST['city_id'];
$city= $_POST['city'];
$AC_cost= $_POST['AC_cost'];
$AC_amb_charge= $_POST['AC_amb_charge'];
$NON_AC_cost= $_POST['NON_AC_cost'];
$NON_AC_amb_charge= $_POST['NON_AC_amb_charge'];
// $head_name = $_POST['section_head_name'];
if(!empty($city_id)){
$query = "update citys set city_id='$city_id',city = '$city',AC_cost = '$AC_cost',AC_amb_charge = '$AC_amb_charge',NON_AC_cost = '$NON_AC_cost',NON_AC_amb_charge = '$NON_AC_amb_charge',modified_by = '".$_SESSION['user_id']."' where city_id = '".$city_id."'";
error_log("update city: ".$query);
}
else {
$query = "insert into citys set city_id='$city_id',city = '$city',AC_cost = '$AC_cost',AC_amb_charge = '$AC_amb_charge',NON_AC_cost = '$NON_AC_cost',NON_AC_amb_charge = '$NON_AC_amb_charge',modified_by = '".$_SESSION['user_id']."'";
error_log("insert city".$query);
}
if (!$result = @mysqli_query($conn,$query)) {
exit(mysqli_error($conn));
}
?>