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

This commit is contained in:
lopar 2018-02-16 03:04:20 +02:00
parent 864d5d482b
commit 774fca40eb

View File

@ -1,3 +1,14 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
</body>
</html>
<?php <?php
/** /**
* Copyright (c) 2018. * Copyright (c) 2018.
@ -11,32 +22,17 @@ include_once "config.php";
$claninf = urldecode(filter_input(INPUT_SERVER,'QUERY_STRING')); $claninf = urldecode(filter_input(INPUT_SERVER,'QUERY_STRING'));
if ($claninf) { if ($claninf AND ($query = db::c()->query('SELECT * FROM `clans` WHERE `name` = "?s"', $claninf)->fetch_assoc())) {
$query = db::c()->query('SELECT * FROM `clans` WHERE `name` = "?s"', $claninf)->fetch_assoc();
echo "<h1>{$query['name']}</h1><p>{$query['descr']}</p>"; echo "<h1>{$query['name']}</h1><p>{$query['descr']}</p>";
} else { } else {
echo "<h1>Список кланов</h1>"; echo "<h1>Список кланов</h1>";
$query = db::c()->query('SELECT `name`,`short` FROM `clans`'); $query = db::c()->query('SELECT `name`,`short` FROM `clans` ORDER BY `name` ASC');
while ($clanrow = $query->fetch_assoc()) { while ($clanrow = $query->fetch_assoc()) {
echo "<img src=i/klan/",$query['short'],".gif>",$query['name'],"<br>"; echo "<img src=i/klan/",$clanrow['short'],".gif>",$clanrow['name'],"<br>";
} }
} }
/* /*
if(!$_GET[clan]) {
?>
<dl>
<ul type="disc">
<?php
$query=mysql_query("SELECT * FROM clans ORDER BY rating desc, short asc", $db);
while($row = mysql_fetch_array($query))
{
echo "<li><strong><img src='http://capitalcity.old-dark.ru/i/align_$row[align].gif' border='0'><img src='http://capitalcity.old-dark.ru/i/klan/$row[short].gif' border='0'><a href='index.php?section=99&page=clans1&clan=$row[short]'>$row[short]</a></strong> (<font color=gray size=-2>Очки рейтинга: <b>$row[rating])</b></font> </li>";
}
?>
</ul></dl>
<?php
mysql_close($db);
}
else { else {
$clan = $_GET[clan]; $clan = $_GET[clan];
$query=mysql_query("SELECT * FROM clans WHERE short = '$_GET[clan]' LIMIT 1"); $query=mysql_query("SELECT * FROM clans WHERE short = '$_GET[clan]' LIMIT 1");