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

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

    public function auth($nama, $sandi)
    {
        return $this->db->query("SELECT count(emp_id) as ID
        FROM employee 
        WHERE stsAktif = 1 AND Email='$nama' and 
        strPassword= (select CONCAT('*', UPPER(SHA1(UNHEX(SHA1('$sandi'))))));")->row_array();
    }

    public function cari($nama)
    {
        return $this->db->query("SELECT emp_id,FullName, 
        Email, 
        Level, 
        Division, 
        strKdLoc, 
        strJobPosition, 
        strPassword
        FROM employee 
        WHERE stsAktif = 1 AND Email='$nama';")->row_array();
    }
}
