<?php
class Hindu_festival_model extends CI_Model 
{
	public function __construct()
	{ 
		parent::__construct();
		$this->hindu_festival   = TBL_HINDU_FESTIVAL; 
	}	
	
	public function hindu_festival_lists()
	{		
	   $select = '*';
	   $this->db->select($select, false);
	   $this->db->where('man.status != 2');
	   $this->db->order_by('man.id','Desc');
	   $getData = $this->db->get($this->hindu_festival.' as man');
	   return $getData->result_array();
	}
	
	public function insert($data) 
	{
		$this->db->insert($this->hindu_festival, $data);
		return $this->db->insert_id();
	} 
	
	public function update($id,$postdata) 
	{
		$this->db->where('id', $id);
		$this->db->update($this->hindu_festival, $postdata);
		return $this->db->affected_rows();
	}	
	
	public function get_hindu_festival_details_by_id($id)
	{
		$this->db->where('id',$id);
		$query = $this->db->get($this->hindu_festival);
		return $query->result_array();
	}	
	
	public function view_hindu_festival_details($hindu_festival_id)
	{
	   $select = '*';
	   $this->db->select($select, false);
	   $this->db->where('man.id', $hindu_festival_id);
	   $getData = $this->db->get($this->hindu_festival.' as man');
	   return $getData->row();
	}
	
	public function delete($id)
	{
		$this->db->where('id', $id);
		$this->db->delete($this->hindu_festival);
		return $this->db->affected_rows();
	}	
}
?>