Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Login extends CI_Controller
- {
- public function __construct()
- {
- parent::__construct();
- $this->load->model("user_model");
- $this->load->library('form_validation');
- // $this->output->enable_profiler(TRUE);
- }
- public function index()
- {
- if ($this->input->post()) {
- if ($this->user_model->doLogin()) {
- if ($this->session->user_logged->role==1) redirect(site_url('admin'));
- else if ($this->session->user_logged->role==2) redirect(site_url('kasir'));
- }
- }
- $this->load->view("admin/login_page.php");
- }
- public function logout()
- {
- $this->session->sess_destroy();
- redirect(site_url('admin/login'));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement