Файл: accmarket.net/fraction/users.php
Строк: 59
<?php
define('_ON_CMS', 1);
require_once '../includes/start.php';
require_once '../includes/function.php';
require_once '../includes/header.php';
$fr=$_GET['f'];
$q = mysql_query("SELECT * FROM `fractions` WHERE `id`='".check(mysql_real_escape_string($fr))."'");
$f = mysql_fetch_array($q);
if($game==0 OR $level==0 OR $f['id']=='' OR $ban!=0){
header('Location: ../index.php');
}
echo '<div class="top"><img src="../images/fr.png" alt="" /> Фракция <u>'.$f['name'].'</u> | Состав</div>';
switch ($act) {
default:
$PAGINGS = mysql_query("SELECT * FROM `fractions_users` WHERE `fid`='".$f['id']."' ORDER BY `adm` DESC");
if($PAGINGS > 0)
{
while($row = mysql_fetch_array($PAGINGS))
{
echo '<div class="conts">';
$q1 = mysql_query("SELECT * FROM `users` WHERE `id`='".check(mysql_real_escape_string($row['uid']))."'");
$f1 = mysql_fetch_array($q1);
echo ''.rasa($f1['rasa']).' <a href="../p/anketa.php?id='.$f1['id'].'"><span class="'.crasa($f1['rasa']).'">'.$f1['login'].'</span></a>';
if($f['uid']==$use_id AND $row['uid']!=$use_id)echo ' [<a href="?act=rank&f='.$f['id'].'&u='.$row['uid'].'">изм</a>]';
if($f1['lasttime'] > time()-$online_time)echo ' <span class="green">on</span>';
if($f1['lasttime'] <= time()-$online_time)echo ' ['.dates($f1['lasttime']).']';
if($row['adm']==1)echo ' - глава фракции';
echo '</div>';
}
}
echo '<div class="conts"><a href="fraction.php?f='.$f['id'].'"><<Назад</a></div>';
break;
case 'rank':
$u=$_GET['u'];
$q1 = mysql_query("SELECT * FROM `users` WHERE `id`='".check(mysql_real_escape_string($u))."'");
$f1 = mysql_fetch_array($q1);
if($f['uid']==$use_id AND $f1['id']!=$use_id AND $f1['fr_id']==$f['id']){
echo '<div class="cont">Игрок: '.rasa($f1['rasa']).' <a href="../p/anketa.php?id='.$f1['id'].'"><span class="'.crasa($f1['rasa']).'">'.$f1['login'].'</span></a></div><div class="conts">';
if(!$_POST)
{
echo '<form action="" method="POST">';
echo 'Звание:<br/><select name="type">';
echo '<option value="0">Член фракции</option>';
echo '<option value="1">Глава фракции</option>';
echo '</select> <input type="submit" name="submit" value="Изменить"/></form>';
}
else
{
if ($type<0 OR $type>1)
$error = $error . 'Нет такого звания!<br/>';
$type = check(trim($_POST['type']));
$error = false;
if (empty($error))
{
echo 'Звание игрока '.rasa($f1['rasa']).' <a href="../p/anketa.php?id='.$f1['id'].'"><span class="'.crasa($f1['rasa']).'">'.$f1['login'].'</span></a> изменено!<br/>';
mysql_query("UPDATE `fractions_users` SET `adm`='".$type."' WHERE `uid` = '".$f1['id']."'");
}
else
{
echo ''.$error.'';
}
}
}
echo '<a href="users.php?f='.$f['id'].'"><<Назад</a></div>';
break;
}
div('<a href="../">В игру</a>','conts');
require_once '../includes/footer.php';
?>