-
Notifications
You must be signed in to change notification settings - Fork 1
/
stats.php
61 lines (43 loc) · 1.44 KB
/
stats.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
<?php
include "connection.php";
// Group by year
$month = array();
$year = array();
$region = array();
$season = array();
$table_name="disease";
# dengue_cases
if(!isset($disease['Dengue_Cases'])){
$dengue_cases = array();
$query1="select Year, SUM(Dengue_Cases) as sumdeng from ".$table_name." GROUP BY Year;";
//echo $query1;
$deng_cases_by_year = $con->query($query1);
while($row = mysqli_fetch_array($deng_cases_by_year)){
/*echo $row['district']."</br>";*/
$dengue_cases[] = floatval($row['sumdeng']);
$year[] = $row['Year'];
};
//print_r($dengue_cases) ;
}
# flu_cases
$flu_cases = array();
$query2="select Year, SUM(Flu_Cases) as sumflu from ".$table_name." GROUP BY Year;";
$flu_cases_by_year = $con->query($query2);
while($row = mysqli_fetch_array($flu_cases_by_year)){
/*echo $row['district']."</br>";*/
$flu_cases[] = floatval($row['sumflu']);
$year[] = $row['Year'];
};
//print_r($flu_cases) ;
#typhoid_cases
$typhoid_cases = array();
$query3="select Year, SUM(Typhoid) as sumtyphoid from ".$table_name." GROUP BY Year;";
$typhoid_cases_by_year = $con->query($query3);
while($row = mysqli_fetch_array($typhoid_cases_by_year)){
/*echo $row['district']."</br>";*/
$typhoid_cases[] = floatval($row['sumtyphoid']);
$year[] = $row['Year'];
};
//print_r($typhoid_cases) ;
include "yearlydisease.php";
?>