battles/clan.php
2018-02-16 03:33:06 +02:00

92 lines
3.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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";
#include_once "functions.php";
#$db = $mysql;
$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>
<?php/*
<a href=?",$clanrow['name'],"></a>
else {
$clan = $_GET[clan];
$query=mysql_query("SELECT * FROM clans WHERE short = '$_GET[clan]' LIMIT 1");
while($row = mysql_fetch_array($query))
{
echo "<h2>$row[name]</h2><br>";
echo "$row[descr]<br><br>";
echo "<a href='http://$row[homepage]'>$row[homepage]<br /><hr /></a>";
}
$clan = $_GET['clan'];
$glid=mysql_fetch_array(mysql_query("SELECT `glava` FROM `clans` WHERE `short` = '".$clan."' LIMIT 1"));
$glid=$glid['glava'];
$gl=mysql_fetch_array(mysql_query("SELECT `login` FROM `users` WHERE `id` = '".$glid."' LIMIT 1"));
$gl=$gl['login'];
$gl2=mysql_fetch_array(mysql_query("SELECT `id` FROM `users` WHERE `id` = '".$glid."' LIMIT 1"));
$gl2=$gl2['id'];
$gl3=mysql_fetch_array(mysql_query("SELECT `level` FROM `users` WHERE `id` = '".$glid."' LIMIT 1"));
$gl3=$gl3['level'];
$gl4=mysql_fetch_array(mysql_query("SELECT `status` FROM `users` WHERE `id` = '".$glid."' LIMIT 1"));
$gl4=$gl4['status'];
echo "<br />{$gl4}: <b>{$gl}</b>[{$gl3}]<a href=http://capitalcity.old-dark.ru/inf.php?{$gl2} target=_blank><IMG SRC=../i/inf.gif WIDTH=12 HEIGHT=11 border=0 ALT=\"Инф. о {$gl2}\"></a><br />" ;
echo "<br /><em>Состав клана:</em><br />" ;
$clanss=mysql_fetch_array(mysql_query("SELECT `id` FROM `clans` WHERE `short` = '".$clan."' LIMIT 1"));
$clanss=$clanss['id'];
$clansss=mysql_query("SELECT `id`,`level`,`align`,`login` FROM `users` WHERE `klan` = '".$clanss."' ORDER BY level desc, login asc;");
while ($row3 = mysql_fetch_array($clansss)) {
echo("<IMG width=12 SRC=../i/align_".$row3['align'].".gif height=15 />");
echo("<b>");
echo ($row3['login']);
echo("</b>");
echo("[");
echo ($row3['level']);
echo("]");
echo("<a href=http://capitalcity.old-dark.ru/inf.php?".$row3['id']." target=_blank><IMG SRC=../i/inf.gif WIDTH=12 HEIGHT=11 border=0 ALT=\"Инф. о ".$row3['id']."\"></a>");
echo("<br/>");
}
$total = mysql_num_rows($clansss);
echo "<br />Всего: <b>".$total."</b>" ;
$clanrait=mysql_query("SELECT `rating` FROM `clans` WHERE short = '".$clan."' LIMIT 1");
while ($row4 = mysql_fetch_array($clanrait))
{
echo "<br />Очки рейтинга: <b>$row4[rating]</b><br /><br />" ;
}
}
mysql_close($db); */