-
Notifications
You must be signed in to change notification settings - Fork 127
/
Web tracker covid
133 lines (114 loc) · 2.28 KB
/
Web tracker covid
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content=
"width=device-width, initial-scale=1.0">
<title>Covid19 Report</title>
<style type="text/css">
.body{
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
.header {
background-image: url('cool-background.png');
width: 40%;
font-family: 'Niconne';
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2),
0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 20px;
background-size: auto;
}
.middle {
margin-top: 60px;
opacity: 1.0;
border-radius: 20px;
background-color: #f2f2f2;
background-image: url('cool-background3.png');
background-size: auto;
padding: 20px;
}
th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4CAF50;
color: white;
}
td,
th {
border: 1px solid #ddd;
padding: 8px;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
tr:hover {
background-color: #ddd;
}
</style>
</head>
<body>
<center>
<div class="header">
<h1>Covid19 Tracker</h1>
</div>
<div class="middle">
<h2>
Latest Updates of Covid19
about States and Union
Territories of India
</h2>
</div>
<div style="overflow-x:auto;">
<table border="1px ">
<?php
$data=file_get_contents(
'https://api.covid19india.org/data.json');
$coronalive =json_decode($data,true);
// echo $coronalive['statewise'][1]['state'];
$satecount = count($coronalive['statewise']);
?>
<tr>
<th>State</th>
<th>Last Updated Date Time</th>
<th>Confirmed Cases</th>
<th>Active Cases</th>
<th>Recovered Cases</th>
<th>Death Cases</th>
</tr>
<?php
$i = 1;
while($i < 38) {
?>
<tr>
<td>
<?php echo $coronalive['statewise'][$i]['state'] ?>
</td>
<td>
<?php echo $coronalive['statewise'][$i]['lastupdatedtime'] ?>
</td>>
<td>
<?php echo $coronalive['statewise'][$i]['confirmed'] ?>
</td>
<td>
<?php echo $coronalive['statewise'][$i]['active'] ?>
</td>
<td>
<?php echo $coronalive['statewise'][$i]['recovered'] ?>
</td>
<td>
<?php echo $coronalive['statewise'][$i]['deaths'] ?>
</td>
</tr>
<?php $i++;
}
?>
</table>
</div>
</center>
</body>
</html>