Code cleaning.

This commit is contained in:
Igor Barkov (iwork)
2020-06-23 11:49:49 +03:00
parent b4ba7e5af2
commit ad895265e0
4 changed files with 221 additions and 128 deletions
+6 -3
View File
@@ -1,10 +1,13 @@
<?php
session_start();
if (!isset($_SESSION['uid'])) header("Location: index.php");
if (!isset($_SESSION['uid'])) {header("Location: index.php");}
require_once 'config.php';
db::c()->query('UPDATE `users` SET `enter_game` = 0 WHERE `enter_game` = 1 AND `id` = ?i', $_SESSION['uid']);
$userLoginStatus = db::c()->query('SELECT enter_game FROM users WHERE id = ?i',$_SESSION['uid'])->getNumRows() ?? 0;
if (empty($userLoginStatus)) {header("Location: index.php");}
else {db::c()->query('UPDATE `users` SET `enter_game` = 0 WHERE `enter_game` = 1 AND `id` = ?i', $_SESSION['uid']);}
?>
<html>
<!doctype html>
<html lang="ru">
<head>
<title>Окно игры</title>
<meta charset="utf-8">