File: //home/cafsindia/allyindian_com/sbltt/application/models/Customer_data_model.php
<?php
class Customer_data_model extends CI_Model{
public function search($start_date,$end_date,$cust_sts,$referral_type){
$this->db->select("customer_name,phone_number,alt_number,land_line,cust_email,cust_address,city,state_name,dob,referral_type,allow_contract,cust_sts,includ_gst,cust_zone,csut_gst,csut_pan,created_date");
$this->db->from('customers');
$this->db->join("state", "state.state_code = customers.state","left");
$this->db->where('DATE_FORMAT(created_date, "%Y-%m-%d") BETWEEN '. $this->db->escape($start_date).' AND '.$this->db->escape($end_date));
if($cust_sts){
//$cust_sts = implode(",",$cust_sts);
$this->db->where_in('cust_sts', $cust_sts);
}
if($referral_type){
//$referral_type = implode(",",$referral_type);
$this->db->where_in('referral_type', $referral_type);
}
return $this->db->get()->result();
//echo $this->db->last_query();
}
}
?>