<?php
date_default_timezone_set('Asia/Jakarta'); // reference => http://www.php.net/manual/en/timezones.php
$return = array();
$return['status'] = 0;
$return['content'] = "";
if(isset($_POST['update']) && trim($_POST['update'])!='') {
$mst_kode_wilayah = trim($_POST['update']);
include_once("idterritory.php");
$idt = new IDTerritory;
$data = $idt::getData($mst_kode_wilayah,1);
if(count($data)>0) {
$return['status'] = 1;
foreach ($data as $data) {
$nama = $data['nama'];
$kode_wilayah = $data['kode_wilayah'];
$return['content'] .= '<option value="'.$kode_wilayah.'">'.$nama.'</option>';
}
}
}
echo json_encode($return);
?>
|