{$txt}\n"; return $mybread; } function getTz($lat, $long) { $geonameurl = "https://www.al-habib.info/islamic-widget/remote_tz_v2.php?mpt_lat={$lat}&mpt_lng={$long}"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$geonameurl); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, 0); $server_output = curl_exec($ch); curl_close ($ch); $jsonout = json_decode($server_output); return $jsonout; } function db_create_list($res) { while ($row = $res->fetchArray()) { if($row['city']) { $myloc = ($row['subdistrict'])?$row['subdistrict']:($row['district']?$row['district']:$row['city']); $myloc = (strpos($row['label'], ',') !== false) ? current(explode(",", $row['label'])) : $row['label']; $mystate = $row['state']?$row['state']:$row['county']; $linktext = ""; if($row['subdistrict']) { if($row['district']) { $linktext .= "{$row['subdistrict']}, {$row['district']}"; } else { $linktext .= "{$row['subdistrict']}, {$row['city']}"; } } elseif($row['district']) { $linktext .= "{$row['district']}, {$row['city']}"; } else { $linktext .= "{$row['city']}"; } $linktext .= ", {$mystate}, {$row['country']}"; //$linktext .= " ({$row['hits']})"; array_push($rows,"{$linktext}"); // array_push($rows,"{$linkt$ } } return $rows; } //open DB //$db = new SQLite3($_SERVER['DOCUMENT_ROOT'].'/arah-kiblat/here.db'); $db = new SQLite3('/home/alhabib2/db/arah-kiblat/here.db'); $db->busyTimeout(3000); // WAL mode has better control over concurrency. // Source: https://www.sqlite.org/wal.html $db->exec('PRAGMA journal_mode = wal;'); //country codes //$isocountry = array_flip(json_decode(file_get_contents("./iso3.json"),true)); //some default values $www0 = "https://".$_SERVER['SERVER_NAME']."/arah-kiblat/"; $www = "https://".$_SERVER['SERVER_NAME']."/arah-kiblat/daftar-peta-arah-kiblat.htm"; $myq = "Suwatu, Tanon"; $mydate = new DateTime(); $mylabelurl = urlencode($myq); //Locale::setDefault('id-ID'); //locale_set_default('id_ID.utf8'); $monthnames = array("Januari","Februari","Maret","April","Mei","Juni", "Juli","Agustus","September","Oktober","November","Desember"); $mypage = ""; //get request queries $display = isset($_REQUEST['disp'])?$_REQUEST['disp']:""; $display = SQLite3::escapeString($display); $hereid = isset($_REQUEST['hid'])?$_REQUEST['hid']:""; $hereid = SQLite3::escapeString($hereid); $qcountry = isset($_REQUEST['country'])?$_REQUEST['country']:""; $qcountry = SQLite3::escapeString($qcountry); $label = "Arah Kiblat"; $elev = ""; if($display=="pop") { $label .= " Populer"; } //if hereid is set if($hereid) { $sql = $db->prepare('SELECT * from places2 WHERE hereid = ? ;'); $sql->bindParam(1, $hereid); $res = $sql->execute(); $row = $res->fetchArray(); if($row['county']||$row['state']) { //update elevation if(! $row['elevation']) { $json2 = getTz($row['lat'], $row['long']); $elev = $json2->elevation; $db->exec("UPDATE places2 SET elevation = {$elev} WHERE hereid = '{$hereid}'"); } else { $elev = $row['elevation']; } //$iso2 = $isocountry["${row['countryid']}"]; $myloc = ($row['subdistrict'])?$row['subdistrict']:($row['district']?$row['district']:$row['city']); $myloc = (strpos($row['label'], ',') !== false) ? current(explode(",", $row['label'])) : $row['label']; $mystate = $row['state']?$row['state']:$row['county']; $mylabel = $row['subdistrict']?$row['subdistrict'].", ".($row['district']?$row['district']:$row['city']):($row['district']?$row['district'].", ".$row['city']:$row['city']); $mylabel .= $row['state']?", ".$row['state'].", ".$row['country']:", ".$row['county'].", ".$row['country']; $mylabelurl = $myloc?urlencode($myloc.", ".$mystate):urlencode($mystate); //$label .= " ${row['label']}"; $mypage = "single"; //$label .= " untuk ${mylabel}"; $label .= " untuk ${row['label']}"; // use returned label //update hits //if not bots if(! is_bot2()) { $db->exec("UPDATE places2 SET hits = hits + 1, lasthit = julianday('now') WHERE hereid = '{$hereid}'"); } //if not bots } else { //if row header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404); echo "Not found."; exit; } //get qibla information if hid found } else { //if hereid if($qcountry) { //Get list of popular cities $sql = $db->prepare('SELECT * FROM places2 WHERE country = ? ORDER BY hits DESC LIMIT 15;'); $sql->bindParam(1, $qcountry); $res = $sql->execute(); $row = $res->fetchArray(); if($row) { $label .= " di $qcountry"; $mypage = "country"; } else { header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404); echo "Not found."; exit; }//if not row } } //if not hereid ?> Daftar Peta <?php echo $label; ?> - Alhabib
 
Petunjuk: gunakan kombinasi nama tempat, kabupatan, propinsi/negara/state.

Peta

Daftar

Dapatkan informasi arah kiblat untuk berbagai tempat di $qcountry":"dunia"; echo $dimana ?>! Mulai dengan memasukkan nama kota pada kolom pencarian di atas. Jika tak ditemukan, kombinasikan dengan nama daerah administrasi yang lebih tinggi, misalnya: "kelurahan nama, kecamatan nama atau kabupaten nama", atau urutan tingkatan administrasi yang sepadan. Informasi arah kiblat akan ditampilkan berupa peta arah kiblat, berapa derajat arah kiblat, dan jam kiblat harian jika arah kiblat dapat ditentukan dengan bantuan arah matahari.

Untuk peta arah kiblat interaktif, kunjungi: Arah Kiblat Interaktif! Jika hape anda memiliki kompas, kunjungi: Kompas Kiblat!

Arah Kiblat Paling Populer

Berikut ini peta arah kiblat paling populer yang telah diunduh di situs Alhabib.

prepare('SELECT * FROM places2 ORDER BY hits DESC LIMIT 30;'); $res = $sql->execute(); $rows = array(); while ($row = $res->fetchArray()) { if($row['city']) { $myloc = ($row['subdistrict'])?$row['subdistrict']:($row['district']?$row['district']:$row['city']); $myloc = (strpos($row['label'], ',') !== false) ? current(explode(",", $row['label'])) : $row['label']; $mystate = $row['state']?$row['state']:$row['county']; // $loghi = intval(log($row['hits'])*10)+1; $loghi = $row['hits']; // $href = "{$www}di/".urlencode($row['country'])."/".urlencode($myloc.", ".$mystate)."/".urlencode($row['hereid'])."/"; $href = "{$www}?country=".urlencode($row['country'])."&label=".urlencode($myloc.", ".$mystate)."&hid=".urlencode($row['hereid']); array_push($clouds,"{text: '{$row['city']}', weight: {$loghi}, link: '{$href}'}"); } } } else { //if pop //Get list of countries //$sql = $db->prepare('SELECT country, hits FROM places2;'); $sql = $db->prepare('SELECT country, count(city) as hits FROM places2 group by country order by hits desc;'); //$sql = $db->prepare('SELECT DISTINCT country FROM places2;'); //$sql = $db->prepare('SELECT DISTINCT country FROM places2 ORDER BY country;'); $res = $sql->execute(); $rows = array(); while ($row = $res->fetchArray()) { if($row['country']) { if(!isset($rows[$row['country']])) { $rows[$row['country']] = $row['hits']; } else { $rows[$row['country']] += $row['hits']; } } } if($rows) { // arsort($rows); $rows2 = array(); foreach ($rows as $co => $hi) { $hi = count_format($hi,",","."); array_push($rows2,"
  • {$co} ({$hi} kota)
  • "); // array_push($rows2,"{$co} ({$hi})"); } echo "

    Peta Arah Kiblat Berbagai Negara

    \n"; echo "
    "; ?>

    Contoh halaman arah kiblat untuk berbagai kota berdasarkan negara bisa dilihat di bawah ini.

    \n"; echo implode("", $rows2); echo ""; echo "\n
    \n"; } //var_dump($rows); ?>

    Peta Arah Kiblat Paling Populer

    prepare('SELECT * FROM places2 WHERE country = ? ORDER BY hits DESC LIMIT 15;'); $sql->bindParam(1, $qcountry); $res = $sql->execute(); $rows = array(); echo "

    Arah kiblat paling dicari di $qcountry

    \n"; echo "
      \n"; while ($row = $res->fetchArray()) { if($row['city']) { $myloc = ($row['subdistrict'])?$row['subdistrict']:($row['district']?$row['district']:$row['city']); $myloc = (strpos($row['label'], ',') !== false) ? current(explode(",", $row['label'])) : $row['label']; $mystate = $row['state']?$row['state']:$row['county']; $linktext = ""; if($row['subdistrict']) { if($row['district']) { $linktext .= "{$row['subdistrict']}, {$row['district']}"; } else { $linktext .= "{$row['subdistrict']}, {$row['city']}"; } } elseif($row['district']) { $linktext .= "{$row['district']}, {$row['city']}"; } else { $linktext .= "{$row['city']}"; } $linktext .= ", {$mystate}, {$row['country']}"; //$linktext .= " ({$row['hits']})"; array_push($rows,"
    1. {$linktext}
    2. "); // array_push($rows,"{$linktext} ({$row['hits']})"); } } echo implode("\n", $rows); echo "\n
    \n"; //Get list of latest cities //$sql = $db->prepare('SELECT * FROM places2 WHERE country = ? ORDER BY lasthit DESC LIMIT 15;'); $sql = $db->prepare('SELECT * FROM places2 WHERE country = ? ORDER BY id DESC LIMIT 5;'); $sql->bindParam(1, $qcountry); $res = $sql->execute(); $rows = array(); echo "

    Arah kiblat terbaru di $qcountry

    \n"; echo "

    \n"; while ($row = $res->fetchArray()) { if($row['city']) { $myloc = ($row['subdistrict'])?$row['subdistrict']:($row['district']?$row['district']:$row['city']); $myloc = (strpos($row['label'], ',') !== false) ? current(explode(",", $row['label'])) : $row['label']; $mystate = $row['state']?$row['state']:$row['county']; $linktext = ""; if($row['subdistrict']) { if($row['district']) { $linktext .= "{$row['subdistrict']}, {$row['district']}"; } else { $linktext .= "{$row['subdistrict']}, {$row['city']}"; } } elseif($row['district']) { $linktext .= "{$row['district']}, {$row['city']}"; } else { $linktext .= "{$row['city']}"; } $linktext .= ", {$mystate}, {$row['country']}"; array_push($rows,"{$linktext}"); // array_push($rows,"{$linktext}"); } } echo implode(" | ", $rows); echo "\n

    \n"; } //if qcountry defined ?> setTimezone(new DateTimeZone($row['tz'])); } //set prayer time calculation $fmt = new IntlDateFormatter( 'id-ID', IntlDateFormatter::FULL, IntlDateFormatter::NONE, $row['tz'], IntlDateFormatter::GREGORIAN ); $fmtHari = new IntlDateFormatter( 'id-ID', IntlDateFormatter::NONE, IntlDateFormatter::NONE, $row['tz'], IntlDateFormatter::GREGORIAN, 'EEEE' ); $fmtAngka = new IntlDateFormatter( 'id-ID', IntlDateFormatter::NONE, IntlDateFormatter::NONE, $row['tz'], IntlDateFormatter::GREGORIAN, 'dd/MM/yyyy' ); date_default_timezone_set('UTC'); require($_SERVER['DOCUMENT_ROOT'] .'/utils/arphp3/Arabic.php'); $ArSalat = new I18N_Arabic('Salat'); $the_lat = $row['lat']; $the_long = $row['long']; $the_tz = $mydate->format('Z')/3600; //from seconds to hours $the_elev = 0; //temporary set as zero $the_month = $mydate->format('m'); $the_date = $mydate->format('d'); $the_year = $mydate->format('Y'); // Salat calculation configuration: Sunni //$ArSalat->setConf($the_fiqh, -0.833333, $conv['mpt_ishaz'], $conv['mpt_fajrz'], 'Sunni'); //$ArSalat->setConf($the_fiqh, -0.833333, -17.0, -18.0, 'Sunni'); // Latitude, Longitude, Zone, and Elevation $ArSalat->setLocation($the_lat, $the_long, $the_tz, $the_elev); //calculate today's shalat times $ArSalat->setDate($the_month, $the_date, $the_year); //$kiblat = round($ArSalat->getQibla()); $kiblatjarak = $ArSalat->getQibla3(); $qibla = $kiblatjarak[0]; //number_format ( float $num , int $decimals = 0 , string|null $decimal_separator = "." , string|null $thousands_separator = "," ) $jarak = round($kiblatjarak[1]/1000,1); $jarak = number_format ($jarak, 1, ",", "."); $kiblat = number_format ($qibla, 1, ",", "."); //$jarak = round($ArSalat->getQiblaDistance()); $peta = "https://".$_SERVER['SERVER_NAME']."/jadwal-shalat/images/peta-{$hereid}.jpg"; //if hereid defined, output location info echo "
    "; ?> U S B T "; echo "
    "; //if(is_integer($elev) ) { $elevinfo = "
  • Ketinggian: {$elev} m.
  • "; } else { $elevinfo = ""; } //{$elevinfo}
  • Zona waktu: {$mydate->format('T')} (UTC {$mydate->format('P')}).
  • echo "
    • Lokasi: {$myloc}, {$row['country']}.
    • Koordinat: (".round($row['lat'], 3).", ".round($row['long'], 3).").
    • {$label}: ".$kiblat."° dari utara.
    • Jarak ke Ka'bah: ".$jarak." km.
    \n"; echo "
    \n"; //daily info //if(!$qyear || !$qmonth) { if(!($qyear || $qmonth)) { ?>

    Arah Kiblat

    Peta di bawah ini menunjukkan peta arah kiblat dari wilayah dalam bentuk gambar statis. Anda bisa memanfaatkan informasi pada peta untuk menentukan arah kiblat berdasarkan fitur atau tanda-tanda alam dan lingkungan atau bangunan dan jalan di sekitar anda.

    setDate($the_month, $the_date, $the_year); $times = $ArSalat->getPrayTime2(); //echo "

    "; //var_dump($times); $mytglangka = $fmtAngka->format($mydate); $mytglfull = str_replace("Minggu","Ahad",$fmt->format($mydate)); $myhari = str_replace("Minggu","Ahad",$fmtHari->format($mydate)); $mytgl = trim(explode(",",str_replace("Minggu","Ahad",$fmt->format($mydate)))[1]); //$mytglonly = trim(explode(" ",$mytgl)[0]); $mytglonly = trim(explode(" ",$mytgl)[0])." ".substr(trim(explode(" ",$mytgl)[1]),0,3); ?>

    Untuk peta arah kiblat interaktif, kunjungi: Arah Kiblat Interaktif! Jika hape anda memiliki kompas, kunjungi: Kompas Kiblat Online!

    Jam Kiblat

    "; $jamkiblatinfo = "Pada jam {$jamkiblat} waktu setempat, matahari di belakang arah kiblat. Dengan kata lain, arah kiblat membelakangi matahari pada jam tersebut."; } else { $bagankiblat = "\"bagan"; $jamkiblatinfo = "Pada jam {$jamkiblat} waktu setempat, matahari berada di arah kiblat. Dengan kata lain, arah kiblat menghadap matahari pada jam tersebut."; } ?>

    Jam kiblat hari ini, , untuk adalah: format('T')}"; ?>.

    Hari ini matahari tidak beredar melalui posisi arah kiblat.

    Tahukah anda, arah kiblat bisa ditentukan dengan mudah dan cukup akurat dengan bantuan posisi matahari? "; echo "Jam kiblat adalah saat di mana kita bisa menggunakan posisi matahari sebagai penunjuk arah kiblat. Pada jam tersebut, matahari tepat berada di arah kiblat atau tepat membelakangi arah kiblat.

    \n"; echo "

    Cari tahu kapan atau di hari apa matahari bisa digunakan untuk menentukan arah kblat, lihat: Saat matahari berada di atas Ka'bah atau Jadwal Shalat dengan Jam Kiblat Harian."; ?>