30 lines
722 B
PHP
30 lines
722 B
PHP
<?php
|
|
include('includes/config/config.php');
|
|
|
|
$initial_query="";
|
|
$end_query="";
|
|
|
|
if(!empty($medicine_usage_cat_id)){
|
|
|
|
$initial_query="update medicine_usage_cat ";
|
|
$end_query="where medicine_usage_cat_id='".$_POST['medicine_usage_cat_id']."' ";
|
|
}else{
|
|
|
|
$initial_query="insert into medicine_usage_cat";
|
|
$end_query="";
|
|
}
|
|
|
|
$final_query=$initial_query." set medicine_usage_cat_name='".$_POST['medicine_usage_cat_name']."',cat_desc='".$_POST['cat_desc']."',code='".$_POST['code']."',modified_by='".$_SESSION['user_id']."' ".$end_query;
|
|
echo $final_query;
|
|
|
|
if (!$result = @mysqli_query($conn,$final_query)) {
|
|
exit(mysqli_error($conn));
|
|
|
|
}else{
|
|
|
|
$data="success";
|
|
}
|
|
|
|
echo json_encode($data);
|
|
?>
|