-
Notifications
You must be signed in to change notification settings - Fork 92
/
getDay.php
36 lines (35 loc) · 885 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">//alert("sdfsd");</script>
<body>
<?php
$string = $_POST["date"];
$timestamp = strtotime($string);
$compareday = date("l", $timestamp);
$flag=0;
if($_POST["didval"]==""||$_POST["cidval"]=="")
echo "SELECT CID AND DID PROPERLY!!!";
else
{
require_once("dbconfig.php");
$query ="SELECT * FROM doctor_availability WHERE DID = '" . $_POST["didval"] . "' AND CID='".$_POST["cidval"]."'";
$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>