31 lines
706 B
PHP
31 lines
706 B
PHP
<?php
|
|
include('includes/config/config.php');
|
|
|
|
$initial_query="";
|
|
$end_query="";
|
|
|
|
if(!empty($_POST['patient_cat_id'])){
|
|
|
|
$initial_query="update patient_category ";
|
|
$end_query="where patient_cat_id='".$_POST['patient_cat_id']."' ";
|
|
}else{
|
|
|
|
$initial_query="insert into patient_category ";
|
|
$end_query="";
|
|
}
|
|
|
|
$final_query=$initial_query." set category_name='".$_POST['patient_cat_name']."',patient_cat_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);
|
|
?>
|