-
Notifications
You must be signed in to change notification settings - Fork 0
/
adminP.php
165 lines (119 loc) · 4.54 KB
/
adminP.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<!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>Dashboard</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">
<div class="box1" style="color: white;background-color:#242e42;margin:20px;">
<?php
$conn = mysqli_connect("localhost", "root", "", "newsletter");
if (!$conn) {
die("Connection failed: ". mysqli_connect_error());
}
$result=mysqli_query($conn,"SELECT count(*) as total from subscribe");
$data=mysqli_fetch_assoc($result);
echo "<h3 align='center'>Subscribers</h3>";
echo "<h1 align='center'>". $data['total']."</h1>";
?>
</div>
<div class="box1" style="color: white;background-color:#242e42;margin:20px;">
<?php
$conn = mysqli_connect("localhost", "root", "", "medicine");
if (!$conn) {
die("Connection failed: ". mysqli_connect_error());
}
$result=mysqli_query($conn,"SELECT count(*) as total from docinfo");
$data=mysqli_fetch_assoc($result);
echo "<h3 align='center'>Doctors</h3>";
echo "<h1 align='center'>". $data['total']."</h1>";
?>
</div>
<div class="box1" style="color: white;background-color:#242e42;margin:20px;">
<?php
$conn = mysqli_connect("localhost", "root", "", "medicine");
if (!$conn) {
die("Connection failed: ". mysqli_connect_error());
}
$result=mysqli_query($conn,"SELECT count(*) as total from medinfo");
$data=mysqli_fetch_assoc($result);
echo "<h3 align='center'>Medicines</h3>";
echo "<h1 align='center'>". $data['total']."</h1>";
?>
</div>
<div class="box1" style="color: white;background-color:#242e42;margin:20px;">
<?php
$conn = mysqli_connect("localhost", "root", "", "modal2");
if (!$conn) {
die("Connection failed: ". mysqli_connect_error());
}
$result=mysqli_query($conn,"SELECT count(*) as total from appointment");
$data=mysqli_fetch_assoc($result);
echo "<h3 align='left'>Appointments</h3>";
echo "<h1 align='center'>". $data['total']."</h1>";
?>
</div>
<?php
$conn = mysqli_connect("localhost", "root", "", "newsletter");
if (!$conn) {
die("Connection failed: ". mysqli_connect_error());
}
$sql = "SELECT email FROM subscribe";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
// echo "email: " . $row["email"]."<br>";
}
} else {
echo "0 results";
}
?>
</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>