battles/ul_clans.php

26 lines
1.1 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use Battles\Database\Db;
use Battles\Template;
use Battles\User;
require_once "config.php";
if (!empty($_GET['id']) && User::getInstance()->getAdmin()) {
echo "Пробуем перейти на выбранную замковую улицу...";
$_SESSION["klan"] = $_GET['klan'];
$a = $_GET['klan'];
Db::getInstance()->execute('update users, online set users.room = 651, online.room = 651 where user_id = id and user_id = ?', User::getInstance()->getId());
header("location: city.php");
exit;
}
Template::header('Клановый перекрёсток');
?>
<a href="/city.php?strah=1">← назад</a>
<h1>Переход к клановым улицам</h1>
На данный момент свои замки имеют такие кланы:
<?php
$rows = Db::getInstance()->fetchAll('select short_name, full_name, owner_id from clans where zamok = 2');
foreach ($rows as $row) {
$frm = "<img src='i/clan/%s.png'> %s<br><form><input name='klan' type='hidden' value='%s'><input type='submit' value='Вход'></form>";
echo sprintf($frm, $row['short_name'], $row['full_name'], $row['owner_id']);
}