50 lines
1.6 KiB
PHP
50 lines
1.6 KiB
PHP
<?php
|
|
include('includes/config/config.php');
|
|
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
|
|
$history_id = $_POST['history_id'];
|
|
//echo $id ;
|
|
$sickness_date_history =$_POST['sickness_date_history'];
|
|
$from_date_history =$_POST['from_date_histroy'];
|
|
$to_date_history =$_POST['to_date_history'];
|
|
$date_absent =$_POST['date_absent_History'];
|
|
$agency = $_POST['agency_History'];
|
|
$date_return = $_POST['date_return_History'];
|
|
$name = $_POST['name_History'];
|
|
$emp_id = $_POST['emp_id_history'];
|
|
$des = $_POST['des_History'];
|
|
$attended_doctor =null;
|
|
if($_SESSION['RoleCode'] =="DOC"){
|
|
$attended_doctor=$_SESSION['logged_user_empid'];
|
|
|
|
}
|
|
|
|
$query_initial ="";
|
|
$query_end=" ";
|
|
|
|
$query=" set sickness_date = STR_TO_DATE('".$_POST['sickness_date_history']."', '%d/%m/%Y'), from_date = STR_TO_DATE('".$_POST['from_date_history']."', '%d/%m/%Y'),
|
|
to_date = STR_TO_DATE('".$_POST['to_date_history']."', '%d/%m/%Y'), date_absent = STR_TO_DATE('".$_POST['date_absent_History']."', '%d/%m/%Y'),
|
|
date_return = STR_TO_DATE('".$_POST['date_return_History']."', '%d/%m/%Y'), agency = '$agency',sickness_name='$name',des='$des' ,ohc_type_id='".$_SESSION['current_ohcttype']."',doctor_last_attended='$attended_doctor', modified_by='" . $_SESSION['user_id'] . "'";
|
|
|
|
|
|
|
|
if(!empty($history_id)){
|
|
$query_initial = " update sickness ";
|
|
$query_end=" where sickness_id ='$history_id'";
|
|
}
|
|
else {
|
|
$query_initial = "insert into sickness ";
|
|
|
|
}
|
|
echo $query =$query_initial." ".$query." ".$query_end;
|
|
|
|
|
|
if (!$result = @mysqli_query($conn,$query)) {
|
|
exit(mysqli_error($conn));
|
|
|
|
|
|
}
|
|
|
|
echo json_encode($history_id);
|
|
?>
|
|
|