2018-02-16 00:52:13 +00:00
|
|
|
<?php
|
2022-01-26 23:15:33 +00:00
|
|
|
/** Список кланов и игроков в клане?
|
2018-02-16 00:52:13 +00:00
|
|
|
* Copyright (c) 2018.
|
|
|
|
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
|
|
|
* Project name: Battles-Game
|
|
|
|
*/
|
2022-01-26 23:15:33 +00:00
|
|
|
|
|
|
|
use Battles\Template;
|
|
|
|
|
|
|
|
Template::header('Список кланов');
|
2018-02-16 00:52:13 +00:00
|
|
|
include_once "config.php";
|
|
|
|
$claninf = urldecode(filter_input(INPUT_SERVER,'QUERY_STRING'));
|
|
|
|
|
2022-01-26 23:15:33 +00:00
|
|
|
if ($claninf && ($query = db::c()->query('SELECT * FROM `clans` WHERE `name` = "?s"', $claninf)->fetch_assoc())) {
|
2018-02-16 00:52:13 +00:00
|
|
|
echo "<h1>{$query['name']}</h1><p>{$query['descr']}</p>";
|
2022-01-26 23:15:33 +00:00
|
|
|
$clanlist = \Battles\Database\Db::getInstance()->execute('select login from users where clan = ?', $claninf);
|
|
|
|
while ($member = $clanlist->fetch()) {
|
2020-09-30 22:12:53 +00:00
|
|
|
echo "<img src=i/align_",$query['align'],".png> <img src=i/clan/",$query['short'],".png> ",$member['login']," - ",$member['status'],"<br>";
|
2018-02-16 01:33:06 +00:00
|
|
|
}
|
2018-02-16 00:52:13 +00:00
|
|
|
} else {
|
|
|
|
echo "<h1>Список кланов</h1>";
|
2022-01-26 23:15:33 +00:00
|
|
|
$query = db::c()->query('SELECT `align`,`name`,`short` FROM `clans` ORDER BY `name`');
|
2018-02-16 00:52:13 +00:00
|
|
|
while ($clanrow = $query->fetch_assoc()) {
|
2020-09-30 22:12:53 +00:00
|
|
|
$frm = "<img src='i/align_%s.png'> <img src='i/clan/%s.png'> <a href='?%s'>%s</a><br>";
|
2018-02-16 01:53:33 +00:00
|
|
|
echo sprintf($frm,$clanrow['align'],$clanrow['short'],$clanrow['name'],$clanrow['name']);
|
2018-02-16 00:52:13 +00:00
|
|
|
}
|
2020-09-30 14:30:31 +00:00
|
|
|
}
|