Файл: world-faces.ru/world-faces.ru/garem.php
Строк: 303
<?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
only_reg();$set['title']='Гаремы';
include_once 'sys/inc/thead.php';
title();
aut();
$act=htmlspecialchars(trim($_GET['act']));
$oke = htmlspecialchars(trim($_GET['oke']));
$ids = intval($_GET['id']);
if($act == "reyt")
{
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `aa2` > '0'"), 0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q = mysql_query("SELECT * FROM `user` WHERE `aa2` > '0' ORDER BY `aa2` DESC LIMIT $start, $set[p_str]");
if ($k_post==0)
{
echo "Нет гаремов((n";
}
while ($ank = mysql_fetch_array($q))
{
if($num==1){ echo "<div class='adm'>";
$num=0;}
else
{echo "<div class='adm2'>";
$num=1;}
avatar2($ank['id']);
echo "".online($ank['id'])." ";
echo " <a href='/info.php?id=$ank[id]'><span style="color:$ank[ncolor]">$ank[nick]</span></a> ";
if ($ank['rating']>=551 && $ank['rating']<=1080){echo "<img src='/img/medal_bronze.gif' alt=''/>";
}else
if ($ank['rating']>=1081 && $ank['rating']<=2050){echo "<img src='/img/medal_bronze.gif' alt=''/> <img src='/img/medal_silver.gif' alt=''/>";
}else{
if ($ank['rating']>=5000)echo "<img src='/img/medal_bronze.gif' alt=''/> <img src='/img/medal_silver.gif' alt=''/> <img src='/img/medal_gold.gif' alt=''/>";}
echo "<br/>";
if ($ank['pol']==1)
echo "(Муж)";
else
echo "(Жен)";
if ($ank['ank_d_r']!=NULL && $ank['ank_m_r']!=NULL && $ank['ank_g_r']!=NULL){
$ank['ank_age']=date("Y")-$ank['ank_g_r'];
if (date("n")<$ank['ank_m_r'])$ank['ank_age']=$ank['ank_age']-1;
elseif (date("n")==$ank['ank_m_r']&& date("j")<$ank['ank_d_r'])$ank['ank_age']=$ank['ank_age']-1;
echo ",$ank[ank_age] лет";
}
if ($ank['ank_city']!=NULL)echo ",$ank[ank_city]";
echo "<br/>";
echo "<a href='garem.php?act=garem&id=".$ank['id']."'>В гареме</a> <strong>".$ank['aa2']."</strong> чел.<br />n";
echo'</div>';
}
if ($k_page>1)str("?act=reyt&",$k_page,$page);
} else if($act == "reytg") {
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `aa3` > '0'"), 0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q = mysql_query("SELECT * FROM `user` WHERE `aa3` > '0' ORDER BY `aa3` DESC LIMIT $start, $set[p_str]");
if ($k_post==0)
{
echo "Нет украденных((n";
}
while ($ank = mysql_fetch_array($q))
{
if($num==1){ echo "<div class='adm'>";
$num=0;}
else
{echo "<div class='adm2'>";
$num=1;}
avatar2($ank['id']);
echo "".online($ank['id'])." ";
echo " <a href='/info.php?id=$ank[id]'><span style="color:$ank[ncolor]">$ank[nick]</span></a> ";
if ($ank['rating']>=551 && $ank['rating']<=1080){echo "<img src='/img/medal_bronze.gif' alt=''/>";
}else
if ($ank['rating']>=1081 && $ank['rating']<=2050){echo "<img src='/img/medal_bronze.gif' alt=''/> <img src='/img/medal_silver.gif' alt=''/>";
}else{
if ($ank['rating']>=5000)echo "<img src='/img/medal_bronze.gif' alt=''/> <img src='/img/medal_silver.gif' alt=''/> <img src='/img/medal_gold.gif' alt=''/>";}
echo "<br/>";
if ($ank['pol']==1)
{
echo "(Муж)";
$a = '';
} else {
echo "(Жен)";
$a = 'a';
}
if ($ank['ank_d_r']!=NULL && $ank['ank_m_r']!=NULL && $ank['ank_g_r']!=NULL){
$ank['ank_age']=date("Y")-$ank['ank_g_r'];
if (date("n")<$ank['ank_m_r'])$ank['ank_age']=$ank['ank_age']-1;
elseif (date("n")==$ank['ank_m_r']&& date("j")<$ank['ank_d_r'])$ank['ank_age']=$ank['ank_age']-1;
echo ",$ank[ank_age] лет";
}
if ($ank['ank_city']!=NULL)echo ",$ank[ank_city]";
echo "<br/>";
echo "Украден".$a.": <strong>".$ank['aa3']."</strong> раз.<br />n";
echo'</div>';
}
if ($k_page>1)str("?act=reytg&",$k_page,$page);
} else if($act == "garem") {
$kl=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = $ids"),0);
if ($kl==0)
{
echo "Нет таково пользователя<br/>";
include_once 'sys/inc/tfoot.php'; exit;
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `aa1` = '$ids'"), 0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q = mysql_query("SELECT * FROM `user` WHERE `aa1` = '$ids' ORDER BY `aa3` DESC LIMIT $start, $set[p_str]");
$ankers = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $ids LIMIT 1"));
echo "<div class='adm'><center>Гарем <strong>".$ankers['nick']."</strong></center></div>n";
if ($k_post==0)
{
echo "Нет украденных((n";
}
while ($ank = mysql_fetch_array($q))
{
if($num==1){ echo "<div class='adm'>";
$num=0;}
else
{echo "<div class='adm2'>";
$num=1;}
avatar2($ank['id']);
echo "".online($ank['id'])." ";
echo " <a href='/info.php?id=$ank[id]'><span style="color:$ank[ncolor]">$ank[nick]</span></a> ";
if ($ank['rating']>=551 && $ank['rating']<=1080){echo "<img src='/img/medal_bronze.gif' alt=''/>";
}else
if ($ank['rating']>=1081 && $ank['rating']<=2050){echo "<img src='/img/medal_bronze.gif' alt=''/> <img src='/img/medal_silver.gif' alt=''/>";
}else{
if ($ank['rating']>=5000)echo "<img src='/img/medal_bronze.gif' alt=''/> <img src='/img/medal_silver.gif' alt=''/> <img src='/img/medal_gold.gif' alt=''/>";}
echo "<br/>";
if ($ank['pol']==1)
{
echo "(Муж)";
$a = '';
} else {
echo "(Жен)";
$a = 'a';
}
if ($ank['ank_d_r']!=NULL && $ank['ank_m_r']!=NULL && $ank['ank_g_r']!=NULL){
$ank['ank_age']=date("Y")-$ank['ank_g_r'];
if (date("n")<$ank['ank_m_r'])$ank['ank_age']=$ank['ank_age']-1;
elseif (date("n")==$ank['ank_m_r']&& date("j")<$ank['ank_d_r'])$ank['ank_age']=$ank['ank_age']-1;
echo ",$ank[ank_age] лет";
}
if ($ank['ank_city']!=NULL)echo ",$ank[ank_city]";
echo "<br/>";
echo "Украден".$a.": <strong>".$ank['aa3']."</strong> раз.<br />n";
echo'</div>';
}
if ($k_page>1)str("?act=garem&id=".$ids."&",$k_page,$page);
} else if($act == "kraz") {
if($ank['pol'] == $user['pol'])
{
echo 'Разрешено красть только людей противоположного пола!';
include_once 'sys/inc/tfoot.php';
exit;
}
$ank = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $ids LIMIT 1"));
if ($us['nick']==$ank['nick'] || $us['pol']==$ank['pol']){
echo'Вы не можете красть сами себя и вы не можете красть человека с таким же полом как и у вас)<br/>';
header("refresh:2; url=$us[id]");
}else{
if($ank['aa3'] == 0)
{
$cena = 100;
} else if($ank['aa3'] == 1) {
$cena = 200;
} else {
$cena = (($ank['aa3']*100)+100);
}
if($oke == 'ok')
{
if($user['balls'] < $cena)
{
echo 'У вас недостаточно баллов!';
include_once 'sys/inc/tfoot.php';
exit;
}
if ($user['pol']==1)
{
$a = '';
} else {
$a = 'a';
}
if ($ank['pol']==1)
{
$apt = 'его';
} else {
$apt = 'её';
}
$msgno = 'Вас украли в гарем к '.$user['nick'].' весёлого новоселья ;)';
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `msg`, `time`) values('0', '".$ank['id']."', '".$msgno."', '".$time."')");
mysql_query("UPDATE `user` SET `balls` = `balls`-$cena, `aa2` = `aa2`+1 WHERE `id` = '".$user['id']."';");
mysql_query("UPDATE `user` SET `aa3` = `aa3`+1, `aa1` = '".$user['id']."' WHERE `id` = '".$ank['id']."';");
if(intval($ank['aa1']) != 0)
{
mysql_query("UPDATE user SET aa2=aa2-1 WHERE id='".$ank['aa1']."';");
$msgn = 'Пользователь '.$user['nick'].' украл'.$a.' у вас из гарема жителя: '.$ank['nick'].', удачи отвоевать '.$apt.' обратно ;)';
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `msg`, `time`) values('0', '".$ank['aa1']."', '".$msgn."', '".$time."')");
}
echo 'Удачно!) Желаем вам большой гарем)))';
header("refresh:2; url=$ank[id]");
} else {
echo '<div class="adm2">Вы хотите украсть <a href="info.php?id='.$ids.'"><strong>'.$ank['nick'].'</strong></a><br />
Стоимость: <strong>'.$cena.'</strong> баллов.<br />
<a href="garem.php?act=kraz&oke=ok&id='.$ids.'"><strong>Украсть</strong></a></div>';
}}
} else {
echo '<div class="adm"><a href="garem.php?act=reyt">Рейтинг гаремов</a></div>';
echo '<div class="adm2"><a href="garem.php?act=reytg">Рейтинг украденых</a></div>';
}
include_once 'sys/inc/tfoot.php';
?>