<?php
class ref_customer_dep_model extends CI_Model
{
 function fetch_employee()
 {
  $this->db->order_by("userId", "ASC");
  $query = $this->db->get("tbl_user");
  return $query->result();
 }

 function findcustomer($userId)
 {
  $this->db->where('ref_id', $userId);
  $this->db->order_by('id', 'ASC');
  $query = $this->db->get('tbl_customer_reg');
  $output = '<option value="">Select Appl....</option>';
  foreach($query->result() as $row)
  {
   $output .= '<option value="'.$row->customerId.'">'.$row->applicant_name.'</option>';
  }
  return $output;
 }

 function fetch_city($state_id)
 {
  $this->db->where('state_id', $state_id);
  $this->db->order_by('city_name', 'ASC');
  $query = $this->db->get('city');
  $output = '<option value="">Select City</option>';
  foreach($query->result() as $row)
  {
   $output .= '<option value="'.$row->city_id.'">'.$row->city_name.'</option>';
  }
  return $output;
 }
}

?>
