PHP Classes

File: update_form.php

Recommend this page to a friend!
  Classes of Usman Didi Khamdani   Indonesian Territory Class   update_form.php   Download  
File: update_form.php
Role: Example script
Content type: text/plain
Description: form example
Class: Indonesian Territory Class
Obtain the name of the territory of Indonesia
Author: By
Last change:
Date: 6 years ago
Size: 687 bytes
 

Contents

Class file image Download
<?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);

?>