-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappointment.php
148 lines (126 loc) · 4.5 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
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
146
147
148
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styleAP.css">
<!--bootstrap-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="shortcut icon" href="./images/favicon.png" />
<title>Appointments</title>
</head>
<body>
<header class="page-header">
<nav>
<!-- logo -->
<a class="logo-name" href="adminP.php">WEBMED</a>
<ul class="admin-menu">
<li class="menu-heading">
<h3>Admin</h3>
</li>
<li>
<a href="adminDoctor.php">
<span>Doctors</span>
</a>
</li>
<li>
<a href="adminMedicine.php">
<span>Medicines</span>
</a>
</li>
<li>
<a href="appointment.php">
<span>Appointments</span>
</a>
</li>
<li>
<a href="subscriber.php">
<span>Subscribers</span>
</a>
</li>
<li>
<a href="admin.php">
<span>Blogs</span>
</a>
</li>
</ul>
</nav>
</header>
<div class="main-part" style="width: 100%;">
<div class="container-fluid mt-3">
<div class="card shadow mb-2">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Appointments</h6>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th> ID </th>
<th> Email </th>
<th> Contact </th>
<th> Doctor</th>
<th> Date</th>
<th> DELETE </th>
</tr>
</thead>
<tbody>
<?php
$conn = mysqli_connect("localhost", "root", "", "modal2");
if(isset($_POST["delete_btn"]))
{
$email = $_POST['email'];
$query = "DELETE FROM appointment WHERE email='$email' ";
$query_run = mysqli_query($conn, $query);
if($query_run)
{
echo "Deleted!";
}
}
mysqli_close($conn);
?>
<?php
$conn = mysqli_connect("localhost", "root", "", "modal2");
$disp="select * from appointment";
$result=mysqli_query($conn,$disp);
$id=1;
if(mysqli_num_rows($result) > 0)
{
while($row=mysqli_fetch_array($result))
{
?>
<tr>
<td> <?php echo $id++; ?></td>
<td> <?php echo $row['email']; ?></td>
<td> <?php echo $row['contact']; ?></td>
<td> <?php echo $row['doctor']; ?></td>
<td> <?php echo $row['date']; ?></td>
<td>
<form action="" method="post">
<input type="hidden" name="email" value="<?php echo $row['email']; ?>">
<button type="submit" name="delete_btn" class="btn btn-danger" style="background-color: #0f3057 ;color: white;"> DELETE</button>
</form>
</td>
</tr>
<?php
}
}
else {
echo "No Record Found";
}
mysqli_close($conn);
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>