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

	public function search($search,$rows = 0,$limit_from= 0,$sort='cancelfeeid',$order='asc'){		
		$this->db->select('*');
		$this->db->from('cancelfee');
		$this->db->group_start();
		$this->db->like('cancelfeeid',$search);
		$this->db->or_like('cancelfeedetail',$search);
		$this->db->group_end();
		$this->db->order_by('cancelfeeid',$order);
		$this->db->where('status',1);
		if($rows>0){
			$this->db->limit($rows, $limit_from);
		}
		return $this->db->get();
	}
	
	public function GetInfo($cancelfeeid){
		$this->db->from('cancelfee');
		$this->db->where('cancelfeeid',$cancelfeeid);
		$a=$this->db->get();
		if($a->num_rows() === 1){
			return $a->row();		
		}else{
			foreach ($this->db->list_fields('cancelfee') as $field){
				$PersonObj->field= '';
			}
			return $PersonObj;
		}
	}
	public function get_found_rows($search){
		$this->db->select('*');
		$this->db->from('cancelfee');
		$this->db->where('status',1);
		return $this->db->get()->num_rows();
	}
	
	// public function exist($cancelfee_data)
	// {
	// 	$this->db->from('cancelfee');
	// 	$cancelfeedetail = array('cancelfeedetail'=>$cancelfee_data['cancelfeedetail']);
	// 	$this->db->where($cancelfeedetail);
	// 	return $this->db->get()->num_rows();
	// }	
	
	public function SaveCode(&$cancelfee_data,$cancelfeeid= FALSE){
		if(!$this->present($cancelfeeid,'True')||!$cancelfeeid){
			if($this->db->insert('cancelfee',$cancelfee_data)){
				$BankData['cancelfeeid']=$this->db->insert_id();
				return true;
			}
			return False;
		}
		$this->db->where('cancelfeeid',$cancelfeeid);
		return $this->db->update('cancelfee',$cancelfee_data);
	}

	public function present($cancelfeeid){
		$this->db->from('cancelfee');
		$this->db->where('cancelfeeid',$cancelfeeid);
		return $this->db->get()->num_rows();
	}	
	
	public function delete_list($cancelfee_ids){		
		$this->db->where_in('cancelfeeid',$cancelfee_ids);
		return $this->db->update('cancelfee',array('status'=>0));

	}
}
?>