-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
103 lines (86 loc) · 2.83 KB
/
index.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
//index.php
include('class/Appointment.php');
$object = new Appointment;
if(isset($_SESSION['patient_id']))
{
header('location:dashboard.php');
}
$object->query = "
SELECT * FROM doctor_schedule_table
INNER JOIN doctor_table
ON doctor_table.doctor_id = doctor_schedule_table.doctor_id
WHERE doctor_schedule_table.doctor_schedule_date >= '".date('Y-m-d')."'
AND doctor_schedule_table.doctor_schedule_status = 'Active'
AND doctor_table.doctor_status = 'Active'
ORDER BY doctor_schedule_table.doctor_schedule_date ASC
";
$result = $object->get_result();
include('header_new.php');
?>
<section id="hero" style="background-image: url(img/hospital.jpg); background-size: cover;">
<div class="hero-container" data-aos="fade-up">
<h1>Welcome to Bee Hospital</h1>
<h2>The Best Hospital In Depok City</h2>
<a href="login.php" class="btn-get-started scrollto">Login Here</a>
</div>
</section>
<main id="main">
<section id="about" class="about">
<div class="container bg-light" data-aos="fade-up">
<form method="post" action="result.php">
<div class="card-header bg-light"><h3><b>Doctor Schedule List</b></h3></div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<tr>
<th>Doctor Name</th>
<th>Education</th>
<th>Speciality</th>
<th>Appointment Date</th>
<th>Appointment Day</th>
<th>Available Time</th>
<th>Action</th>
</tr>
<?php
foreach($result as $row)
{
echo '
<tr>
<td>'.$row["doctor_name"].'</td>
<td>'.$row["doctor_degree"].'</td>
<td>'.$row["doctor_expert_in"].'</td>
<td>'.$row["doctor_schedule_date"].'</td>
<td>'.$row["doctor_schedule_day"].'</td>
<td>'.$row["doctor_schedule_start_time"].' - '.$row["doctor_schedule_end_time"].'</td>
<td><button type="button" name="get_appointment" class="btn btn-primary btn-sm get_appointment" data-id="'.$row["doctor_schedule_id"].'">Get Appointment</button></td>
</tr>
';
}
?>
</table>
</div>
</div>
</form>
</div>
</section>
<?php
include('footer_new.php');
?>
<script>
$(document).ready(function(){
$(document).on('click', '.get_appointment', function(){
var action = 'check_login';
var doctor_schedule_id = $(this).data('id');
$.ajax({
url:"action.php",
method:"POST",
data:{action:action, doctor_schedule_id:doctor_schedule_id},
success:function(data)
{
window.location.href=data;
}
})
});
});
</script>