ip_addres==$ip) { } else { $data_log="INSERT INTO sekolah_kunjungan (kode,ip_addres,tgl_kunjungan,bulan_kunjungan,tahun_kunjungan) values ('".$kode."','".$ip."','".$tgl_skrg."','".$bln_skrg."','".$thn_skrg."')"; $log = mysql_query($data_log); } $count_tlp = mysql_fetch_object(mysql_query("select count(kontak) as hitung from sekolah_telpon where kode='".$kode."'")); $count_faks = mysql_fetch_object(mysql_query("select count(id_faks_telpon) as hitung from sekolah_faksimile where kode='".$kode."'")); $count_email = mysql_fetch_object(mysql_query("select count(email) as hitung from sekolah_email where kode='".$kode."' and email!=''")); $count_link = mysql_fetch_object(mysql_query("select count(id_link) as hitung from sekolah_link where kode='".$kode."'")); $count_sosial = mysql_fetch_object(mysql_query("select count(id_kontak_social) as hitung from sekolah_social where kode='".$kode."'")); $count_web = mysql_fetch_object(mysql_query("select count(id_web) as hitung from sekolah_web where kode='".$kode."'")); if ($sklh->paket=="Slideshow_Premium" or $sklh->paket=="Statis_Premium" or $sklh->paket=="Flash_Premium") { $data_tlp = mysql_query("select kontak from sekolah_telpon where kode='".$kode."'"); $counter_tlp = 0; $numResults_Tlp = mysql_num_rows($data_tlp); $data_email= mysql_query("select email from sekolah_email where kode='".$kode."'"); $counter_email = 0; $numResults_Email = mysql_num_rows($data_email); $data_web= mysql_query("select web from sekolah_web where kode='".$kode."'"); $counter_web = 0; $numResults_Web = mysql_num_rows($data_web); $data_faks= mysql_query("select * from sekolah_faksimile where kode='".$kode."'"); $counter_faks = 0; $numResults_faks = mysql_num_rows($data_faks); $data_link = mysql_query("select * from sekolah_link where kode='".$kode."'"); $counter_link = 0; $numResults_link = mysql_num_rows($data_link); $data_sosial = mysql_query("select * from sekolah_social where kode='".$kode."' order by jenis asc"); $counter_sosial = 0; $numResults_sosial = mysql_num_rows($data_sosial); $data_lainnya = mysql_query("select * from sekolah_bbmwa where kode='".$kode."' order by jenis asc"); $counter_lainnya = 0; $numResults_lainnya = mysql_num_rows($data_lainnya); $count_galeri = mysql_fetch_object(mysql_query("SELECT count(id_slide) AS hitung FROM sekolah_slideshow WHERE kode='".$kode."'")); $count_video = mysql_fetch_object(mysql_query("SELECT count(id_video) as hitung FROM sekolah_video WHERE kode='".$kode."'")); $count_berita = mysql_fetch_object(mysql_query("SELECT count(id_berita) as hitung FROM sekolah_berita WHERE kode='".$kode."'")); $count_profil = mysql_fetch_object(mysql_query("SELECT count(id_profil) as hitung FROM sekolah_profil WHERE kode='".$kode."'")); $count_biaya = mysql_fetch_object(mysql_query("SELECT count(id_biaya) as hitung FROM sekolah_biaya WHERE kode='".$kode."'")); $count_karir = mysql_fetch_object(mysql_query("SELECT count(id_lowongan) as hitung FROM sekolah_lowongan WHERE kode='".$kode."' and status='YA'")); $count_peta = mysql_fetch_object(mysql_query("SELECT count(id) as hitung FROM sekolah_maps WHERE kode='".$kode."'")); $count_running = mysql_fetch_object(mysql_query("SELECT count(id) as hitung FROM sekolah_running WHERE kode='".$kode."'")); $count_promo = mysql_fetch_object(mysql_query("SELECT count(id_promo) as hitung FROM sekolah_promo WHERE kode='".$kode."'")); ?> { "status": true, "info_sekolah": { "paket": "paket ?>", "status_sekolah": "status_sekolah ?>", "nama_sekolah": "nama_sekolah ?>", "logo": "images/sekolah/logo/logo ?>", "alamat": "alamat ?>", "telpon": hitung=="0") { echo "null"; } else { echo "["; while ($tlp=mysql_fetch_object($data_tlp)) { echo '{"href":"'.$tlp->kontak.'"}'; if (++$counter_tlp == $numResults_Tlp) { echo ""; // last row } else { echo ","; // not last row } } echo "]"; } ?>, "email": hitung=="0") { echo "null"; } else { echo "["; while ($email=mysql_fetch_object($data_email)) { echo '{"href":"'.$email->email.'"}'; if (++$counter_email == $numResults_Email) { echo ""; // last row } else { echo ","; // not last row } } echo "]"; } ?>, "faksimile": hitung=="0") { echo "null"; } else { echo "["; while ($my_faks=mysql_fetch_object($data_faks)) { echo '{"href":"'.$my_faks->kontak.'"}'; if (++$counter_faks == $numResults_faks) { echo ""; // last row } else { echo ","; // not last row } } echo "]"; } ?>, "web": hitung=="0") { echo "null"; } else { echo "["; while ($my_web=mysql_fetch_object($data_web)) { echo '{"href":"'.$my_web->web.'"}'; if (++$counter_web == $numResults_Web) { echo ""; // last row } else { echo ","; // not last row } } echo "]"; } ?>, "link_terkait": hitung=="0") { echo "null"; } else { echo "["; while ($my_link=mysql_fetch_object($data_link)) { echo '{"href":"'.$my_link->link.'"}'; if (++$counter_link == $numResults_link) { echo ""; // last row } else { echo ","; // not last row } } echo "]"; } ?> , "jejaring_sosial": hitung=="0" and $count_tw->hitung=="0" and $count_ig->hitung=="0" and $count_gplus->hitung=="0" and $count_pt->hitung=="0") { echo "null"; } else { ?> { "fb": hitung=="0") { echo "null"; } else { $data_fb = mysql_query("select * from sekolah_social where kode='".$kode."' and jenis='Facebook'"); $counter_fb = 0; $numResults_fb = mysql_num_rows($data_fb); ?> [ link.'"}'; if (++$counter_fb == $numResults_fb) { echo ""; // last row } else { echo ","; // not last row } } ?> ] , "twitter": hitung=="0") { echo "null"; } else { $data_tw = mysql_query("select * from sekolah_social where kode='".$kode."' and jenis='Twitter'"); $counter_tw = 0; $numResults_tw = mysql_num_rows($data_tw); ?> [ link.'"}'; if (++$counter_tw == $numResults_tw) { echo ""; // last row } else { echo ","; // not last row } } ?> ] , "instagram": hitung=="0") { echo "null"; } else { $data_ig = mysql_query("select * from sekolah_social where kode='".$kode."' and jenis='Instagram'"); $counter_ig = 0; $numResults_ig = mysql_num_rows($data_ig); ?> [ link.'"}'; if (++$counter_ig == $numResults_ig) { echo ""; // last row } else { echo ","; // not last row } } ?> ] , "gplus": hitung=="0") { echo "null"; } else { $data_gplus = mysql_query("select * from sekolah_social where kode='".$kode."' and jenis='Gplus'"); $counter_gplus = 0; $numResults_gplus = mysql_num_rows($data_gplus); ?> [ link.'"}'; if (++$counter_gplus == $numResults_gplus) { echo ""; // last row } else { echo ","; // not last row } } ?> ] , "pinterest": hitung=="0") { echo "null"; } else { $data_pt = mysql_query("select * from sekolah_social where kode='".$kode."' and jenis='Pinterest'"); $counter_pt = 0; $numResults_pt = mysql_num_rows($data_pt); ?> [ link.'"}'; if (++$counter_pt == $numResults_pt) { echo ""; // last row } else { echo ","; // not last row } } ?> ] }, "kontak": hitung=="0" and $count_line->hitung=="0" and $count_bbm->hitung=="0" and $count_tele->hitung=="0") { echo "null"; } else { ?> { "whatsapp": hitung=="0") { echo "null"; } else { $data_wa = mysql_query("select * from sekolah_bbmwa where kode='".$kode."' and jenis='Whatsapp'"); $counter_wa = 0; $numResults_wa = mysql_num_rows($data_wa); ?> [ isian.'"}'; if (++$counter_wa == $numResults_wa) { echo ""; // last row } else { echo ","; // not last row } } ?> ] , "line": hitung=="0") { echo "null"; } else { $data_line = mysql_query("select * from sekolah_bbmwa where kode='".$kode."' and jenis='Line'"); $counter_line = 0; $numResults_line = mysql_num_rows($data_line); ?> [ isian.'"}'; if (++$counter_line == $numResults_line) { echo ""; // last row } else { echo ","; // not last row } } ?> ] , "bbm": hitung=="0") { echo "null"; } else { $data_bbm = mysql_query("select * from sekolah_bbmwa where kode='".$kode."' and jenis='BBM'"); $counter_bbm = 0; $numResults_bbm = mysql_num_rows($data_bbm); ?> [ isian.'"}'; if (++$counter_bbm == $numResults_bbm) { echo ""; // last row } else { echo ","; // not last row } } ?> ] , "telegram": hitung=="0") { echo "null"; } else { $data_tele = mysql_query("select * from sekolah_bbmwa where kode='".$kode."' and jenis='Telegram'"); $counter_tele = 0; $numResults_tele = mysql_num_rows($data_tele); ?> [ isian.'"}'; if (++$counter_tele == $numResults_tele) { echo ""; // last row } else { echo ","; // not last row } } ?> ] } , "is_have_profile": hitung=="0") { echo "false"; } else { echo "true"; } ?>, "is_have_biaya": hitung=="0") { echo "false"; } else { echo "true"; } ?>, "is_have_berita": hitung=="0") { echo "false"; } else { echo "true"; } ?>, "is_have_galeri": hitung=="0") { echo "false"; } else { echo "true"; } ?>, "is_have_video": hitung=="0") { echo "false"; } else { echo "true"; } ?>, "is_have_karir": hitung=="0") { echo "false"; } else { echo "true"; } ?>, "is_have_peta": hitung=="0") { echo "false"; } else { echo "true"; } ?>, "is_have_running": hitung=="0") { echo "false"; } else { echo "true"; } ?>, "is_have_promo": hitung=="0") { echo "false"; } else { echo "true"; } ?> } } { "status": true, "info_sekolah": { "paket": "paket ?>", "status_sekolah": "status_sekolah ?>", "nama_sekolah": "nama_sekolah ?>", "logo": "images/sekolah/logo/logo ?>", "alamat": "alamat ?>", "telpon": hitung=="0") { echo "null"; } else { echo "["; while ($tlp=mysql_fetch_object($data_tlp)) { echo '{"href":"'.$tlp->kontak.'"}'; if (++$counter_tlp == $numResults_Tlp) { echo ""; // last row } else { echo ","; // not last row } } echo "]"; } ?>, "email": hitung=="0") { echo "null"; } else { echo "["; while ($email=mysql_fetch_object($data_email)) { echo '{"href":"'.$email->email.'"}'; if (++$counter_email == $numResults_Email) { echo ""; // last row } else { echo ","; // not last row } } echo "]"; } ?>, "web": null, "faksimile": null, "link_terkait": null, "jejaring_sosial": null, "kontak":null, "is_have_profile":false, "is_have_biaya":false, "is_have_berita":false, "is_have_galeri":false, "is_have_video":false, "is_have_karir":false, "is_have_peta":false, "is_have_running":false, "is_have_promo": false } }