$new_date=date('Y-m-d',$id);
$new_date_mal=date('Y-m-d H:i:s',$id);
"SELECT * from tbl_doctor_appointment_office where date='$new_date' and date >'$new_cur' order by id asc ";
$Query_job_move_free_job = mysql_query("SELECT * from tbl_doctor_appointment_office where date='$new_date' and date >='$new_cur' order by id asc ");
$num_rows_mal = mysql_num_rows($Query_job_move_free_job);
if($num_rows_mal>0)
{
$si=0;
while($row_job_move_free_job = mysql_fetch_array($Query_job_move_free_job))
{
?>
$new_id=$row_job_move_free_job['id'];
$from_hour=$row_job_move_free_job['from_hour'];
$from_hour_1 = sprintf("%02d", $from_hour);
$from_min=$row_job_move_free_job['from_min'];
$from_min_1 = sprintf("%02d", $from_min);
$from_sta=$row_job_move_free_job['from_sta'];
$to_hour=$row_job_move_free_job['to_hour'];
$to_hour_1 = sprintf("%02d", $to_hour);
$to_min=$row_job_move_free_job['to_min'];
$to_min_1 = sprintf("%02d", $to_min);
$to_sta=$row_job_move_free_job['to_sta'];
$new_date=$row_job_move_free_job['date'];
$time=strtotime($new_date);
$month=date("F",$time);
$year=date("Y",$time);
$new_date_1=date('D', strtotime($new_date));
$new_date_m=date('M', strtotime($new_date));
$new_date_m_mas=date('d', strtotime($new_date));
$selectedTime = ''.$from_hour_1.':'.$from_min_1.' '.$from_sta.'';
$selectedTime2 = ''.$to_hour_1.':'.$to_min_1.' '.$to_sta.'';
$endTime = strtotime("+10 minutes", strtotime($selectedTime));
/*echo $newtime1=date('h:i a', $selectedTime);
$newtime2=date('h:i a', $selectedTime2);*/
$loginTime = strtotime($selectedTime);
$checkTime = strtotime($selectedTime2);
$diff = $checkTime - $loginTime;
$newdif=round($diff/600);
$new_time_ma=$selectedTime = ''.$from_hour_1.':'.$from_min_1.' '.$from_sta.'';
$new_time_ma_1=strtotime($new_time_ma);
?>
if($si==0)
{
?>
Morning : echo $from_hour_1;?>: echo $from_min_1;?> echo $from_sta;?> to echo $to_hour_1;?>: echo $to_min_1;?> echo $to_sta;?>
}
?>
if($si==1)
{
?>
Evening : echo $from_hour_1;?>: echo $from_min_1;?> echo $from_sta;?> to echo $to_hour_1;?>: echo $to_min_1;?> echo $to_sta;?>
}
?>
for($i=0;$i<=$newdif;$i++)
{
$new_1=date('Y-m-d', strtotime($new_date));
$iy_h= date('h', $new_time_ma_1);
$iy_m= date('i', $new_time_ma_1);
$iy_am= date('a', $new_time_ma_1);
?>
$obj_1 = mysql_query("SELECT id from tbl_appointment_office where appointment_date='$new_1' and hour_date='$iy_h' and min_date='$iy_m' and am_date='$iy_am' and status='1' ");
$num_1 = mysql_num_rows($obj_1);
?>
if($num_1==0)
{
?>
}
?>
if($num_1>0)
{
?>
echo date('h:i a', $new_time_ma_1);?>
}
?>
$new_time_ma_1 = strtotime("+10 minutes", $new_time_ma_1);
}
?>
$si=$si+1;
}
}
else
{
?>
Appointment schedule Not Available
}
?>