<?php

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

/**
* Description of User
*
* @author Developer
*/
class Log_participante extends MY_Model
{
	
	protected $_table;
	protected $_table_parent;
	protected $_table_parent2;
	protected $_agencia_usuario;
	private $_configuracion;

	
	public function __construct()
	{
		parent::__construct();
		$this->load->database();
		$this->_table         = 'evi14logparticipantes';
		$this->primary_key    = 'ID';
	
		$this->load->model('configuracion/Config');
		//Config del sistema
		$this->_configuracion = $this->Config->get_row();
		
		//Si no esta definida la configuración.
		if (!$this->_configuracion) {
			$data_view['message'] = 'No se ha definido la configuración del sistema. Contacte al administrador.';
			$this->load->view('errors/error_start_sistema', $data_view);
			return false;
		}
    }
    

    public function registrar($operacion, $datos)
    {
        $data = array(
            'TEX_OPERACION' => $operacion,
            'TEX_DATOS' => json_encode($datos),
            'TEX_USUARIO' => $this->session->userdata('COD_USUARIO'),
            'TEX_IPORIG' => $this->input->ip_address(),
    );
    
    $this->db->insert($this->_table , $data);
    }
	
	
}
