Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //General Controller
- include "General_Controller.php";
- $gen_controller = new General_Controller();
- //Model Global
- include "model/General_Model.php";
- $gen_model = new General_Model();
- //Model Ajax
- include "model/ajax.php";
- $gen_ajax = new Ajax();
- $act="";
- if(isset($_GET['do_act'])){
- $act = $_GET['do_act'];
- }
- $id_parameter="";
- if(isset($_GET['id_parameter'])){
- $id_parameter =$_GET['id_parameter'];
- }
- if($act=="" or $act==null) {
- echo "404 Not Found";
- }
- else if($act=="getkabkot"){
- //echo '<option value="">Pilih Kota / Kabupaten </option>';
- echo "<tr>
- <th>ID Kabkot</th>
- <th>Nama Kabkot</th>
- </tr>";
- $where_data = array();
- $where_data['province_id'] = $_POST['id_prov'];
- $data_kabkot = $gen_model->GetWhere('regencies',$where_data);
- while($list = $data_kabkot->FetchRow()){
- foreach($list as $key=>$val){
- $key=strtolower($key);
- $$key=$val;
- }
- echo "<tr>";
- echo "<td>".$id."</td><td>".$name."</td>";
- echo "</tr>";
- }
- }
- else if($act=="getkecamatan"){
- echo '<option value="">Pilih Kecamatan</option>';
- $where_data = array();
- $where_data['regency_id'] = $_POST['id_kabkot'];
- $data_kecamatan = $gen_model->GetWhere('districts',$where_data);
- while($list = $data_kecamatan->FetchRow()){
- foreach($list as $key=>$val){
- $key=strtolower($key);
- $$key=$val;
- } ?>
- <option value="<?php echo $id ?>"><?php echo $name ?></option>
- <?php }
- }
- else if($act=="getkelurahan"){
- echo '<option value="">Pilih Kelurahan</option>';
- $where_data = array();
- $where_data['district_id'] = $_POST['id_kecamatan'];
- $data_kelurahan = $gen_model->GetWhere('villages',$where_data);
- while($list = $data_kelurahan->FetchRow()){
- foreach($list as $key=>$val){
- $key=strtolower($key);
- $$key=$val;
- } ?>
- <option value="<?php echo $id ?>"><?php echo $name ?></option>
- <?php }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement