-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprofile.php
84 lines (68 loc) · 2.83 KB
/
profile.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
<html>
<head>
<title>Profile</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://unpkg.com/gijgo@1.9.13/js/gijgo.min.js" type="text/javascript"></script>
<link href="https://unpkg.com/gijgo@1.9.13/css/gijgo.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
include("func.php");
$con = mysqli_connect("127.0.0.1", "root", "", "hmsdb");
$sd = $_POST['sd'];
$ed = $_POST['ed'];
$query = "select disease as disease, count(*) as frequency from diseases where date(timestamp) between '$sd' and '$ed' group by disease order by frequency desc";
$run = mysqli_query($con, $query);
if($run == true)
{
?>
<table class="table table-striped table-dark">
<thead>
<tr>
<th scope="col">Disease</th>
<th scope="col">Patients</th>
</tr>
</thead>
<tbody>
<?php
while($data = mysqli_fetch_assoc($run))
{
?>
<tr>
<td><?php echo $data['disease'] ?></td>
<td><?php echo $data['frequency'] ?></td>
</tr>
<?php
}
?>
<!--<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>-->
</tbody>
</table>
<?php
}
else
echo "error";
?>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
</html>