<?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 Sorteo_model extends MY_Model {

    protected $_table;

    public function __construct() {
        parent::__construct();
        $this->load->database();
        $this->_table = 'evi12gansorteo';
        $this->primary_key = 'NUM_POSICION';
    }

    /**
	* Para editar el campo de una tabla. 
	* 
	* @param type @table Tabla
	* @param type @table_id Id a editar
	* @param type @id Id primaria
	* @param type $data datos
	* @return boolean
	*/
	public function edit($id, $data)
	{
		$this->db->where($this->primary_key, $id);
		if ($this->db->update($this->_table, $data)):
			return true;
		else:
			return false;
		endif;
    }
    
    public function count_all()
	{
		$this->db->from($this->_table);
		return $this->db->count_all_results();
	}

}
