diff --git a/admin/admin.php b/admin/admin.php index b1954de..39ac10d 100644 --- a/admin/admin.php +++ b/admin/admin.php @@ -1,5 +1,4 @@ - @@ -9,69 +8,12 @@ session_start(); //require_once '../functions.php'; if (empty($user['admin'])) { - //echo "404 Not Found

Not Found

The requested URL {$_SERVER['SCRIPT_NAME']} was not found on this server.


Apache/2.2.22 (@RELEASE@) Server at Hetzner Datacenter 426
"; header("HTTP/1.0 404 Not Found"); exit; } -?> - - - - - - ᐰdmin - - - - -

Работает через жопу! Я предупредиль!

-query('SELECT * FROM `aligns` WHERE `align` = "?s" LIMIT 1', $user['align'])->fetch_assoc(); -// $registeredUsers = db::c()->query('SELECT COUNT(*) FROM `users` WHERE `block` = 0 AND `admin` = 0'); -// echo "В игре зарегистровано ".$registeredUsers." человек"; -header("Cache-Control: no-cache"); function statsat($nu) { /*in admin.php*/ @@ -82,13 +24,15 @@ function statsat($nu) $money = 0; foreach ($exptable as $k => $v) { - if ($k == $nu) break; + if ($k == $nu) { + break; + } $stats += $v[0]; $master += $v[1]; $vinos += $v[2]; $money += $v[3]; } - return array("stats" => $stats + 12, "master" => $master + 1, "vinos" => $vinos + 3, "money" => $money); + return ["stats" => $stats + 12, "master" => $master + 1, "vinos" => $vinos + 3, "money" => $money]; } function imp($array) @@ -106,8 +50,11 @@ function expa($str) for ($i = 0; $i <= count($array) - 2; $i = $i + 2) { $rarray[$array[$i]] = $array[$i + 1]; } - if (isset($rarray)) return $rarray; - else return []; + if (isset($rarray)) { + return $rarray; + } else { + return []; + } } if ($_POST['ali']) { //Что делает эта штука? @@ -115,15 +62,14 @@ if ($_POST['ali']) { //Что делает эта штука? array_shift($accs); array_shift($accs); array_shift($accs); - db::c()->query('INSERT INTO `aligns` (`align`,`img`,`name`,`accses`) VALUES ("?s","?s","?s","?s") ON DUPLICATE KEY UPDATE `img` = "?s", `name` = "?s", `accses` = "?s"',$_POST['ali'],$_POST['im'],$_POST['txt'],imp($accs),$_POST['im'],$_POST['txt'],imp($accs)); - #mysql_query("INSERT INTO `aligns` (`align`,`img`,`name`,`accses`) values ('{$_POST['ali']}','{$_POST['im']}','{$_POST['txt']}','" . imp($accs) . "') ON DUPLICATE KEY UPDATE `img` = '{$_POST['im']}', `name` = '{$_POST['txt']}', accses = '" . imp($accs) . "';"); + db::c()->query('INSERT INTO `aligns` (`align`,`img`,`name`,`accses`) VALUES ("?s","?s","?s","?s") ON DUPLICATE KEY UPDATE `img` = "?s", `name` = "?s", `accses` = "?s"', $_POST['ali'], $_POST['im'], $_POST['txt'], imp($accs), $_POST['im'], $_POST['txt'], imp($accs)); } if ($_POST['sbr_par']) { $sb_pers = db::c()->query('SELECT `id`, `nextup`, `level` FROM `users` WHERE `login` = "?s" LIMIT 1', $_POST['sbr_par'])->fetch_assoc_array(); undressall($sb_pers['id']); $levelstats = statsat($sb_pers['nextup']); - //TODO Ох боюсь я за этот запрос! + //Ох боюсь я за этот запрос! db::c()->query(' UPDATE `users` SET `stats` = ?i, `sila` = ?i, `lovk` = ?i, `inta` = ?i, `intel` = ?i, `vinos` = ?i, @@ -133,25 +79,33 @@ if ($_POST['sbr_par']) { ($levelstats['stats'] - 9), 3, 3, 3, 0, $levelstats['vinos'], ($levelstats['vinos'] * 6), $levelstats['master'], 0, 0, 0, 0, 0, 0, 0, $sb_pers['id']); echo "Все прошло удачно. Персонаж может перераспределить параметры."; } + +$aligns = db::c()->query('SELECT `img`,`align`,`name` FROM `aligns` ORDER BY `align`'); ?> + + + + + + + ᐰdmin + +
Склонности