Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if($act=="login") {
- $username = $_REQUEST['username'];
- $pwd = $_REQUEST['password'];
- $total = $gen_model->GetOne("count(*) as total ","data_petugas_loket",array('username'=>$username,'password'=>$pwd));
- if(!empty($total)){
- $usr = $gen_model->GetOneRow("data_petugas_loket",array('username'=>$username,'password'=>$pwd));
- session_start();
- $_SESSION['username'] = $username;
- $_SESSION['loket'] = $usr['loket'];
- $_SESSION['nama_loket'] = $usr['nama_loket'];
- $_SESSION['foto'] = $usr['image'];
- $_SESSION['petugas'] = $usr['petugas'];
- $_SESSION['id_petugas'] = $usr['id_data_petugas_loket'];
- echo "OK";
- }
- else {
- session_start();
- session_destroy();
- echo "NOK";
- }
- }
- else if($act=="keluar") {
- $my_pwd = "123456";
- $pwd = $_POST['pwd'];
- if($pwd==""){
- echo "Password Kosong";
- }
- else if($pwd!=$my_pwd){
- echo "Password Salah";
- }
- else {
- session_start();
- session_destroy();
- echo "OK";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement