<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of adminmodel
 *
 * @author BusyMan
 */
class customerloginmodel extends CI_Model {
    //put your code here
    private $_table = "tbl_customer_reg";
    
    public function __construct() { 
        parent::__construct();
       
        
    }
    public function login_info() {

        $user_check = $this->db->get_where($this->_table, 
                array(
            'user_name' => $this->security->xss_clean($this->input->post('username')),
            'user_password' => $this->security->xss_clean($this->input->post('password'))
                ));

        if ($user_check->num_rows() > 0) { // check 
            $rec = $user_check->row_array();
            
            $id = $rec['id'];    
            $applicant_name = $rec['applicant_name'];
            $customerId = $rec['customerId'];
            $customer_access = $rec['customer_access'];
            $admin_info = array(// user info retrive 
                'id' => $id,
                'applicant_name' => $applicant_name,
                'customerId' => $customerId,
                'customer_access' => $customer_access,
                'login_validation' => TRUE
            );
             return $admin_info;
//        print_r($admin_info); exit;
        } else {
            return FALSE;
        }
       
    }
}