Advertisement
jamboljack

User_model (Model)

May 19th, 2014
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2.  
  3. class Login_model extends CI_Model {
  4.     function __construct() {
  5.         parent::__construct(); 
  6.     }
  7.    
  8.     // Cek data user
  9.     function check_user_account($email, $password, $level='admin') {
  10.         $this->db->select('*');
  11.         $this->db->from('users');
  12.         $this->db->where('email', $email);
  13.         $this->db->where('password', $password);
  14.         $this->db->where('level', $level);
  15.        
  16.         return $this->db->get();
  17.     }
  18.    
  19.     // Ambil Data per Email
  20.     function get_user($email) {
  21.         $this->db->select('*');
  22.         $this->db->from('users');
  23.         $this->db->where('email', $email);
  24.        
  25.         return $this->db->get();
  26.     }
  27.        
  28. }
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement