<?php class cases_model extends CI_Model{

	private $table_name	= 'casos_eap';			// Casos Eap


	public function set_case($id,$data=null,$mode=null)
	{
		if($mode == 'insert') {
		$this->db->insert($this->table_name, $data);
		return $this->db->insert_id();		
		}
		
		$this->db->where('id_casos_eap', $id);
		return $this->db->update($this->table_name, $data);

	}	

	public function set_case_survey($id,$data=null,$mode=null)
	{
		if($mode == 'insert') {
		$this->db->insert("encuesta_eap", $data);
		return $this->db->insert_id();		
		}
		
		$this->db->where('caso', $id);
		return $this->db->update("encuesta_eap", $data);

	}	
	
	
}


