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

Last change on this file since 350 was 350, checked in by namnd, 11 years ago
File size: 597 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        protected $id_name = 'admin_id';
8       
9        function __construct()
10        {
11                parent::__construct();
12        }
13       
14        function check_login($login_name, $password)
15        {
16                $hash_password = md5($password);
17                $query = "SELECT * FROM tbladmin WHERE  login_name = ? AND  passwd = ?";
18                $result = $this->db->query($query, array($login_name, $hash_password));
19                if($result->num_rows() == 1){
20                        return $result->row(0);
21                }else
22                {
23                        return null;
24                }
25        }
26}
Note: See TracBrowser for help on using the repository browser.