Файл: inc/system/uhead.php
Строк: 167
<?
$TIME=time();
include_once $_SERVER['DOCUMENT_ROOT'].'/inc/system/functions.php';
$nine_may=explode(',', $ku['nine_may']);
/* */
if(isset($_GET['GETRUBI'])){
if(intval($nine_may[1])<$TIME){
$rubc=intval($nine_may[0]); $addrub=100;
if($rubc==0){
$rubc=1;
}else $addrub*=$rubc;
mysql_query("UPDATE kolhoz_user SET nine_may='".$rubc.",".($TIME+1800)."', rubies=".($ku['rubies']+$addrub)." WHERE id=".$ku['id']);
header("Location:/");
}
}
if($ku['id'] != ''){
$req_pod = mysql_query("SELECT * FROM `podarok` WHERE `id_user` = '".$ku['id']."' and `time` = ".date('dm', time())."");
if(mysql_num_rows($req_pod) == 0){
include $_SERVER['DOCUMENT_ROOT'].'/inc/system/podarok.php';
}
}
/* */
$max = $level['rating'];
$tek = $kr;
$forl = ($tek/$max)*100;
$lol=$level['rating']-$kr;
$x = $kr / $level['rating'] * 100;
$xs = ceil($x);
echo'<div class="logot"></div>';
echo '<div class="exp-progress">
<div class="exp-progress-filled" style="width:'.$forl.'%"></div>
</div>';
//echo "<img width='18' height='18' src='/img/icons/money.png' alt='o'> <span> ".strkol($ku['money'])."</span> <img src='/img/icons/ruby.png' alt='o'> <span>".strkol($ku['rubies'])."</span> ";
//echo "".on_k($ku['id'])."";
//echo " <span>$ku[level]</span> уровень</div></div>";
///if(intval($nine_may[1])<$TIME) echo "<div style='width: 100%;background-image: url(img/georgl.png);padding: 5px 0;background-size: cover;'><a href='?GETRUBI' style='display: block;width: 140px;text-align:center;margin: 10px auto;background-color: white;padding: 4px;border-radius: 5px;color: black;'>Получить ".(intval($nine_may[0])*100)." <img src='img/icons/ruby.png' alt='rubi'>!</a></div>";
//echo "<a href='payment/buy/NineMay' style='color:white;display:block;text-align:center'>Вы можете увеличить платно прибыль на 100 рубинов в зависимости на сколько пожелаете. Георгиевская лента доступна по 11 число включительно!</a>";
echo '<div class="f-top-stats">
<div class="inner">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td style="text-align:left;">
<img src="/img/icons/money.png"> <span>'.strkol($ku['money']).'</span>
</td>
<td class="pr6" style="text-align:right;">
<img src="/img/icons/ruby.png"><span>'.strkol($ku['rubies']).'</span>
</td>
</tr>
</table>
</div>
</div>';
///echo'<div class="level-foot">';
echo '</div></div>';
?>
<?
if(isset($_SESSION['harvest']))
{
harvest($_SESSION['harvest']);
unset($_SESSION['harvest']);
}
if(isset($_SESSION['rating']))
{
ratingg($_SESSION['rating']);
unset($_SESSION['rating']);
}
if(isset($_SESSION['mon']))
{
mon($_SESSION['mon']);
unset($_SESSION['mon']);
}
if(isset($_SESSION['km']))
{
km($_SESSION['km']);
unset($_SESSION['km']);
}
if($ku['umoney']!=0)
{
money($ku['umoney']);
}
if(isset($_SESSION['no_rubies']))
{
no_rubies($_SESSION['no_rubies']);
unset($_SESSION['no_rubies']);
}
if(isset($_SESSION['no_money']))
{
no_money($_SESSION['no_money']);
unset($_SESSION['no_money']);
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)!=0)
{
echo "<div class='feedback'><div>Новая почта <span class=''>(<span>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)."</span>)</span><br><a href='/mail/new'>Читать</a><br></div></div>";
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_gifts` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)!=0)
{
echo "<div class='feedback'>У вас новый подарок<br><a href='/presents/$ku[id]'>Смотреть</a><br></div>";
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_invite` WHERE `id_user` = '$ku[id]'"),0)!=0)
{
$invite=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective_invite` WHERE `id_user` = '$ku[id]'"));
$cti=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective` WHERE `id` = '$invite[id_collective]'"));
$who=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$invite[id_who]'"));
if(isset($_GET['invite_collective']) && ($_GET['invite_collective']=='yes'))
{
mysql_query("DELETE FROM `kolhoz_collective_invite` WHERE `id` = '$invite[id]'");
mysql_query("INSERT INTO `kolhoz_collective_user` SET `id_user` = '$ku[id]', `id_collective` = '$cti[id]', `time` = '$time', `status` = '7'");
mysql_query("INSERT INTO `kolhoz_collective_history` SET `id_user` = '$ku[id]', `id_who` = '$who[id]', `id_collective` = '$cti[id]', `time` = '$time', `type` = 'in', `dei` = 'who'");
header("Location:/kolhoz/$cti[id]");
}
elseif(isset($_GET['invite_collective']) && $_GET['invite_collective']=='no')
{
mysql_query("DELETE FROM `kolhoz_collective_invite` WHERE `id` = '$invite[id]'");
}
else
{
echo "<div class='feedback'><div><span>";
echo on_k($who['id']);
echo " <a class='' href='/user/$who[id]'>".nc($who['id'])."</a></span> приглашает Вас в свой колхоз <a href='/kolhoz/$cti[id]'><span>".hsc($cti['name'])."</span></a><br/>";
echo "<img src='/img/icons/tick.png' alt='o'> <a href='/inviteKolhoz/yes'>Принять приглашение</a><br/>";
echo "<img src='/img/icons/delete.png' alt='o'> <a href='/inviteKolhoz/no'>Отказаться</a>";
echo "</div>n
</div>";
}
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_zags` WHERE `she` = '$ku[id]' and `she_yes` = '0'"),0)!=0)
{
$c=mysql_fetch_assoc(mysql_query("SELECT * FROM `kolhoz_zags` WHERE `she`='".$ku['id']."'"));
$who=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$c[he]'"));
if(isset($_GET['brak']) && $_GET['brak']=='yes'){
mysql_query("UPDATE `kolhoz_user` SET `brak`='$c[she]' WHERE `id`='".$c['he']."'");
mysql_query("UPDATE `kolhoz_user` SET `brak`='$c[he]' WHERE `id`='".$c['she']."'");
mysql_query("INSERT INTO `kolhoz_mail` SET `id_user` = '$who[id]', `id_kont` = '0', `msg` = 'Поздравляем! Вы связали себя брачными узами.', `time` = '$time', `type` = 'to'");
mysql_query("UPDATE `kolhoz_zags` SET `she_yes`='1', `who`='1' WHERE `she`='".$ku['id']."'");
echo "<div class='feedback'><ul class='feedbackPanel'><li class='feedbackPanelINFO'><span class='feedbackPanelINFO'>Поздравляем! Вы связали себя брачными узами с ".nc($who['id']).".</span></li></ul></div>";
}
elseif(isset($_GET['brak']) && $_GET['brak']=='no'){
mysql_query("DELETE FROM `kolhoz_zags` WHERE `she` = '$ku[id]' AND `she_yes` = '0'");
mysql_query("UPDATE `kolhoz_user` SET `rubies` = `rubies` + '80' WHERE `id`='".$c['he']."'");
}
else
{
echo "<div class='feedback'><div><span>";
echo on_k($who['id']);
echo " <a class='' href='/user/$who[id]'>".nc($who['id'])."</a></span> предлагает вам заключить брак.<br>
<img src='/img/icons/tick.png' alt='o'> <a href='/inviteZags/yes'>Согласиться</a><br>
<img src='/img/icons/delete.png' alt='o'> <a href='/inviteZags/no'>Отказаться</a>
</div>
</div>";
}
}
if(isset($_SESSION['msg']))
{
msg_game($_SESSION['msg']);
unset($_SESSION['msg']);
}
if($ku['day']!=1){
echo'<div class="block">Спасибо, что вы с нами! Заходите каждый день и получайте подарки!<br> Награда: <img src="/img/icons/ruby.png" alt=""/> 20<br></div>';
mysql_query("INSERT INTO `info_user` SET `id_user` = '$ku[id]', `status` = '+', `many` = '20', `kuda` = 'ежедневный подарок', `time` = '$time'");
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']+20)."' WHERE `id` = '".$ku['id']."'");
mysql_query("UPDATE `kolhoz_user` SET `day` = '1' WHERE `id` = '".$ku['id']."'");
}
?>