Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class Db_model extends CI_Model {
- public function getLoginData($usr,$pwd){
- $u = ($usr);
- $p = md5($pwd);
- $cek_login->this->db->get_where('user', array('username' => $u, 'password' => $p));
- if($cek_login->num_rows() > 0){
- $qad = $cek_login->row();
- if($u == $qad->username && $p == $qad->password){
- if($qad->status == 'admin') {
- header('location:'.base_url().'admin');
- } elseif ($qad->status == 'guru') {
- header('location:'.base_url().'guru');
- } else {
- header('location:'.base_url().'user');
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement