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/Boarding_model.php
<?php
class Boarding_model extends CI_Model
{

	public function search($search,$rows = 0,$limit_from= 0,$sort='boarding_id',$order='asc')
	{
		$this->db->select('*');
		$this->db->from('boarding');
		$this->db->join('boarding_point', 'boarding_point.board_point_id = boarding.board_point_id');
		$this->db->join('vehicle', 'vehicle.vehicle_id = boarding.vehicle_trip_id');
		$this->db->join('veh_type', 'veh_type.veh_type_id = vehicle.vehicle_type');
		$this->db->group_start();
		$this->db->like('boarding_id',$search);
		$this->db->or_like('boarding_name',$search);
		$this->db->or_like('vehicle_no',$search);
		$this->db->or_like('veh_type',$search);
		$this->db->group_end();
		$this->db->order_by('boarding_id',$order);
		if($rows>0){
			$this->db->limit($rows, $limit_from);
		}
		return $this->db->get();
	}
	
	public function GetInfo($boarding_id)	
	{
		$this->db->from('boarding');
		$this->db->where('boarding_id',$boarding_id);
		$a=$this->db->get();
		if($a->num_rows() === 1)
		{
			return $a->row();
		
		}
		else
		{
			foreach ($this->db->list_fields('boarding') as $field)
			{
				$PersonObj->field= '';
			}
			return $PersonObj;
		}
	}
	public function get_found_rows($search)
	{
		$this->db->select('*');
		$this->db->from('boarding');
		$this->db->where('status',1);
		return $this->db->get()->num_rows();
	}
	
	public function SaveCode(&$board_point_data,$boarding_id= FALSE)
	{
		if(!$this->present($boarding_id,'True')||!$boarding_id){
			if($this->db->insert('boarding',$board_point_data))
			{
				$BankData['boarding_id']=$this->db->insert_id();
				return true;
			}
			return False;
		}
		$board_point_data['updated_by']   = $this->session->userdata('emp_id');
		$board_point_data['updated_date'] = date('Y-m-d h:i:s');

		$this->db->where('boarding_id',$boarding_id);
		return $this->db->update('boarding',$board_point_data);
	}
	public function get_boarding(){
		$this->db->from('boarding_point');
		$this->db->order_by('boarding_name', 'asc');
		$this->db->where('status',1);
		return $this->db->get()->result_array();
	}
	public function get_vehicle(){
		$this->db->from('vehicle');
		$this->db->order_by('vehicle_no', 'asc');
		$this->db->where('status',1);
		return $this->db->get()->result_array();
	}
	public function present($boarding_id)
	{
		$this->db->from('boarding');
		$this->db->where('boarding_id',$boarding_id);
		return $this->db->get()->num_rows();
	}	
	
	public function delete_list($boarding_ids)
	{		
		$this->db->where_in('boarding_id',$boarding_ids);
		return $this->db->update('boarding',array('status'=>0,'deleted_by' => $this->session->userdata('emp_id'),'deleted_date' => date('Y-m-d h:i:s')));
	}
}
?>