* Project name: Battles-Game
*/
include_once "config.php";
$claninf = urldecode(filter_input(INPUT_SERVER,'QUERY_STRING'));
if ($claninf AND ($query = db::c()->query('SELECT * FROM `clans` WHERE `name` = "?s"', $claninf)->fetch_assoc())) {
echo "{$query['name']}
{$query['descr']}
";
$clanlist = db::c()->query('SELECT `login`,`status` FROM `users` WHERE `klan` = ?i',$query['id']);
while ($member = $clanlist->fetch_assoc()) {
echo " ",$member['login']," - ",$member['status'],"
";
}
} else {
echo "Список кланов
";
$query = db::c()->query('SELECT `align`,`name`,`short` FROM `clans` ORDER BY `name` ASC');
while ($clanrow = $query->fetch_assoc()) {
$a = $clanrow['align'];
$s = $clanrow['short'];
$n = $clanrow['name'];
echo " ",$n,"
";
$frm = " %s
";
echo "wwow - ".sprintf($frm,$a,$s,$n,$n);
}
}
?>