= 1000) { $num = number_format(($num / 1000), $digits, '.', '') + 0; $num = $num . ' K'; } else { $num = ' < 1 K'; } return $num; } //Pencarian By Nama Sekolah if($nama_sekolah!=null or $nama_sekolah!=""){ $data_sl_jj = mysql_query("SELECT cs.harga,skl.alamat, skl.logo,skl.kode,skl.link,skl.nama_sekolah FROM sekolah as skl left outer join sekolah_cashback as cs on skl.kode=cs.kode and cs.status_aktif='Ya' WHERE skl.tampil='YA' and skl.jenis='Sekolah' and skl.nama_sekolah like '%".$nama_sekolah."%' GROUP BY skl.kode ORDER BY skl.bayar,skl.urut asc "); $num_rows = mysql_num_rows($data_sl_jj); ?> { "status": false, "status": true, "info": "Pencarian : ", "data": { "slide": [ harga=="0" or $sl_jj->harga=="" or $sl_jj->harga==null){ $harga="0"; $warna="0"; } else { $harga=shorten($sl_jj->harga); $warna=$sl_jj->warna; } //Total Dilihat $data_view = mysql_query("select count(id_kunjungan) as hitung from sekolah_kunjungan where kode='".$sl_jj->kode."' and tgl_kunjungan between '".$web->range_awal."' and '".$web->range_akhir."'"); $view = mysql_fetch_object($data_view); ?> { "kode": "kode ?>", "nama": "nama_sekolah ?>", "alamat": "alamat,0,44); ?>", "view": "hitung ?>", "image_url": "images/sekolah/logo/logo ?>", "harga": "", "warna": "" } ] } } nama_prov." > ".$wilayah->nama_kabkot." > ".$wilayah->nama_kec; } else if($provinsi!="" and $kota!="" and $kecamatan==""){ $myquery = "SELECT pv.nama_prov, kb.nama_kabkot FROM all_provinsi AS pv INNER JOIN all_kabkot AS kb ON pv.id_prov = kb.id_prov WHERE pv.id_prov = '".$provinsi."' AND kb.id_kabkot = '".$kota."'"; $wilayah = mysql_fetch_object(mysql_query($myquery)); $keterangan = $wilayah->nama_prov." > ".$wilayah->nama_kabkot; } else if($provinsi!="" and $kota=="" and $kecamatan==""){ $myquery = "SELECT nama_prov FROM all_provinsi WHERE id_prov = '".$provinsi."' "; $wilayah = mysql_fetch_object(mysql_query($myquery)); $keterangan = $wilayah->nama_prov; } $parameter_1 =""; if($id_jenjang!="" and $dayaminat!=""){ $parameter_1 = " and skl.jenjang_id='".$id_jenjang."' and skl.dayaminat like '%".$dayaminat."%' "; } else if($id_jenjang!=""){ $parameter_1 = " and skl.jenjang_id='".$id_jenjang."'"; } else if($kategori!=""){ $parameter_1 = " and skl.kategori like '%".$kategori."%' "; } else{ $parameter_1 = ""; } $parameter_2 =""; if($provinsi!="" and $kota!="" and $kecamatan!=""){ $parameter_2 = " and skl.id_prov='".$provinsi."' and skl.id_kabkot='".$kota."' and skl.id_kec='".$kecamatan."'"; } else if($provinsi!="" and $kota!=""){ $parameter_2 = " and skl.id_prov='".$provinsi."' and skl.id_kabkot='".$kota."'"; } else if($provinsi!=""){ $parameter_2 = " and skl.id_prov='".$provinsi."'"; } else{ $parameter_2 = ""; } $data_sl_jj1 = mysql_query("SELECT cs.harga,skl.alamat, skl.logo,skl.kode,skl.link,skl.nama_sekolah FROM sekolah skl left outer join sekolah_cashback as cs on skl.kode=cs.kode and cs.status_aktif='Ya' WHERE skl.jenis='Sekolah' and skl.tampil='YA' ".$parameter_1." ".$parameter_2." ".$query_sub." GROUP BY skl.kode ORDER BY skl.bayar,skl.urut asc"); $num_rows1 = mysql_num_rows($data_sl_jj1); ?> { "status": false, "status": true, "info": "", "data": { "slide": [ harga=="0" or $sl_jj1->harga=="" or $sl_jj1->harga==null){ $harga="0"; $warna="0"; } else { $harga=shorten($sl_jj1->harga); $warna=$sl_jj->warna; } //Total Dilihat $data_view1 = mysql_query("select count(id_kunjungan) as hitung from sekolah_kunjungan where kode='".$sl_jj1->kode."' and tgl_kunjungan between '".$web->range_awal."' and '".$web->range_akhir."'"); $view1 = mysql_fetch_object($data_view1); ?> { "kode": "kode ?>", "nama": "nama_sekolah ?>", "alamat": "alamat,0,44); ?>", "view": "hitung ?>", "image_url": "images/sekolah/logo/logo ?>", "harga": "", "warna": "" } ] } }