-
Notifications
You must be signed in to change notification settings - Fork 1
/
world-2.php
124 lines (103 loc) · 4.7 KB
/
world-2.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
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if (isset($_GET['country']) && !empty($_GET['country'])) {
curl_setopt($ch, CURLOPT_URL, 'https://covid19.mathdro.id/api/countries/' . urlencode($_GET['country']));
$result = curl_exec($ch);
$data = json_decode($result, true);
}
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<title>CovidIndia</title>
<link href="https://fonts.googleapis.com/css2?family=Muli:wght@300&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Muli', sans-serif;
}
.line {
text-decoration: underline;
}
.search-box {
border: solid #343A40 2px;
}
.corona-update h5 {
text-decoration: underline;
}
@media only screen and (min-width: 480px) {
.scrollLeft {
display: none;
}
}
::-webkit-scrollbar {
display: none;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark d-flex justify-content-center">
<h1 class="navbar-brand line" href="#">COVID-19 LIVE STATS (World)</h1>
<h6 style="color:#fff;">Developed by Aman05382</h6>
</nav>
<section class=" corona-update container-fluid">
<div class="mb-4">
<h2 class="text-center text-uppercase pt-3 pb-0">COVID-19 LIVE STATS-(World)</h2>
</div>
</section>
<br>
<!--SEARCH BOX-->
<div class="text-center">
<!--Search box-->
<form class="form-group" method="get">
<input name="country" class=" text-center mb-3 pl-5 pr-5 pt-2 pb-2 search-box" type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for countries.." title="Search here">
<button type="submit" id="aman" class="btn btn-dark">Search</button>
</form>
</div>
<?php if (!empty($data['confirmed'])) : ?>
<!-- All World Data-->
<div class="mb-4">
<h2 class="text-center text-uppercase pt-3 pb-0">Showing Statistics of <?php echo htmlspecialchars($_GET['country'], ENT_QUOTES); ?></h2>
</div>
<section class="container-fluid">
<div class="row" style="text-align: center">
<div class="col-lg-2 col-md-2 col-12"></div>
<div class="col-lg-2 col-md-2 col-12">
<h5 class="font-weight-bold">Total confirmed</h5>
<h3 class="count pb-2" id="TC"><?php echo number_format($data['confirmed']['value']) ?></h3>
</div>
<div class="col-lg-2 col-md-2 col-12">
<h5 class="font-weight-bold">Total recovered</h5>
<h3 class="count pb-2" id="TR"><?php echo number_format($data['recovered']['value']) ?></h3>
</div>
<div class="col-lg-2 col-md-2 col-12">
<h5 class="font-weight-bold">Total deaths</h5>
<h3 class="count pb-2" id="TD"><?php echo number_format($data['deaths']['value']) ?></h3>
</div>
<div class="col-lg-2 col-md-2 col-12">
<h5 class="font-weight-bold">Last update</h5>
<h3 class="count pb-2" id="LU"><?php echo $data['lastUpdate'] ?></h3>
</div>
</div>
</section>
<?php endif; ?>
<hr>
<div class="text-xs-center text-lg-center">
<img src='https://covid19.mathdro.id/api/og' height="500px" width="auto" />
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</body>
</html>