* 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 "

{$query['name']}

{$query['descr']}

"; $clanlist = \Battles\Database\Db::getInstance()->execute('select login from users where clan = ?', $claninf); while ($member = $clanlist->fetch()) { echo " ",$member['login']," - ",$member['status'],"
"; } } else { echo "

Список кланов

"; $query = db::c()->query('SELECT `align`,`name`,`short` FROM `clans` ORDER BY `name`'); while ($clanrow = $query->fetch_assoc()) { $frm = " %s
"; echo sprintf($frm,$clanrow['align'],$clanrow['short'],$clanrow['name'],$clanrow['name']); } }