Advertisement
Guest User

cl

a guest
Oct 17th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <?
  2. /**
  3. *
  4. */
  5. class login extends CI_Controller
  6. {
  7.  
  8. function __construct(argument)
  9. {
  10. parent::__construct();
  11. $this->load->model('modelLogin');
  12.  
  13. if (isset($this->session->userdata())) {
  14. return redirect(base_url('admin'));
  15. }
  16. }
  17.  
  18. public function index()
  19. {
  20. $submit = $this->input->post('submit');
  21. $user = $this->input->post('username');
  22. $pass = $this->input->post('password');
  23.  
  24. if (isset($submit)) {
  25. $login = $this->modelLogin->login($user,$pass);
  26. if ($login == 200) {
  27. redirect(base_url('admin'))
  28. } else {
  29. echo "gagal";
  30. }
  31. }
  32.  
  33. $data = array(
  34. 'barang' => $barang,
  35. 'view' => array("admin/edit")
  36. );
  37.  
  38. $this->load->view('admin/template', $data);
  39. }
  40. }
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement