<?php 
include("common/connection.php");
$_REQUEST['id'];
if(date('H:i:s',strtotime($_REQUEST['fromtime']))>='19:00:00')
	  {
	  $night=1;
	  }
	  else
	  {
	  $night=0;
	  }
	  $numofday=$_REQUEST['countday'];	  
$starttime=$_REQUEST['update_date']." ".$_REQUEST['fromtime'];
$end_date=date('Y-m-d',strtotime($_REQUEST['hour_d']));
	  
$starttime=$_REQUEST['update_date']." ".$_REQUEST['fromtime'];
$update="update roster_master set Duty_Hour_Start_Time ='".date('Y-m-d H:i:s',strtotime($starttime))."',Number_Of_Working_Hour ='".$_REQUEST['totime']."',Patient_Id='".$_REQUEST['edittna']."',To_Time_Date='".$end_date."',To_Time='".date('H:i:s',strtotime($_REQUEST['hour_d']))."',night_shift='".$night."' where TNA_Name='".$_REQUEST['Patients']."' and Treatment_Service_Date='".$_REQUEST['update_date']."'";
$update_query= mysqli_query($con,$update);

if($night==1)
	  {
	  echo 1;
	  }
?>