Skip to content

Commit

Permalink
Fixed appointment booking issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kishan0725 authored Aug 3, 2020
1 parent c3bd239 commit 7a183b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions admin-panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@

$appdate=$_POST['appdate'];
$apptime=$_POST['apptime'];

$cur_date = date("Y-m-d");
date_default_timezone_set('Asia/Kolkata');
$cur_time = date("H:i:s");
$apptime1 = strtotime($apptime);
$appdate1 = strtotime($appdate);
if(date("H:i:s",$apptime1)>$cur_time and date("Y-m-d",$appdate1)>$cur_date){

if(date("Y-m-d",$appdate1)>=$cur_date){
if((date("Y-m-d",$appdate1)==$cur_date and date("H:i:s",$apptime1)>$cur_time) or date("Y-m-d",$appdate1)>$cur_date) {
$check_query = mysqli_query($con,"select apptime from appointmenttb where doctor='$doctor' and appdate='$appdate' and apptime='$apptime'");

if(mysqli_num_rows($check_query)==0){
Expand All @@ -54,6 +55,10 @@
else{
echo "<script>alert('We are sorry to inform that the doctor is not available in this time or date. Please choose different time or date!');</script>";
}
}
else{
echo "<script>alert('Select a time or date in the future!');</script>";
}
}
else{
echo "<script>alert('Select a time or date in the future!');</script>";
Expand Down

0 comments on commit 7a183b5

Please sign in to comment.