39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?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,'Dosage Category','SAVE','save_dosage_category.php');
|
|
$initial_query="";
|
|
$end_query="";
|
|
|
|
if(!empty($_POST['dosage_category_id'])){
|
|
|
|
$initial_query="update dosage_category ";
|
|
$end_query="where dosage_category_id='".$_POST['dosage_category_id']."' ";
|
|
}else{
|
|
|
|
$initial_query="insert into dosage_category ";
|
|
$end_query="";
|
|
}
|
|
|
|
$final_query=$initial_query." set dosage_category='".$_POST['dosage_category']."',remarks='".$_POST['remarks']."',modified_by='".$_SESSION['user_id']."' ".$end_query;
|
|
// echo $final_query;
|
|
|
|
if (!$result = @mysqli_query($conn,$final_query)) {
|
|
exit(mysqli_error($conn));
|
|
$data="error";
|
|
|
|
}else{
|
|
|
|
$data="success";
|
|
}
|
|
|
|
echo json_encode($data);
|
|
?>
|