source: pro-violet-viettel/sourcecode/application/modules/admin/models/admin_model.php @ 349

Last change on this file since 349 was 340, checked in by namnd, 11 years ago
File size: 561 bytes
Line 
1<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
3
4class Admin_model extends MY_Model
5{
6        protected $table_name = 'tbladmin';
7
8        function __construct()
9        {
10                parent::__construct();
11        }
12       
13        function check_login($login_name, $password)
14        {
15                $hash_password = md5($password);
16                $query = "SELECT * FROM tbladmin WHERE  login_name = ? AND  passwd = ?";
17                $result = $this->db->query($query, array($login_name, $hash_password));
18                if($result->num_rows() == 1){
19                        return $result->row(0);
20                }else
21                {
22                        return null;
23                }
24        }
25}
Note: See TracBrowser for help on using the repository browser.