40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
||
session_start();
|
||
if (empty($_SESSION['uid'])) {
|
||
header("Location: index.php");
|
||
exit;
|
||
}
|
||
|
||
require_once "config.php";
|
||
$user = new User($_SESSION['uid']);
|
||
|
||
if ($user->room != 650) {
|
||
header("Location: main.php");
|
||
exit;
|
||
}
|
||
|
||
if ($user->battle) {
|
||
header('location: fbattle.php');
|
||
exit;
|
||
}
|
||
|
||
if ($_GET['id'] && $user->admin) {
|
||
echo "Пробуем перейти на выбранную замковую улицу...";
|
||
$_SESSION["klan"] = $_GET['klan'];
|
||
$a = $_GET['klan'];
|
||
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 651, `online`.`room` = 651 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']);
|
||
header("location: city.php");
|
||
exit;
|
||
}
|
||
Template::header('Клановый перекрёсток');
|
||
?>
|
||
<a href="/city.php?strah=1">← назад</a>
|
||
<h1>Переход к клановым улицам</h1>
|
||
На данный момент свои замки имеют такие кланы:
|
||
<?php
|
||
$query = db::c()->query('SELECT `id`,`short`,`align`,`name` FROM `clans` WHERE `zamok` = 2');
|
||
while ($row = $query->fetch_assoc()) {
|
||
$frm = "<img src='i/align_%s.gif'> <img src='i/clan/%s.gif'> %s<br><form><input name='klan' type='hidden' value='%s'><input type='submit' value='Вход'></form>";
|
||
echo sprintf($frm, $row['align'], $row['short'], $row['name'], $row['id']);
|
||
}
|