battles/clan.php
2018-02-16 03:34:51 +02:00

34 lines
1.2 KiB
PHP

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<?php
/**
* Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com>
* 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 "<h1>{$query['name']}</h1><p>{$query['descr']}</p>";
$clanlist = db::c()->query('SELECT `login`,`status` FROM `users` WHERE `klan` = ?i',$query['id']);
while ($member = $clanlist->fetch_assoc()) {
echo "<img src=i/align_",$query['align'],".gif> <img src=i/klan/",$query['short'],".gif> ",$member['login']," - ",$member['status'],"<br>";
}
} else {
echo "<h1>Список кланов</h1>";
$query = db::c()->query('SELECT `align`,`name`,`short` FROM `clans` ORDER BY `name` ASC');
while ($clanrow = $query->fetch_assoc()) {
echo "<img src=i/align_",$clanrow['align'],".gif> <img src=i/klan/",$clanrow['short'],".gif> <a href=?",$clanrow['name'],">",$clanrow['name'],"</a><br>";
}
}
?>
</body>
</html>