-
Notifications
You must be signed in to change notification settings - Fork 0
/
appointments.php
145 lines (118 loc) · 4.12 KB
/
appointments.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
ob_start();
session_start();
include("conn.php");
if(!isset($_SESSION['doctorLogin'])){
$_SESSION['loginMsg'] = 'You must log in frist!';
header("Location:doctorlogin.php");
}else{
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Doccure</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
<!-- Favicons -->
<link href="assets/img/favicon.png" rel="icon">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<!-- Fontawesome CSS -->
<link rel="stylesheet" href="assets/plugins/fontawesome/css/fontawesome.min.css">
<link rel="stylesheet" href="assets/plugins/fontawesome/css/all.min.css">
<!-- Main CSS -->
<link rel="stylesheet" href="assets/css/style.css">
</head>
<body>
<!-- Main Wrapper -->
<div class="main-wrapper">
<!-- Header -->
<?php include("header.php") ?>
<!-- /Header -->
<!-- Breadcrumb -->
<div class="breadcrumb-bar">
<div class="container-fluid">
<div class="row align-items-center">
<div class="col-md-12 col-12">
<nav aria-label="breadcrumb" class="page-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Appointments</li>
</ol>
</nav>
<h2 class="breadcrumb-title">Appointments</h2>
</div>
</div>
</div>
</div>
<!-- /Breadcrumb -->
<!-- Page Content -->
<div class="content">
<div class="container-fluid">
<div class="row">
<!-- Profile Sidebar -->
<?php include("doctorSlideBar.php") ?>
<!-- /Profile Sidebar -->
<div class="col-md-7 col-lg-8 col-xl-9">
<h2 class="text-center my-3">Accepted Appoinments</h2>
<div class="appointments">
<?php
// Function that convert time from 24H to 12H format
function convertTime($time){
if($time > "11:59" && $time < "24:00"){
echo date("h:i", strtotime($time))." PM";
}else{
echo date("h:i", strtotime($time))." AM";
}
}
$docID=$_SESSION['id'];
$selectApp="SELECT * FROM `appointments` where doctorID=$docID AND status='Confirm' ORDER BY id DESC" ;
$selectAppRes=$conn->query($selectApp);
foreach($selectAppRes as $i){
$patientID=$i['patientID'];
$selectPatient=" SELECT * FROM `patients` where id=$patientID" ;
$selectPatientRes=$conn->query($selectPatient);
foreach($selectPatientRes as $j){
?>
<!-- Appointment List -->
<div class="appointment-list">
<div class="profile-info-widget">
<a href="appointments.php" class="booking-doc-img">
<img src="<?= $j['image'] ?>" alt="User Image">
</a>
<div class="profile-det-info">
<h3><a href="appointments.php"><?= $j['fName'] . " ". $j['lName'] ?></a></h3>
<div class="patient-details">
<h5><i class="far fa-clock"></i> <?=convertTime($i['time']) . ", ".$i['date'] ?> </h5>
<h5><i class="fas fa-map-marker-alt"></i> <?= $j['state'].", ". $j['country'] ?></h5>
<h5><i class="fas fa-envelope"></i> <?= $j['email'] ?></h5>
<h5 class="mb-0"><i class="fas fa-phone"></i> <?= $j['phone'] ?></h5>
</div>
</div>
</div>
</div>
<!-- /Appointment List -->
<?php } } ?>
</div>
</div>
</div>
</div>
</div>
<!-- /Page Content -->
</div>
<!-- /Main Wrapper -->
<!-- jQuery -->
<script src="assets/js/jquery.min.js"></script>
<!-- Bootstrap Core JS -->
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<!-- Sticky Sidebar JS -->
<script src="assets/plugins/theia-sticky-sidebar/ResizeSensor.js"></script>
<script src="assets/plugins/theia-sticky-sidebar/theia-sticky-sidebar.js"></script>
<!-- Custom JS -->
<script src="assets/js/script.js"></script>
</body>
</html>
<?php }
ob_end_flush();
?>