<?php
defined('BASEPATH') or exit('No direct script access allowed');

class ControllerAlamat extends CI_Controller
{

    public function __construct()
    {
        parent::__construct();
        //validasi jika user belum login
        check_not_login();
        if ($this->session->userdata('level') != 3) {
            redirect();
        }
        $this->set_timezone();
        $this->load->library('encrypt');
        $this->load->library('form_validation');
        $this->load->library('Mycustom');
        $this->load->library('pdfgenerator');
        $this->load->library('Notifikasi');
        $this->load->model('bagian_keuangan/insert_model');
        $this->load->model('bagian_keuangan/select_model');
        $this->load->model('bagian_keuangan/update_model');
        $this->set_timezone();
    }
    public function set_timezone()
    {
        date_default_timezone_set("Asia/Jakarta");
    }
    public function index()
    {
        redirect('arisan');
    }
    public function Kot_kab()
    {
        $nm_kot_kab                  = $this->input->post('nm_kot_kab');
        $data_kecamatan              = $this->select_model->vd_kecamatan($nm_kot_kab);
        foreach ($data_kecamatan as $Data_kecamatan) :
            echo '<option value="' . $Data_kecamatan->nm_kecamatan . '">' . $Data_kecamatan->nm_kecamatan . '</option>';
        endforeach;
    }
    public function kecamatan()
    {
        $nm_kecamatan                = $this->input->post('nm_kecamatan');
        $data_desa                   = $this->select_model->vd_desa($nm_kecamatan);
        foreach ($data_desa as $Data_desa) :
            echo '<option value="' . $Data_desa->nm_desa . '">' . $Data_desa->nm_desa . '</option>';
        endforeach;
    }
}

/* End of file ControllerAlamat.php and path \application\controllers\arisan\ControllerAlamat.php */