-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_temperature.php
More file actions
28 lines (24 loc) · 855 Bytes
/
Copy pathget_temperature.php
File metadata and controls
28 lines (24 loc) · 855 Bytes
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
<?php
include_once "database/Sepsis.php";
$patientId = $_GET['patientId'];
$result = Sepsis::getTemperatureById($patientId);
$rows = array();
$table = array();
$table['cols'] = array(
// Labels for your chart, these represent the column titles
// Note that one column is in "string" format and another one is in "number" format as pie chart only required "numbers" for calculating percentage and string will be used for column title
array('label' => 'Time', 'type' => 'number'),
array('label' => 'Temperature', 'type' => 'number'),
);
$rows = array();
foreach($result as $tr) {
$temp = array();
foreach($tr as $key=>$value){
// Values of each slice
$temp[] = array('v' => $value);
}
$rows[] = array('c' => $temp);
}
$table['rows'] = $rows;
$jsonTemperature = json_encode($table);
echo $jsonTemperature;