Bedhoel

Untitled

Jan 20th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. else if($act=="login") {
  2.     $username = $_REQUEST['username'];
  3.     $pwd      = $_REQUEST['password'];
  4.     $total    = $gen_model->GetOne("count(*) as total ","data_petugas_loket",array('username'=>$username,'password'=>$pwd));
  5.     if(!empty($total)){
  6.         $usr    = $gen_model->GetOneRow("data_petugas_loket",array('username'=>$username,'password'=>$pwd));
  7.         session_start();
  8.         $_SESSION['username']   = $username;
  9.         $_SESSION['loket']      = $usr['loket'];
  10.         $_SESSION['nama_loket'] = $usr['nama_loket'];
  11.         $_SESSION['foto']       = $usr['image'];
  12.         $_SESSION['petugas']    = $usr['petugas'];
  13.         $_SESSION['id_petugas'] = $usr['id_data_petugas_loket'];
  14.         echo "OK";
  15.     }
  16.     else {
  17.         session_start();
  18.         session_destroy();
  19.         echo "NOK";
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment