32 lines
1.3 KiB
PHP
32 lines
1.3 KiB
PHP
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
|
class M_login extends CI_Model{
|
|
function __construct(){
|
|
parent::__construct();
|
|
}
|
|
public function validate(){
|
|
$username = $this->security->xss_clean($this->input->post('username'));
|
|
$password = md5($this->security->xss_clean($this->input->post('password')));
|
|
$this->db->join('master_spesialis', 'master_user.mu_spesialis_id = master_spesialis.ms_id','left');
|
|
$this->db->where('mu_nama_user', $username);
|
|
$this->db->where('mu_password', $password);
|
|
$query = $this->db->get('master_user');
|
|
if($query->num_rows() == 1)
|
|
{
|
|
|
|
$row = $query->row();
|
|
$data = array(
|
|
's_ID_User_rssapintar' => $row->mu_id,
|
|
's_nama_rssapintar' => $row->mu_nama_lengkap,
|
|
's_FK_TipeUser_rssapintar' => $row->mu_tipeuser_id,
|
|
's_ID_Spesialis_rssapintar' => $row->ms_id,
|
|
's_Spesialis_rssapintar' => $row->ms_nama,
|
|
's_petugas_rssapintar' => $row->mu_petugas_penunjang,
|
|
'validated_rssapintar' => true
|
|
);
|
|
$this->session->set_userdata($data);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
?>
|