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

class refCustomerDependent extends CI_Controller {
 
 public function __construct()
 {
  parent::__construct();
  $this->load->model('ref_customer_dep_model');
 }

 function index()
 {
  $data['country'] = $this->ref_customer_dep_model->fetch_country();
  $this->load->view('dynamic_dependent', $data);
 }

 function fetch_state()
 {
  if($this->input->post('country_id'))
  {
   echo $this->ref_customer_dep_model->fetch_state($this->input->post('country_id'));
  }
 }

 function fetch_city()
 {
  if($this->input->post('state_id'))
  {
   echo $this->ref_customer_dep_model->fetch_city($this->input->post('state_id'));
  }
 }
  
}