Advertisement
Bedhoel

cso_1

Feb 3rd, 2019
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.98 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. }
  22. else if($act=="keluar") {
  23.     $my_pwd = "123456";
  24.     $pwd    = $_POST['pwd'];
  25.     if($pwd==""){
  26.         echo "Password Kosong";
  27.     }
  28.     else if($pwd!=$my_pwd){
  29.         echo "Password Salah";
  30.     }
  31.     else {
  32.         session_start();
  33.         session_destroy();
  34.         echo "OK";
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement