battles/clan.php

92 lines
3.6 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";
#include_once "functions.php";
#$db = $mysql;
$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:12:47 +00:00
echo "<img src=i/align_",$clanrow['align'],".gif> <img src=i/klan/",$clanrow['short'],".gif> <a href=?",$clanrow['name'],">",$clanrow['name'],"</a><br>";
2018-02-16 00:52:13 +00:00
}
}
2018-02-16 01:33:06 +00:00
?>
</body>
</html>
<?php/*
2018-02-16 01:12:47 +00:00
<a href=?",$clanrow['name'],"></a>
2018-02-16 00:52:13 +00:00
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); */