-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
executable file
·114 lines (114 loc) · 5.49 KB
/
index.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
<?php
include 'includes/header.php';
?>
<!-- partial -->
<div class="main-panel">
<div class="content-wrapper">
<div class="page-header">
<h3 class="page-title">
<span class="page-title-icon bg-gradient-danger text-white me-2">
<i class="mdi mdi-home"></i>
</span>
Dashboard
</h3>
<nav aria-label="breadcrumb">
<ul class="breadcrumb">
<li class="breadcrumb-item active" aria-current="page">
<span></span>Overview
<i class="mdi mdi-alert-circle-outline icon-sm text-primary align-middle"></i>
</li>
</ul>
</nav>
</div>
<div class="row">
<div class="col-md-3 stretch-card grid-margin">
<div class="card bg-danger bg-gradient card-img-holder text-white">
<div class="card-body">
<img src="assets/images/dashboard/circle.svg" class="card-img-absolute" alt="circle-image" />
<h4 class="font-weight-normal mb-3">
Total Patients
<i class="mdi mdi-heart mdi-24px float-right"></i>
</h4>
<h2 class="mb-5">0</h2>
<h6 class="card-text">Increased by 60%</h6>
</div>
</div>
</div>
<div class="col-md-3 stretch-card grid-margin">
<div class="card bg-danger bg-gradient card-img-holder text-white">
<div class="card-body">
<img src="assets/images/dashboard/circle.svg" class="card-img-absolute" alt="circle-image" />
<h4 class="font-weight-normal mb-3">
Total Camps
<i class="mdi mdi-heart mdi-24px float-right"></i>
</h4>
<h2 class="mb-5">
<?php
$url = "https://apis.stmorg.in/medical/camps/camps?count=true";
$data = get_api_data($url);
$data = json_decode($data, true);
$data = $data['data'];
echo $data[0]['count'];
?>
</h2>
<h6 class="card-text">Decreased by 10%</h6>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 grid-margin">
<div class="card">
<div class="card-body">
<h4 class="card-title">Recent records</h4>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Record Id</th>
<th>Diagnosis</th>
<th>Prescription</th>
<th>Doctor</th>
<th>Last Visit</th>
</tr>
</thead>
<tbody>
<?php
$url = "https://apis.stmorg.in/medical/records/records";
$data = get_api_data($url);
$data = json_decode($data, true);
$data = $data['data'];
foreach ($data as $row) {
$doctor = $row['doctor'];
$url = "https://apis.stmorg.in/medical/doctors/doctors?did=".$doctor;
$ddata = get_api_data($url);
$ddata = json_decode($ddata, true);
$ddata = $ddata['data'];
$diag = $row['diagnosis'];
$url = "https://apis.stmorg.in/medical/diagnosis/diagnosis?did=".$diag;
$diagdata = get_api_data($url);
$diagdata = json_decode($diagdata, true);
$diagdata = $diagdata['data'];
?>
<tr onclick="window.location.href='recordview?id=<?php echo $row['id']; ?>'">
<td>STMR<?php echo $row['id']; ?></td>
<td><?php echo $diagdata[0]['name'] ?></td>
<td><?php echo $row['prescription']; ?></td>
<td><?php echo $ddata[0]['name'] ?></td>
<td><?php echo $row['last_visit']; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- content-wrapper ends -->
<?php
include 'includes/footer.php';
?>