-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathgetDay.php
36 lines (35 loc) · 856 Bytes
/
getDay.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<script type="text/javascript"></script>
<body>
<?php
$string = $_POST["date"];
$timestamp = strtotime($string);
$compareday = date("l", $timestamp);
$flag=0;
if($_POST["DID"]==""||$_POST["CID"]=="")
echo "SELECT CID AND DID PROPERLY!!!";
else
{
require_once("DBconnect.php");
$query ="SELECT * FROM doctor_availability WHERE DID = '" . $_POST["DID"] . "' AND CID='".$_POST["CID]."'";
$results = $conn->query($query);
while($rs=$results->fetch_assoc())
{
if($rs["day"]==$compareday)
{
$flag++;
echo "Doctor Available on ".$compareday;
break;
}
}
if($flag==0)
echo "Doctor Unavailable on ".$compareday;
}
?>
</body>
</html>