
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Created by PhpStorm.
 * User: carlosgarcia
 * Date: 01/12/16
 * Time: 17:43
 */

class Login_model extends CI_Model {

    public function __construct(){
        parent::__construct();
        $this->load->database();
    }

    public function login($usuario, $password){
        $query = $this->db->query( "select pass from usuarios where user = '$usuario'" );
        $row = $query->row();
        if($row != null && md5($password) == $row->pass)
            return true;
        return false;
    }

}