-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path0.php
More file actions
53 lines (47 loc) · 1.57 KB
/
Copy path0.php
File metadata and controls
53 lines (47 loc) · 1.57 KB
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
<?php
if (!$data = file_get_contents('https://covidnigeria.herokuapp.com/api')) {
header('Location: 404.html');
}else{
$data = file_get_contents('https://covidnigeria.herokuapp.com/api');
$data = json_decode($data, true);
// Nigeria Total Cases Variables...
$NigeriaTotalSamplesTested = $data['data']['totalSamplesTested'];
$NigeriaTotalConfirmedCases = $data['data']['totalConfirmedCases'];
$NigeriaTotalActiveCases = $data['data']['totalActiveCases'];
$NigeriaDischarged = $data['data']['discharged'];
$NigeriaDeath = $data['data']['death'];
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h2>Nigeria ...</h2>
<u>Total Sample tested: </u><b><?php echo $NigeriaTotalSamplesTested; ?></b>
<?php
// this loop will echo all the states cases in Nideria
$sn = 0;
$states = $data['data']['states'];
foreach ($states as $key) {
$sn++;
$statesName = $key['state'];
$statesConfirmedCases = $key['confirmedCases'];
$statesOnAdmission = $key['casesOnAdmission'];
$statesDischarged = $key['discharged'];
$statesDeath = $key['death'];
?>
<p>
<b><?php echo $sn.' -- '; ?></b>
<?php echo '<b>State : </b>' . $statesName; ?>
<?php echo '<b>Cases Confirmed: </b>' . $statesConfirmedCases; ?>
<?php echo '<b>Cases On Admission: </b>' . $statesOnAdmission; ?>
<?php echo '<b>Cases discharged: </b>' . $statesDischarged; ?>
<?php echo '<b>Death: </b>' . $statesDeath; ?>
</p><br>
<?php
}
}
?>
</body>
</html>