MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //home/cafsindia/allyindian_com/backend/application/models/Analysis_report_model.php
<?php
class Analysis_report_model extends CI_Model{
    public function get_packages(){
		$this->db->from('package');
		return $this->db->get()->result_array();
    }
    public function get_customer_suggestions($term){		
		$this->db->from('customers');	
        $this->db->like('custfname',$term);
        $this->db->or_like('custlname',$term);
        $this->db->or_like('custmobile',$term);
		$suggestions = array();
		foreach($this->db->get()->result() as $row){
			$suggestions[] = array('label' => "$row->custfname $row->custlname-$row->custmobile", 'custid' => $row->custid,'customer_name' => $row->custfname." ".$row->custlname ,'custmobile' => $row->custmobile);
		}
		return $suggestions;
    }
    public function search($package_name,$custid){
        $package_name =implode(",",$package_name);
		$this->db->select('orderid,sblttweb_ticketorder.custid as custid,custfname,custlname,custmobile,custdob,custoccu,custaddress,custcity,custstate,custcountry,custpincode,custphone,custgender,custemail,package_title,package_title2,package_title3,doj,count(passid) as nopass,otripid');
        $this->db->from('ticketorder');
        $this->db->join('passlist', 'passlist.ticketorderid = ticketorder.orderid');
        $this->db->join('package', 'package.package_id =    ticketorder.packid');
        $this->db->join('customers', 'customers.custid =    ticketorder.custid');	   
        //$this->db->where('DATE_FORMAT(sblttweb_ticketorder.doj, "%Y-%m-%d")  BETWEEN '. $this->db->escape($start_date).' AND  '.$this->db->escape($end_date));
        
        if($package_name){
            $this->db->where_in('package.package_id', $package_name);            
        }
        if($custid){
            $this->db->where('ticketorder.custid', $custid);
        }        
        $this->db->group_by('ticketorder.custid'); 
        $this->db->where('sblttweb_ticketorder.pnrno >', 0);
        //$this->db->where('passstatus',0);
        $this->db->where_in('ticketorder.orderstat', array('1','2','4'));
        $result = $this->db->get()->result_array();
	    return $result; 
    }
}
?>