-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.php
188 lines (152 loc) · 7.62 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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html>
<html lang="en">
<head>
<?php include 'link/links.php'; ?>
<?php include 'css/style.php'; ?>
</head>
<body>
<section>
<div class="container-fluid bg-light my-3 Pandemic">
<?php
$data = file_get_contents('https://api.covid19india.org/data.json');
$Coronalive = json_decode($data,true);
$statecount = count($Coronalive['statewise']);
$i=0;
?>
<h2 class="text-center">Insights of C<span class="corona_rot"><img src="image/coronalogo.png" width="30"
height="30"></span>VID-19 Live <span class="blink"><img src="image/reddot.png" width="11"
height="11"></span></h2>
<h6 class="text-center">Last updated:<?php echo $Coronalive['statewise'][$i]['lastupdatedtime'] ?></h6>
<p class="text-center">[ <a href="https://github.com/CSSEGISandData/COVID-19" target="_blank">Data
Source</a> ]
<br>
<p class="text-right text-secondary text-uppercase">
<a href="aboutcovid.php" target="_blank">more about corona ≫</a>
</p>
</div>
</section>
<!-- *********** Map *******************-->
<section>
<div class="container-fluid">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {
'packages': ['geochart'],
'mapsApiKey': '***************************'
});
google.charts.setOnLoadCallback(drawRegionsMap);
<?php
$data = file_get_contents('https://api.covid19india.org/data.json');
$Coronalive = json_decode($data,true);
$statewise = $Coronalive['statewise'];
?>
function drawRegionsMap() {
var data = google.visualization.arrayToDataTable([
['State', 'Confirmed', 'Recovered'],
<?php foreach($statewise as $key => $val){
?>['<?php echo $val['state'] ?>', <?php echo $val['confirmed']?>, <?php echo $val['recovered']?>],
<?php } ?>
]);
var options = {
region: 'IN',
displayMode: 'regions',
resolution: 'provinces',
datalessRegionColor: '#ffffff'
};
var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
chart.draw(data, options);
}
</script>
<div id="regions_div"
style="width: 900px; height: 500px; display: block; margin-left: auto; margin-right: auto"></div>
</div>
</section>
<!--*********** case counter ****************-->
<section>
<div class="container">
<div class="d-flex justify-content-around mt-5 mb-5 count_style">
<div>
<div class="wrapper">
<?php
$data = file_get_contents('https://api.covid19india.org/data.json');
$Coronalive = json_decode($data,true);
$statecount = count($Coronalive['statewise']);
$i=0;
?>
<div class="Confirmed">
<h1 class="count"><?php echo number_format($Coronalive['statewise'][$i]['confirmed']);?>
</h1>
<p>Confirmed</p>
</div>
<div class="active">
<h1 class="count"><?php echo number_format($Coronalive['statewise'][$i]['active']);?></h1>
<p>Active Cases*</p>
</div>
<div class="Discharged">
<h1 class="count">
<?php echo number_format($Coronalive['statewise'][$i]['recovered']);?></h1>
<p>Discharged Cases</p>
</div>
<div class="Death">
<h1 class="count">
<?php echo number_format($Coronalive['statewise'][$i]['deaths']);?></h1>
<p>Death Cases</p>
</div>
</div>
<div class="col-lg-12">
<div class="container card">
<span class="card-header" style="font-size:22px; text-align: center; text-transform:uppercase;">
CLOSED Cases
</span>
<div class="card-body">
<?php
$data = file_get_contents('https://api.covid19india.org/data.json');
$Coronalive = json_decode($data,true);
$statecount = count($Coronalive['statewise']);
$i=0;
$recovered = $Coronalive['statewise'][$i]['recovered'];
$deaths = $Coronalive['statewise'][$i]['deaths'];
?>
<div class="card-title" style="color: #9c9b94;">
<?php $format = number_format($recovered+$deaths); echo $format; ?></div>
<div style="font-size:15px; text-align: center;">Cases which had an outcome</div>
<div style="margin-top:20px">
<div class="card-text" style="float:left; text-align:center">
<span class="number-table"
style="color:#28a745"><?php $format = number_format($Coronalive['statewise'][$i]['recovered']); echo $format;?>
</span>
<div style="font-size:13px">Recovered / Discharged</div>
<br>
</div>
<div class="card-text" style="float:right; text-align:center">
<span class="number-table"
style="color:#dc3545"><?php $format = number_format($Coronalive['statewise'][$i]['deaths']); echo $format; ?>
</span>
<div style="font-size:13px;">Death</div>
<br>
</div>
<div class="btnn"><a href="statewise.php" target="_blank" class="btn btn-primary">Show Statewise Cases</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<div>
</div>
<div class="container-fluid bg-light text-center font-weight-bold p-1">
<p><a href="graphs.php" target="_blank">⊾ Statistics Data ⊿</a></p>
</div>
<!-- *********************** Top cursor *********************-->
<div class="arrow-btn">
<a href="#"><span class="fas fa-angle-up"></span></a>
</div>
<!--************************** footer ***********************-->
<footer class="footer">
<div>© 2021 Copyright <a href="#">Nikunj Godhani</a>
</div>
</footer>
</body>
</html>