-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathactive_covid.php
146 lines (130 loc) · 5.58 KB
/
active_covid.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?PHP
if (isset($_GET['reload'])){
$seconds = intval($_GET['reload']);
echo "<meta http-equiv='refresh' content='$seconds'>";
ob_start();
}
$page_description = "Maryland COVID 19 Active Cases";
include_once('menu.php');
if (isset($_GET['reload'])){
$null = ob_get_clean();
}
global $zipcode;
global $global_date;
$zipcode = array();
$q = "select distinct zip_code, town_name from coronavirus_zip where town_name <> ''";
$r = $covid_db->query($q);
while($d = mysqli_fetch_array($r)){
$zip = $d['zip_code'];
$zipcode[$zip] = $d['town_name'];
}
$date = $global_date;
if (isset($_GET['sort'])){
$order = 'active_count';
}else{
$order = 'zip_code';
}
echo "<style> li { font-size:25px; } </style><a href='?sort=count'>Sort by Count</a><table><tr><td valign='top'>";
ob_start();
echo "<h3>Cases are removed after 14 days and 28 days, sorted by $order.</h3><ol>";
$q = "SELECT * FROM coronavirus_zip where active_count > '0' and report_date = '$date' and state_name = 'Maryland' order by $order DESC";
$r = $covid_db->query($q);
$total = 0;
$total2 = 0;
while ($d = mysqli_fetch_array($r)){
$zip_c = $d['zip_code'];
$name = $zipcode[$zip_c];
$total = $total + $d['active_count'];
$total2 = $total2 + $d['active_count_28day'];
$to = '';
if ($d['active_count_28day'] > 0){
$to = "to ".$d['active_count_28day'];
}
echo "<li class='".$d['percentage_direction']."'><a href='zipcode.php?zip=".$d['zip_code']."'>".$d['zip_code']." $name ".$d['active_count']." $to infections. 7 Day Change ".$d['day7change_percentage']."% ".$d['percentage_direction']."</li>";
}
echo "</ol>";
$list = ob_get_clean();
if ($total != 0){
$covid_db->query("insert into covid_active (State, active_count, date_reported) values ( 'Maryland','$total','".date('Y-m-d')."')");
}
if ( empty($_GET['state']) || $_GET['state'] == 'Maryland'){
echo "<h1>".number_format($total)." to ".number_format($total2)." Maryland Active COVID-19 Cases $date</h1><style> .up { background-color: yellow; font-weight:bold; } </style>".$list;
}
echo "</td><td valign='top'>";
ob_start();
echo "<h3>Cases are removed after 14 days and 28 days, sorted by $order.</h3><ol>";
$q = "SELECT * FROM coronavirus_zip where active_count > '0' and report_date = '$date' and state_name = 'Virginia' order by $order DESC";
$r = $covid_db->query($q);
$total = 0;
$total2 = 0;
while ($d = mysqli_fetch_array($r)){
$zip_c = $d['zip_code'];
$name = $zipcode[$zip_c];
$total = $total + $d['active_count'];
$total2 = $total2 + $d['active_count_28day'];
$to = '';
if ($d['active_count_28day'] > 0){
$to = "to ".$d['active_count_28day'];
}
echo "<li class='".$d['percentage_direction']."'><a href='zipcode.php?zip=".$d['zip_code']."'>".$d['zip_code']." $name ".$d['active_count']." $to infections. 7 Day Change ".$d['day7change_percentage']."% ".$d['percentage_direction']."</li>";
}
echo "</ol>";
$list = ob_get_clean();
if ($total != 0){
$covid_db->query("insert into covid_active (State, active_count, date_reported) values ( 'Virginia','$total','".date('Y-m-d')."')");
}
if ( empty($_GET['state']) || $_GET['state'] == 'Virginia'){
echo "<h1>".number_format($total)." to ".number_format($total2)." Virginia Active COVID-19 Cases $date</h1><style> .up { background-color: yellow; font-weight:bold; } </style>".$list;
}
echo "</td><td valign='top'>";
/*
ob_start();
echo "<h3>Cases are removed after 14 days and 28 days, sorted by $order.</h3><ol>";
$q = "SELECT * FROM coronavirus_zip where active_count > '0' and report_date = '$date' and state_name = 'New York' order by $order DESC";
$r = $covid_db->query($q);
$total = 0;
$total2 = 0;
while ($d = mysqli_fetch_array($r)){
$zip_c = $d['zip_code'];
$name = $zipcode[$zip_c];
$total = $total + $d['active_count'];
$total2 = $total2 + $d['active_count_28day'];
$to = '';
if ($d['active_count_28day'] > 0){
$to = "to ".$d['active_count_28day'];
}
echo "<li class='".$d['percentage_direction']."'><a href='zipcode.php?zip=".$d['zip_code']."'>".$d['zip_code']." $name ".$d['active_count']." $to infections. 7 Day Change ".$d['day7change_percentage']."% ".$d['percentage_direction']."</li>";
}
echo "</ol>";
$list = ob_get_clean();
echo "<h1>".number_format($total)." to ".number_format($total2)." New York City Active COVID-19 Cases $date</h1><style> .up { background-color: yellow; font-weight:bold; } </style>".$list;
echo "</td><td valign='top' width='25%'>";
*/
ob_start();
echo "<h3>Cases are removed after 14 days and 28 days, sorted by $order.</h3><ol>";
$q = "SELECT * FROM coronavirus_zip where active_count > '0' and report_date = '$date' and state_name = 'Florida' order by $order DESC";
$r = $covid_db->query($q);
$total = 0;
$total2 = 0;
while ($d = mysqli_fetch_array($r)){
$zip_c = $d['zip_code'];
$name = $zipcode[$zip_c];
$total = $total + $d['active_count'];
$total2 = $total2 + $d['active_count_28day'];
$to = '';
if ($d['active_count_28day'] > 0){
$to = "to ".$d['active_count_28day'];
}
echo "<li class='".$d['percentage_direction']."'><a href='zipcode.php?zip=".$d['zip_code']."'>".$d['zip_code']." $name ".$d['active_count']." $to infections. 7 Day Change ".$d['day7change_percentage']."% ".$d['percentage_direction']."</li>";
}
echo "</ol>";
$list = ob_get_clean();
if ($total != 0){
$covid_db->query("insert into covid_active (State, active_count, date_reported) values ( 'Florida','$total','".date('Y-m-d')."')");
}
if ( empty($_GET['state']) || $_GET['state'] == 'Florida'){
echo "<h1>".number_format($total)." to ".number_format($total2)." Florida Active COVID-19 Cases $date</h1><style> .up { background-color: yellow; font-weight:bold; } </style>".$list;
}
echo "</td>";
echo "</tr></table>";
include_once('footer.php');