ESH/save_agency.php

30 lines
1.2 KiB
PHP
Raw Normal View History

2024-10-23 18:28:06 +05:30
<?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" );
}
error_log ( "End Printing Request Attributes" );
save_log($requestStr,'Disposal Agency','SAVE','save_agency.php');
$agency_id = $_POST['agency_id'];
$agency_name =$_POST['agency_name'];
$agency_address = $_POST['agency_address'];
$regestration_no = $_POST['regestration_no'];
$allocated_reg_no = $_POST['allocated_reg_no'];
if(!empty($agency_id)){
$query = "update disposal_agency set agency_name = '$agency_name', agency_address = '$agency_address', regestration_no = '$regestration_no',allocated_reg_no = '$allocated_reg_no',modified_by = '".$_SESSION['user_id']."' where agency_id =
'".$agency_id."' ";
}
else {
$query = "insert into disposal_agency(agency_name,agency_address,regestration_no,allocated_reg_no,modified_by)
values ('$agency_name','$agency_address','$regestration_no','$allocated_reg_no','".$_SESSION['user_id']."' ); ";
}
if (!$result = @mysqli_query($conn,$query)) {
exit(mysqli_error($conn));
}
?>