<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Login_model extends CI_Model
{
 
        function __construct()
        {
            parent::__construct();
        }

   /*  This function get all d_users in database sort by order asc.*/
         
        function get_user()
        {
           $u_n=$this->input->post('username');
           
            $pass=base64_encode($this->input->post('upassword'));
           
            $result=$this->db->query("select * from d_users where user_username='$u_n' && user_password='$pass'");           
            return $result->row();

        }  
        
        function verify_user()
        {
            $user_id = $this->session->userdata('uid');
            $q=$this->db->query("SELECT * FROM d_users WHERE user_id='$user_id' and user_state='1'");
            return $q->num_rows();
        }
        
       
} 