prepare("select * from vpnuser where vuser='".$username."' and vpass = '".$password."'"); $data->execute(); $row = $data->fetch(PDO::FETCH_ASSOC); if (empty($row)){ echo json_encode([ "status" => 401, "message" => "Email and password are not matched with our record!", ]); return; } else{ $notice_sql = $db->prepare("select * from sv_notice where status = 0 order by id desc"); $notice_sql->execute(); $notice=$notice_sql->fetch(PDO::FETCH_ASSOC); if(isset($notice)) $row['notice'] = $notice; if($force == 0 || $force == "0") { if($row['forcestop'] == 1) { $data = $db->prepare("update vpnuser set forcestop = 0 where id='".$row['id']."'"); $data->execute(); } } else { $row['forcestop'] = 0; } $status = 200; if($row['onlines']==0 || $username == "test" ) { $fh = fopen('notest.txt','a'); fwrite($fh,$username); fclose($fh); $status = 200; } else { if(date("Y-m-d H:i:s", strtotime($row['lastdate'])) < date("Y-m-d H:i:s")) $status = 404; else $status = 200; } echo json_encode([ "status" => $status, "data" => $row ]); } } else { echo json_encode([ "status" => 401, "message" => "Email, password are required!", ]); return; } ?>