-
Notifications
You must be signed in to change notification settings - Fork 7
/
appointment.php
96 lines (78 loc) · 1.79 KB
/
appointment.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
<?php
//dashboard.php
include('class/Appointment.php');
$object = new Appointment;
include('header.php');
?>
<div class="container-fluid">
<?php
include('navbar.php');
?>
<br />
<div class="card">
<span id="message"></span>
<div class="card-header"><h4>My Appointment List</h4></div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped table-bordered" id="appointment_list_table">
<thead>
<tr>
<th>Appointment No.</th>
<th>Doctor Name</th>
<th>Appointment Date</th>
<th>Appointment Time</th>
<th>Appointment Day</th>
<th>Appointment Status</th>
<th>Download</th>
<th>Cancel</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php
include('footer.php');
?>
<script>
$(document).ready(function(){
var dataTable = $('#appointment_list_table').DataTable({
"processing" : true,
"serverSide" : true,
"order" : [],
"ajax" : {
url:"action.php",
type:"POST",
data:{action:'fetch_appointment'}
},
"columnDefs":[
{
"targets":[6, 7],
"orderable":false,
},
],
});
$(document).on('click', '.cancel_appointment', function(){
var appointment_id = $(this).data('id');
if(confirm("Are you sure you want to cancel this appointment?"))
{
$.ajax({
url:"action.php",
method:"POST",
data:{appointment_id:appointment_id, action:'cancel_appointment'},
success:function(data)
{
$('#message').html(data);
dataTable.ajax.reload();
setTimeout(function(){
$('#message').html('');
}, 5000);
}
})
}
});
});
</script>