Файл: inc/user/communication.php
Строк: 153
<?
$title='Общение';
include_once '../system/config.php';
if(isset($_GET['communication']) && ($_GET['communication'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `id` = '".($_GET['communication'])."' LIMIT 1"),0)!=0){
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '".intval($_GET['communication'])."'"));
$au=$ank;
if(isset($_GET['friend']))
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_friends` WHERE `id_user` = '$ku[id]' AND `id_ank` = '$ank[id]'"),0)==0)
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_blacklist` WHERE `id_user` = '$ku[id]' AND `id_ank` = '$ank[id]'"),0)!=0)mysql_query("DELETE FROM `kolhoz_blacklist` WHERE `id_user` = '$ku[id]' AND `id_ank` = '$ank[id]'");
mysql_query("INSERT INTO `kolhoz_friends` SET `id_user` = '$ku[id]', `id_ank` = '$ank[id]'");
}
else mysql_query("DELETE FROM `kolhoz_friends` WHERE `id_user` = '$ku[id]' AND `id_ank` = '$ank[id]'");
echo mysql_error();
}
elseif(isset($_GET['blacklist']))
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_blacklist` WHERE `id_user` = '$ku[id]' AND `id_ank` = '$ank[id]'"),0)==0)
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_friends` WHERE `id_user` = '$ku[id]' AND `id_ank` = '$ank[id]'"),0)!=0)mysql_query("DELETE FROM `kolhoz_friends` WHERE `id_user` = '$ku[id]' AND `id_ank` = '$ank[id]'");
mysql_query("INSERT INTO `kolhoz_blacklist` SET `id_user` = '$ku[id]', `id_ank` = '$ank[id]'");
}
else mysql_query("DELETE FROM `kolhoz_blacklist` WHERE `id_user` = '$ku[id]' AND `id_ank` = '$ank[id]'");
echo mysql_error();
}
if(isset($_GET['love']) && $ank['pol']==0 && $mc['zags']>0)
{
$cena=100;
if($ku['rubies']>=$cena)
{
if(isset($_GET['ok']))
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-$cena)."' WHERE `id` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_zags` SET `he` = '$ku[id]', `she` = '$ank[id]', `collective` = '$mc[id]', `she_yes` = '0', `time` = '$time'");
echo '<div class="feedback"><ul class="feedbackPanel"><li class="feedbackPanelINFO"><span class="feedbackPanelINFO">Вы сделали предложение девушке '.($anku[nick]).'. В случае отказа, вы сможете вернуть 80 рубинов, забрав заявление из ЗАГСа.</span></li></ul></div>';
}
else
{
echo "<div class='title'><li>
<span>Вы оплачиваете подачу заявления в ЗАГС</span> <span></span><br>
<span>Стоимость</span>: <span><img src='/img/icons/ruby.png' alt='o'> <span class='n'>100</span></span>
</li>
<li class='pt'><img alt='' src='/img/icons/tick.png'> <a href='/communication/$ank[id]/love/ok'><span>Да, подтверждаю</span></a></li>
<li><img alt='' src='/img/icons/cross.png'> <a href='/communication/$ank[id]/love'><span>Нет, отказываюсь</span></a></li>";
echo "</ul></div>";
include_once 'inc/system/foot.php';
}
}
else no_rubies($cena-$ku['rubies']);
}
echo"<div class='rzd2'></div><div class='menuin2'>";
echo "<div class='title'>".($ank['id']==$ku['id']?"Общение":"<a href='/user/$ank[id]'>$ank[nick]</a> / Общение")."</h2></div>";
echo "<div class='content'><div class='div'><ul>";
if($ank['id']!=$ku['id'])echo "<li><img alt='' src='/img/icons/pencil.png'> <a href='/mail/new_msg/$ank[id]'>Написать</a></li>";
if($ank['id']!=$ku['id'] && $ank['level']<35)echo "<li><img alt='' src='/img/icons/money.png'> ".($ku['rating']>=$ank['rating']?"<a href='/perevod/$ank[id]'>":null)."Переслать".($ku['rating']>=$ank['rating']?"</a>":null)."</li>";
if($ank['id']!=$ku['id'])echo "<li><img alt='' src='/img/icons/gift_plus.png'> <a href='/presents/$ank[id]/do'>Подарить</a></li>";
echo "<li><img alt='' src='/img/icons/gift.png'> <a href='/presents/$ank[id]'>Подарки</a></li>";
if($ank['id']!=$ku['id'])echo "<li><img alt='' src='/img/icons/favorite.png'> <a href='/communication/$ank[id]/friend'><span>".(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_friends` WHERE `id_user` = '$ku[id]' AND `id_ank` = '$ank[id]' LIMIT 1"),0)==0?"В друзья":"Из друзей")."</span></a></li>";
if($ank['id']!=$ku['id'])echo "<li><img alt='' src='/img/icons/favorite.png'> <a href='/communication/$ank[id]/blacklist'><span>".(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_blacklist` WHERE `id_user` = '$ku[id]' AND `id_ank` = '$ank[id]' LIMIT 1"),0)==0?"В игнор":"Отменить игнор")."</span></a></li>";
if($ank['pol']==0 && $mc['zags']>0)echo "<li><img alt='' src='/img/love111.png' width='16'> <a href='/communication/$ank[id]/love'>Сделать предложение<span></span></a></li>";
echo "</ul></div>";echo"</div></div><div class='rzd2'></div>";
include_once '../system/foot.php';
}
?>