Advertisement
Guest User

phpnya

a guest
Apr 10th, 2020
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.22 KB | None | 0 0
  1.  
  2. <!doctype html>
  3. <html lang="en">
  4.   <head>
  5.     <!-- Required meta tags -->
  6.     <meta charset="utf-8">
  7.     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  8.  
  9.     <!-- Bootstrap CSS -->
  10.     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
  11.  
  12.     <title>Corona</title>
  13.   </head>
  14.  
  15.  
  16.  
  17. <body>
  18.  
  19.  
  20.  <audio src="img/ibupertiwi.mp3" autoplay="autoplay"></audio>
  21.  
  22.  
  23.   <div class="pos-f-t">
  24.   <div class="collapse" id="navbarToggleExternalContent">
  25.     <div class="bg-dark p-4">
  26.      
  27. <div id="list-example" class="list-group">
  28.   <a class="list-group-item list-group-item-action" href="contact.html">
  29.   <svg class="bi bi-envelope" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
  30.   <path fill-rule="evenodd" d="M14 3H2a1 1 0 00-1 1v8a1 1 0 001 1h12a1 1 0 001-1V4a1 1 0 00-1-1zM2 2a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2V4a2 2 0 00-2-2H2z" clip-rule="evenodd"/>
  31.   <path fill-rule="evenodd" d="M.071 4.243a.5.5 0 01.686-.172L8 8.417l7.243-4.346a.5.5 0 01.514.858L8 9.583.243 4.93a.5.5 0 01-.172-.686z" clip-rule="evenodd"/>
  32.   <path d="M6.752 8.932l.432-.252-.504-.864-.432.252.504.864zm-6 3.5l6-3.5-.504-.864-6 3.5.504.864zm8.496-3.5l-.432-.252.504-.864.432.252-.504.864zm6 3.5l-6-3.5.504-.864 6 3.5-.504.864z"/>
  33. </svg> contact</a>
  34.   <a class="list-group-item list-group-item-action" href="support.html">
  35.   <svg class="bi bi-award" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
  36.   <path fill-rule="evenodd" d="M9.669.864L8 0 6.331.864l-1.858.282-.842 1.68-1.337 1.32L2.6 6l-.306 1.854 1.337 1.32.842 1.68 1.858.282L8 12l1.669-.864 1.858-.282.842-1.68 1.337-1.32L13.4 6l.306-1.854-1.337-1.32-.842-1.68L9.669.864zm1.196 1.193l-1.51-.229L8 1.126l-1.355.702-1.51.229-.684 1.365-1.086 1.072L3.614 6l-.25 1.506 1.087 1.072.684 1.365 1.51.229L8 10.874l1.356-.702 1.509-.229.684-1.365 1.086-1.072L12.387 6l.248-1.506-1.086-1.072-.684-1.365z" clip-rule="evenodd"/>
  37.   <path d="M4 11.794V16l4-1 4 1v-4.206l-2.018.306L8 13.126 6.018 12.1 4 11.794z"/>
  38. </svg>support</a>
  39. </div>
  40.  
  41.  
  42.  
  43.   <div class="col-9">
  44.     <div class="tab-content" id="v-pills-tabContent">
  45.       <div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab"></div>
  46.       <div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab"></div>
  47.       <div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab">...</div>
  48.       <div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab">...</div>
  49.     </div>
  50.   </div>
  51. </div>
  52.     </div>
  53.   </div>
  54.   <nav class="navbar navbar-dark bg-dark">
  55.     <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation">
  56.       <span class="navbar-toggler-icon"></span>
  57.     </button>
  58.   </nav>
  59. </div>
  60.  
  61.  
  62. <div class="jumbotron jumbotron-fluid bg-info text-white">
  63.   <div class="container text-center" >
  64.     <h1 class="display-4 ">Pantau Covid-19 </h1>
  65.     <p class="lead">"yuk pantau virus covid-19 secara real time di indonesia"</p>
  66.   </div>
  67. </div>
  68.  
  69.  
  70.  
  71. <div class="alert alert-danger alert-dismissible fade show">
  72.     <center>Pengumuman:</center>
  73.     <p><center>Haloo sobat terima kasih atas kunjunganya di website ini mungkin ini adalah beberapa aturam di web ini antara lain :<p></center>
  74.     <p><center>1.Pastikan anda terhubung jaringan internet (online).<br>
  75.                2.Data ini mungkin di ambil 1 hari yang lalu.<br>
  76.                3.Api kami menggunakan https://coronavirus-19-api.herokuapp.com<br>
  77.                4.Jika ingin melihat lebih update silahkan cek di web kementrian kesehatan.</br></center>
  78.              
  79.     <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  80.         <span aria-hidden="true">&times;</span>
  81.     </button>
  82. </div>
  83.  
  84.  
  85.  
  86. <h2><Center>Global dan Indonesia</h2></center>
  87.  
  88.  
  89. <style>
  90. .box {
  91. padding: 30px 40px;
  92. border-radius: 5px;
  93. }
  94.  
  95. .foot {
  96.     background: black;
  97.     height: 50px;
  98.     line-height: 50px;
  99.     display: black;
  100.     margin-top: 150px;
  101.     font-family: cursive;
  102.     }
  103.  
  104. </style>
  105.  
  106. <div class="container">
  107. <div class="row">
  108. <div class="col-md-4">
  109. <div class="bg-danger box text-white">
  110. <div class="row">
  111. <div class="col-md-6">
  112. <h5>Positif</h5>
  113. <h2 id="data-kasus">1234</h2>
  114. <h5>Orang</h5>
  115. </div>
  116. <div class="col-md-4">
  117. <img src="img/sad.svg" style="width: 100px;">
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122.  
  123.  
  124. <div class="col-md-4">
  125. <div class="bg-warning box text-white">
  126. <div class="row">
  127. <div class="col-md-6">
  128. <h5>meninggal</h5>
  129. <h2 id="data-mati">1234</h2>
  130. <h5>Orang</h5>
  131. </div>
  132. <div class="col-md-4">
  133. <img src="img/cry.svg" style="width: 100px;">
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138.  
  139.  
  140. <div class="col-md-4">
  141. <div class="bg-success box text-white">
  142. <div class="row">
  143. <div class="col-md-6">
  144. <h5>sembuh</h5>
  145. <h2 id="data-sembuh">1234</h2>
  146. <h5>Orang</h5>
  147. </div>
  148. <div class="col-md-4">
  149. <img src="img/happy.svg" style="width: 100px;">
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154.  
  155. <div class="col-md-6 mt-3">
  156. <div class="bg-primary box text-white">
  157. <div class="row">
  158. <div class="col-md-6">
  159. <h2>Indonesia</h2>
  160. <h5 id="data-id">positif: 20 orang <br>meninggal: 12 orang <br> sembuh: 122 orang</h5>
  161. </div>
  162. <div class="col-md-4">
  163. <img src="img/indonesia.svg" style="width: 100px;">
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169.  
  170.  
  171. <table class="table table-bordered mt-3">
  172.  
  173. <thead>
  174.   <th>No</th>
  175.   <th>Nama Provinsi</th>
  176.   <th>Positif</th>
  177.   <th>Sembuh</th>
  178.   <th>Meninggal</th>
  179. </thead>
  180.  
  181. <tbody id="table-data">
  182.  
  183.  
  184. </tbody>
  185.  
  186. </table>
  187. </div>
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. <div class="foot">
  196. <center><p>CopyRight-<a href="https://web.facebook.com/steven.rhicard.12" >@Stevan_Richard</a></p></center>
  197. </div>
  198.  
  199.  
  200.     <!-- Optional JavaScript -->
  201.     <!-- jQuery first, then Popper.js, then Bootstrap JS -->
  202.     <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
  203.     <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
  204.     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
  205.     <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
  206.    
  207.   </body>
  208. </html>
  209.  
  210. <script>
  211.   $(document).ready(function(){
  212.  
  213. //panggil semua fungsi data global //
  214.   semuaData();
  215.  
  216.   dataNegara();
  217.  
  218.   dataProvinsi();
  219.  
  220.  
  221. function semuaData(){
  222.   $.ajax({
  223.   url : 'https://coronavirus-19-api.herokuapp.com/all',
  224.   success : function(data){
  225.     try{
  226.     var json = data;
  227.     var kasus = data.cases;
  228.     var meninggal = data.deaths;
  229.     var sembuh = data.recovered;
  230.    
  231.     $('#data-kasus').html(kasus);
  232.     $('#data-mati').html(meninggal);
  233.     $('#data-sembuh').html(sembuh);
  234.    
  235.    
  236.     }catch{
  237.     alert('eror kang sistemna');
  238.     }
  239.   }
  240.   });
  241. }
  242.  
  243.  
  244.  
  245.  
  246.   function dataNegara(){
  247.  
  248.    $.ajax({
  249.   url : 'https://coronavirus-19-api.herokuapp.com/countries',
  250.   success : function(data){
  251.     try{
  252.    
  253.     var json = data;
  254.     var html = [];
  255.    
  256.     if(json.length > 0){
  257.     var i;
  258.     for(i = 0; i < json.length; i++){
  259.     var dataNegara = json[i];
  260.     var namaNegara = dataNegara.country;
  261.    
  262.     if(namaNegara === 'Indonesia'){
  263.     var kasus = dataNegara.cases;
  264.     var mati = dataNegara.deaths;
  265.     var sembuh = dataNegara.recovered;
  266.    
  267.     $('#data-id').html('positif :'+kasus+' orang <br> meninggal :'+mati+' orang <br> sembuh :'+sembuh+' orang <br>')
  268.    
  269.    
  270.    
  271.     }
  272.    
  273.     }
  274.    
  275.     }
  276.    
  277.     }catch{
  278.     alert('eror kang sistemna');
  279.     }
  280.   }
  281.   });
  282.  
  283.  
  284.   }
  285.  
  286.  
  287.      function dataProvinsi(){
  288.  $.ajax({
  289.   url : 'curl.php',
  290.   type : 'GET',
  291.   success : function(data){
  292.     try{
  293.    
  294.    $('#table-data').html(data);
  295.    
  296.     }catch{
  297.     alert('eror kang sistemna');
  298.     }
  299.   }
  300.   });
  301.  
  302.  
  303.  
  304.  
  305.  }
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313. });
  314.  
  315. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement