3502904656
Singleton в некоторых местах вместо решения #42. Новые шаги для решения #16 и #52. Closes #42. Closes #32. Closes #31.
27 lines
1.2 KiB
PHP
27 lines
1.2 KiB
PHP
<?php
|
|
/** Список кланов и игроков в клане?
|
|
* Copyright (c) 2018.
|
|
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
|
* Project name: Battles-Game
|
|
*/
|
|
|
|
use Battles\Template;
|
|
|
|
Template::header('Список кланов');
|
|
include_once "config.php";
|
|
$claninf = urldecode(filter_input(INPUT_SERVER,'QUERY_STRING'));
|
|
|
|
if ($claninf && ($query = db::c()->query('SELECT * FROM `clans` WHERE `name` = "?s"', $claninf)->fetch_assoc())) {
|
|
echo "<h1>{$query['name']}</h1><p>{$query['descr']}</p>";
|
|
$clanlist = \Battles\Database\Db::getInstance()->execute('select login from users where clan = ?', $claninf);
|
|
while ($member = $clanlist->fetch()) {
|
|
echo "<img src=i/align_",$query['align'],".png> <img src=i/clan/",$query['short'],".png> ",$member['login']," - ",$member['status'],"<br>";
|
|
}
|
|
} else {
|
|
echo "<h1>Список кланов</h1>";
|
|
$query = db::c()->query('SELECT `align`,`name`,`short` FROM `clans` ORDER BY `name`');
|
|
while ($clanrow = $query->fetch_assoc()) {
|
|
$frm = "<img src='i/align_%s.png'> <img src='i/clan/%s.png'> <a href='?%s'>%s</a><br>";
|
|
echo sprintf($frm,$clanrow['align'],$clanrow['short'],$clanrow['name'],$clanrow['name']);
|
|
}
|
|
} |