PHP Classes

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

Recommend this page to a friend!
  Info   Example   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 53 All time: 10,641 This week: 455Up
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: 44
All time rank: 3686 in Indonesia Indonesia
Week rank: 195 Up5 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 (5)  
  • data.png
  • data2.png
  • data3.png
  • data4.png
  • form.png
  Files folder image Files (10)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:53
This week:0
All time:10,641
This week:455Up