Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>- jadwal sholat -</title>
- </head>
- <body><script>
- // coded by : shutdown57
- // JavCode - ZeroByte.ID
- function sholatGan()
- {
- var mek = document.getElementById('kota').value;
- history.pushState(null,null,'?kota='+mek);
- var xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- document.getElementById("show_me").innerHTML = this.responseText;
- }
- };
- xhttp.open('GET','?kota='+mek,true);
- xhttp.send();
- }
- </script>
- <style type="text/css">html,body{background:#333;color: #0f0;}input{color: #eee;border: 1px solid #0f0;padding: 6px;background: transparent;}.content{width:60%;margin: 0 auto;;padding: 10px}</style>
- <center><h3>Jadwal Sholat</h3> </center>
- <?php
- function getJadwal($kota,$token)
- {
- $c = curl_init();
- $setup = curl_setopt_array($c,array(
- CURLOPT_URL => "http://muslimsalat.com/".$kota.".json?key=".$token,
- CURLOPT_USERAGENT => "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0",
- CURLOPT_RETURNTRANSFER=>true,
- ));
- return curl_exec($c);
- curl_close($c);
- }
- if(!empty($_GET['kota']))
- {
- $result = getJadwal($_GET['kota'],"bd099c5825cbedb9aa934e255a81a5fc");
- /*$result = @file_put_contents('data.temp',$result);*/
- if(!preg_match("/location and try again/",$result))
- {
- /*$djson = json_decode(file_get_contents('data.temp'));
- */
- $djson = json_decode($result);
- echo "<h3> Hasil pencarian dari kota <i>".$djson->query."</i></h3><br>";
- //print_r($djson);
- echo "[+] Daerah : ".$djson->title."<br>";
- echo "[+] Tanggal : ".$djson->items[0]->date_for."<br>";
- echo "===================================================<br>";
- echo "[+] Shubuh : ".$djson->items[0]->fajr."<br>";
- echo "[+] Dhuhur : ".$djson->items[0]->dhuhr."<br>";
- echo "[+] Ashar : ".$djson->items[0]->asr."<br>";
- echo "[+] Maghrib : ".$djson->items[0]->maghrib."<br>";
- echo "[+] Isya' : ".$djson->items[0]->isha."<br>";
- echo "===================================================<br>";
- echo "<img src='".$djson->map_image."'>";
- }
- }else{
- ?><div class="content"><center><input type="text" name="kota" placeholder="Input kota, ex : jepara,semarang etc." value="" style="width: 300px" id="kota"><input type="button" value=">>" onclick="sholatGan();"></center></div><?php
- }
- ?>
- <div id="show_me" class="content"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement