/**
  * 
  * @param int $id_tipo
  */
 public function setTipo($id_tipo)
 {
     $this->_tipo_emergencia = $this->_emergencia_tipo_model->getById($id_tipo);
     if (is_null($this->_tipo_emergencia)) {
         throw new Exception(__METHOD__ . " - No existe el tipo de emergencia");
     }
 }
 /**
  * 
  * @return string
  */
 protected function _getNombreTipo()
 {
     $estado = $this->_emergencia_tipo_model->getById($this->_emergencia->tip_ia_id);
     if (!is_null($estado)) {
         return $estado->aux_c_nombre;
     } else {
         return "";
     }
 }
 /**
  * Retorna informacion de la emergencia
  */
 public function ajax_emergencia_info()
 {
     $respuesta = array();
     $params = $this->input->post(null, true);
     $emergencia = $this->EmergenciaModel->getById($params["id"]);
     if (!is_null($emergencia)) {
         $nombre_tipo = "";
         $tipo = $this->EmergenciaTipoModel->getById($emergencia->tip_ia_id);
         if (!is_null($tipo)) {
             $nombre_tipo = $tipo->aux_c_nombre;
         }
         $respuesta = array("nombre_emergencia" => $emergencia->eme_c_nombre_emergencia, "nombre_informante" => $emergencia->eme_c_nombre_informante, "tipo" => $nombre_tipo);
     }
     $this->load->view("pages/home/ajax_emergencia_info", $respuesta);
 }
 /**
  * 
  * @param int $id_tipo
  * @throws Exception
  */
 public function setEmergenciaTipo($id_tipo)
 {
     $this->_emergencia_tipo = $this->_emergencia_tipo_model->getById($id_tipo);
 }