/ Published in: PHP
The purpose of this code is to grab information from e-solat.gov.my and get payer exact time.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php /* -------------------------------------------- Malaysia Prayer time (e-Solat.gov.my) -------------------- Data source : http://www.e-solat.com.my Author : Fazlee Rezuan [[email protected]] version : 2.1 Description : Sila tukar kod kawasan didalam value 'Kod Kawasan' atau guna parameter seperti 'http://solat.dynamiclabs.my/JHR01'. Pastikan ada file .htaccess di dalam direktori yang sama. .htaccess ======== Start ========== RewriteEngine on RewriteBase / RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.*)$ index.php?kod=$1 [QSA] ========== End ======== ----------------------------------- */ // Kod Kawasan if($_GET['kod'] == ''){ $kod_kawasan = 'SGR01'; } else { $kod_kawasan = $_GET['kod']; } 'JHR01' => 'Pulau Aur dan Pemanggil', 'JHR02' => 'Kota Tinggi, Mersing, Johor Bahru', 'JHR03' => 'Kluang dan Pontian', 'JHR04' => 'Batu Pahat, Muar, Segamat, Gemas', 'KDH01' => 'Kota Setar, Kubang Pasu, Pokok Sena', 'KDH02' => 'Pendang, Kuala Muda, Yan', 'KDH03' => 'Padang Terap, Sik', 'KDH04' => 'Baling', 'KDH05' => 'Kulim, Bandar Bahru', 'KDH06' => 'Langkawi', 'KDH07' => 'Gunung Jerai', 'KTN01' => 'K.Bharu,Bachok,Pasir Puteh,Tumpat,Pasir Mas,Tnh. Merah,Machang,Kuala Krai,Mukim Chiku', 'KTN03' => 'Jeli, Gua Musang (Mukim Galas, Bertam)', 'MLK01' => 'Bandar Melaka, Alor Gajah, Jasin, Masjid Tanah, Merlimau, Nyalas', 'NGS01' => 'Jempol, Tampin', 'NGS02' => 'Port Dickson, Seremban, Kuala Pilah, Jelebu, Rembau', 'PHG01' => 'Pulau Tioman', 'PHG02' => 'Kuantan, Pekan, Rompin, Muadzam Shah', 'PHG03' => 'Maran, Chenor, Temerloh, Bera, Jerantut', 'PHG04' => 'Bentong, Raub, Kuala Lipis', 'PHG05' => 'Genting Sempah, Janda Baik, Bukit Tinggi', 'PHG06' => 'Bukit Fraser, Genting Higlands, Cameron Higlands', 'PLS01' => 'Kangar, Padang Besar, Arau', 'PNG01' => 'Seluruh Negeri Pulau Pinang', 'PRK01' => 'Tapah,Slim River dan Tanjung Malim', 'PRK02' => 'Ipoh, Batu Gajah, Kampar, Sg. Siput dan Kuala Kangsar', 'PRK03' => 'Pengkalan Hulu, Grik dan Lenggong', 'PRK04' => 'Temengor dan Belum', 'PRK05' => 'Teluk Intan, Bagan Datoh, Kg.Gajah,Sri Iskandar, Beruas,Parit,Lumut,Setiawan dan Pulau Pangkor', 'PRK06' => 'Selama, Taiping, Bagan Serai dan Parit Buntar', 'PRK07' => 'Bukit Larut', 'SBH01' => 'Zon 1 - Sandakan, Bdr. Bkt. Garam, Semawang, Temanggong, Tambisan', 'SBH02' => 'Zon 2 - Pinangah, Terusan, Beluran, Kuamut, Telupit', 'SBH03' => 'Zon 3 - Lahad Datu, Kunak, Silabukan, Tungku, Sahabat, Semporna', 'SBH04' => 'Zon 4 - Tawau, Balong, Merotai, Kalabakan', 'SBH05' => 'Zon 5 - Kudat, Kota Marudu, Pitas, Pulau Banggi', 'SBH06' => 'Zon 6 - Gunung Kinabalu', 'SBH07' => 'Zon 7 - Papar, Ranau, Kota Belud, Tuaran, Penampang, Kota Kinabalu', 'SBH08' => 'Zon 8 - Pensiangan, Keningau, Tambunan, Nabawan', 'SBH09' => 'Zon 9 - Sipitang, Membakut, Beaufort, Kuala Penyu, Weston, Tenom, Long Pa Sia', 'SGR01' => 'Gombak,H.Selangor,Rawang, H.Langat,Sepang,Petaling, S.Alam', 'SGR02' => 'Sabak Bernam, Kuala Selangor, Klang, Kuala Langat', 'SGR03' => 'Kuala Lumpur', 'SGR04' => 'Putrajaya', 'SWK01' => 'Zon 1 - Limbang, Sundar, Terusan, Lawas', 'SWK02' => 'Zon 2 - Niah, Belaga, Sibuti, Miri, Bekenu, Marudi', 'SWK03' => 'Zon 3 - Song, Belingan, Sebauh, Bintulu, Tatau, Kapit', 'SWK04' => 'Zon 4 - Igan, Kanowit, Sibu, Dalat, Oya', 'SWK05' => 'Zon 5 - Belawai, Matu, Daro, Sarikei, Julau, Bitangor, Rajang', 'SWK06' => 'Zon 6 - Kabong, Lingga, Sri Aman, Engkelili, Betong, Spaoh, Pusa, Saratok, Roban, Debak', 'SWK07' => 'Zon 7 - Samarahan, Simunjan, Serian, Sebuyau, Meludam', 'SWK08' => 'Zon 8 - Kuching, Bau, Lundu,Sematan', 'SWK09' => 'Zon 9 - Zon Khas', 'TRG01' => 'Kuala Terengganu, Marang', 'TRG02' => 'Besut, Setiu', 'TRG03' => 'Hulu Terengganu', 'TRG04' => 'Kemaman Dungun', 'WLY02' => 'Labuan' ); if(!$area) { $area_title = $area[$kod_kawasan]; } else { $area_title = $area[$_GET['kod']]; } $value = strip_tags(file_get_contents('http://www2.e-solat.gov.my/solat.php?kod='.$kod_kawasan.'&lang=BM')); ); foreach ($waktu_solat as $nama_waktu => $jam_waktu) { } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>Watu Solat <?php echo $area_title; ?></title> <meta name="description" content="<?php echo $solat_time; ?>"> <meta name="author" content="Fazlee Rezuan"> </head> <body> <h3><?php echo $area_title; ?></h3> <?php foreach ($waktu_solat as $nama_waktu => $jam_waktu) { } ?> </body> </html>