]> Softwares of Agnibho - simpleipd.git/blob - www/chart.php
Bugfix
[simpleipd.git] / www / chart.php
1 <?php
2 require(dirname(__DIR__)."/require.php");
3
4 if(isSet($_GET["pid"])){
5 $pid=$_GET["pid"];
6 if(!empty($_GET["get"]) && $_GET["get"]=="nursing"){
7 $nursing=[];
8 $nursingArray=$db->getAllData($pid, "nursing");
9 while($item=$nursingArray->fetchArray()){
10 array_push($nursing, json_decode($item["data"]));
11 }
12 echo json_encode($nursing);
13 exit();
14 }
15 if(!empty($_GET["get"]) && $_GET["get"]=="physician"){
16 $physician=[];
17 $physicianArray=$db->getAllData($pid, "physician");
18 while($item=$physicianArray->fetchArray()){
19 array_push($physician, json_decode($item["data"]));
20 }
21 echo json_encode($physician);
22 exit();
23 }
24 if(!empty($_GET["get"]) && $_GET["get"]=="reports"){
25 $reports=[];
26 $reportsArray=$db->getAllData($pid, "reports");
27 while($item=$reportsArray->fetchArray()){
28 array_push($reports, json_decode($item["data"]));
29 }
30 echo json_encode($reports);
31 exit();
32 }
33 if(!empty($_GET["get"]) && $_GET["get"]=="treatment"){
34 $treatment=[];
35 $treatmentArray=$db->getDrugs($pid);
36 while($item=$treatmentArray->fetchArray()){
37 if($item["omit"]==0){
38 array_push($treatment, $item);
39 }
40 }
41 echo json_encode($treatment);
42 exit();
43 }
44 }
45 ?>
46 <!DOCTYPE html>
47 <html>
48 <head>
49 <?php include(CONFIG_LIB."head.php");?>
50 <title>View Info</title>
51 </head>
52 <body>
53 <div class="container">
54 <?php include(CONFIG_LIB."top.php");?>
55 <div class="alert alert-warning"><p>This page contains experimental features. Please double check for the time being.</p></div>
56 <h1>Patient Data</h1>
57 <?php echo getInfo($pid);?>
58 <hr>
59 <div class="alert alert-light d-none" id="ioAlert">Possible inconsistent intake output data. (<span id="ioInconsistency"></span>)</div>
60 <div class="card d-none" id="ioData">
61 <div class="card-body">
62 <h4 class="card-heading">Intake/Output</h4>
63 <ul>
64 <li>Approximate <span class="ioGap"></span> hours intake: <span id="approxIn"></span> ml</li>
65 <li>Approximate <span class="ioGap"></span> hours output: <span id="approxOut"></span> ml</li>
66 </ul>
67 </div>
68 </div>
69 <div class="card">
70 <div class="card-body">
71 <p id="crcl"></p>
72 </div>
73 </div>
74 <hr>
75 <h4>Clinical Parameters</h4>
76 <table class="table">
77 <thead>
78 <tr><th>Date/Time</th><th><select id="clinVar"><option disabled selected>--Select Parameter--</option></select></th></tr>
79 </thead>
80 <tbody id="clinData">
81 </tbody>
82 </table>
83 <canvas id="clinChart"></canvas>
84 <hr>
85 <h4>Reports</h4>
86 <table class="table">
87 <thead>
88 <tr><th>Date/Time</th><th><select id="reportsVar"><option disabled selected>--Select Parameter--</option></select></th></tr>
89 </thead>
90 <tbody id="reportsData">
91 </tbody>
92 </table>
93 <canvas id="reportsChart"></canvas>
94 <hr>
95 <h4>Drugs</h4>
96 <table class="table">
97 <tr><td><select id="drugVar"><option disabled selected>--Select Drug--</option></select></td><td id="drugData1"></td><td id="drugData2"></td></tr>
98 </table>
99 <canvas id="drugsChart"></canvas>
100 <?php include(CONFIG_LIB."foot.php");?>
101 <script>var pid="<?php echo $pid;?>"</script>
102 <script src="res/calc.js"></script>
103 </div>
104 </body>
105 </html>