battles/clans.php

35 lines
1.2 KiB
PHP
Raw Normal View History

2018-02-16 01:04:20 +00:00
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
2018-02-16 00:52:13 +00:00
<?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'));
2018-02-16 01:04:20 +00:00
if ($claninf AND ($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>";
2018-02-16 01:33:06 +00:00
$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>";
}
2018-02-16 00:52:13 +00:00
} else {
echo "<h1>Список кланов</h1>";
2018-02-16 01:12:47 +00:00
$query = db::c()->query('SELECT `align`,`name`,`short` FROM `clans` ORDER BY `name` ASC');
2018-02-16 00:52:13 +00:00
while ($clanrow = $query->fetch_assoc()) {
2018-02-16 01:50:49 +00:00
$frm = "<img src='i/align_%s.gif'> <img src='i/klan/%s.gif'> <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
}
}
2018-02-16 01:33:06 +00:00
?>
</body>
2018-02-16 01:34:51 +00:00
</html>