PHP Classes

Indonesian Territory Class: Obtain the name of the territory of Indonesia

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 53 This week: 1All time: 10,590 This week: 560Up
Version License PHP version Categories
idterritoryclass 1.0.0GNU General Publi...5PHP 5, Web services, Geography
Description 

Author

This package is specific mainly for applications used in Indonesia Indonesia .

This class can obtain the name of the territory of Indonesia.

It can send HTTP requests to the Ministry of Education and Culture web site server to query about Indonesia Administrative territories.

The class returns an array with all the retrieved details.

Picture of Usman Didi Khamdani
Name: Usman Didi Khamdani is available for providing paid consulting. Contact Usman Didi Khamdani .
Classes: 9 packages by
Country: Indonesia Indonesia
Age: 43
All time rank: 3686 in Indonesia Indonesia
Week rank: 106 Up3 in Indonesia Indonesia Up
Innovation award
Innovation award
Nominee: 2x

Example

<?php

date_default_timezone_set
('Asia/Jakarta'); // reference => http://www.php.net/manual/en/timezones.php
set_time_limit(0);

echo
'<form><input name="mst_kode_wilayah" value="'; echo isset($_GET['mst_kode_wilayah']) && trim($_GET['mst_kode_wilayah']) != "" ? $_GET['mst_kode_wilayah'] : "000000"; echo '"><input type="submit" value="Tampilkan"></form>';

if(isset(
$_GET['mst_kode_wilayah'])) {
   
$mst_kode_wilayah = $_GET['mst_kode_wilayah'];

    include_once(
"idterritory.php");

   
$idt = new IDTerritory;

   
$data = $idt::getData($mst_kode_wilayah,1);

    echo
"<hr />";

    if(
count($data)>0) {
        foreach (
$data as $data) {
           
$nama = $data['nama'];
           
$kode_wilayah = $data['kode_wilayah'];
           
$mst_kode_wilayah = $data['mst_kode_wilayah'];
           
$id_wilayah = $data['id_wilayah'];

            if(
$id_wilayah==1) {
               
$status = 'Propinsi';
            } elseif(
$id_wilayah==2) {
               
$status = 'Kabupaten/Kota';
            } elseif(
$id_wilayah==3) {
               
$status = 'Kecamatan';
            } else {
               
$status = 'Desa/Kelurahan';
            }

            echo
"<br />Kode Master Wilayah = $mst_kode_wilayah, Kode Wilayah = $kode_wilayah, Nama Wilayah = $nama, Status = $status";
           
// echo "<br />$mst_kode_wilayah;$kode_wilayah;$nama;$id_wilayah";
       
}
    } else {
        echo
"<br />Data wilayah $mst_kode_wilayah tidak ditemukan";
    }
}

?>


Screenshots  
  • data.png
  • data2.png
  • data3.png
  • data4.png
  • form.png
  Files folder image Files  
File Role Description
Accessible without login Plain text file data_wilayah.php Example Obtaining the name of region within a territory
Accessible without login Plain text file data_wilayah_semua.php Example Obtaining the name of region within a territory (complete up to the lowest level)
Accessible without login Plain text file form.php Example form example
Plain text file idterritory.php Class class source
Accessible without login Plain text file update_form.php Example form example

 Version Control Unique User Downloads Download Rankings  
 0%
Total:53
This week:1
All time:10,590
This week:560Up