Файл: test.zfarm.mobi/mscrypt/msindex.php
Строк: 173
<?php
what(0, 'mscrypt');
echo '<div class="btn center">Кладбище</div>';
if($user['level']>=25){}else{
$text = 'Вход только для зомби с 25 уровнем!';
$_SESSION['msg'] = $text;
header("Location: ./");
exit;
}
echo '<div class="feedbackPanel"><center>
<img width="55" height="55" src="images/mscrypt/m_gargoy.png" alt="" />
<img width="75" height="75" src="images/mscrypt/m_sklep.png" alt="" />
<img width="55" height="55" src="images/mscrypt/m_gargoya.png" alt="" />
</center></div>';
////////////////// Автор MyStyle vk.com/online_user ////////////////////////////////////////////////////////////////////////////////////////////////////
if(isset($_GET['collect']) && num($_GET['collect'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_mscrypt` WHERE `id` = '".num($_GET['collect'])."' AND `user` = '".$user['id']."' AND `time` <= '".$time."'LIMIT 1"),0)!=0){
$img = '';
$farm = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_mscrypt` WHERE `user` = '".$user['id']."' AND `id` = '".num($_GET['collect'])."' AND `time` <= '".$time."'"));
$trrti = $farm['img'].'.png';
$sclad = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_sklad` WHERE `img` = '".$trrti."' AND `user` = '".$user['id']."'"));
$mscrypt = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_mscrypt_m` WHERE `id` = '".$farm['type']."'"));
$rat = $mscrypt['exp'];
$avatar = 0;
$mozgi_exp_sql = 0;
if(isset($mozgi_exp))$mozgi_exp_sql=(($rat/100)*200);
if(isset($user['avatar_exp']))$avatar=(($rat/100)*$user['avatar_exp']);
$rat_user = $avatar+$mozgi_exp_sql;
if($rat_user==0)$rat=$rat;
else $rat=$rat_user;
$cerdce = $user['sunduk3']+30;
$rating = $user['rating']+$rat;
$money = $user['money']+$mscrypt['money'];
///////////////////////////////////////////
///////////////////////////////////////////
///////// Лог Пользователя ///// By MyStyle
$text = 'Урожай перемещён в склад. Опыта: '.$rat.' + <img width="16" height="16" src="images/zombi/coins.png" alt="" title=""/> '.$mscrypt['money'].' + 30 <img width="16" height="16" src="images/who_postroyki/brain.png" alt="" />';
$_SESSION['msg'] = $text;
///////////////////////////////////////////
///////////////////////////////////////////
///////////////////////////////////////////
mysql_query("UPDATE `mystyle_user` SET `money` = '".$money ."', `rating` = '".$rating."', `sunduk3` = '".$cerdce."' WHERE `id` = '".$user['id']."' LIMIT 1");
if($trrti == $sclad['img']){
$vol = $sclad['col']+1;
mysql_query("UPDATE `mystyle_sklad` SET `col` = '".$vol."', `name` = '".my_esc(Трава)."' WHERE `id` = '".$sclad['id']."' AND `user` = '".$user['id']."'");
include 'mystylecollect/mystylecollectionsrand.php';
$rand1 = rand(1,10);
$rand2 = rand(1,10);
$rand3 = rand(1,211);
if($rand1 == $rand2){
$collections = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_collections` WHERE `id` = '".$rand3."'"));
$img_coll = ''.$collections['img'].'.png';
mysql_query("INSERT INTO `mystyle_sklad` SET `user` = '".$user['id']."', `name` = '".$collections['name']."', `img` = '".$img_coll."', `money` = '".$collections['money']."', `type` = '".num(2)."', `col` = '".num(1)."'");
}
}else{
include 'mystylecollect/mystylecollectionsrand.php';
$rand1 = rand(1,20);
$rand2 = rand(1,30);
$rand3 = rand(1,211);
if($rand1 == $rand2){
$collections = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_collections` WHERE `id` = '".$rand3."'"));
$img_coll = ''.$collections['img'].'.png';
mysql_query("INSERT INTO `mystyle_sklad` SET `user` = '".$user['id']."', `name` = '".$collections['name']."', `img` = '".$img_coll."', `money` = '".$collections['money']."', `type` = '".num(2)."', `col` = '".num(1)."'");
}
$reimgt = ''.$farm['img'].'.png';
mysql_query("INSERT INTO `mystyle_sklad` SET `user` = '".$user['id']."', `name` = '".my_esc(Трава)."', `img` = '".$reimgt."', `money` = '".$mscrypt['money']."', `type` = '".num(1)."', `col` = '".num(1)."'");
}
mysql_query("UPDATE `mystyle_mscrypt` SET `type` = '0', `time_left` = '0', `time` = '0', `img` = '' WHERE `id` = '".$farm['id']."' AND `user` = '".$user['id']."'");
header("Location: ./?mscrypt");
exit;
}elseif(isset($_GET['mscrypt']) && num($_GET['mscrypt'])!=NULL && isset($_GET['id']) && num($_GET['id'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_mscrypt_m` WHERE `id` = '".num($_GET['id'])."' AND `level` <= '".$user['level']."' LIMIT 1"),0) && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_mscrypt` WHERE `id` = '".num($_GET['mscrypt'])."' AND `user` = '".$user['id']."' LIMIT 1"),0)!=0){
$fer = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_mscrypt_m` WHERE `id` = '".num($_GET['id'])."' AND `level` <= '".$user['level']."'"));
$les = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_mscrypt` WHERE `id` = '".num($_GET['mscrypt'])."' AND `user` = '".$user['id']."'"));
$need=$fer['money']/2;
if($user['money']>=$need){
$time_got = $time+$fer['time'];
$needs = $user['money']-$need;
mysql_query("UPDATE `mystyle_user` SET `money` = '".$needs."' WHERE `id` = '".$user['id']."' LIMIT 1");
mysql_query("UPDATE `mystyle_mscrypt` SET `time` = '".$time_got."', `img` = '".$fer['img']."', `time_left` = '".$fer['time']."', `type` = '".$fer['id']."' WHERE `id` = '".num($_GET['mscrypt'])."' AND `user` = '".$user['id']."'");
$rat = 10;
$avatar = 0;
$mozgi_exp_sql = 0;
if(isset($mozgi_exp))$mozgi_exp_sql=(($rat/100)*200);
if(isset($user['avatar_exp']))$avatar=(($rat/100)*$user['avatar_exp']);
$rat_user = $avatar+$mozgi_exp_sql;
if($rat_user==0)$rat=$rat;
else $rat=$rat_user;
$ret = $user['rating']+$rat;
mysql_query("UPDATE `mystyle_user` SET `rating` = '".$ret."' WHERE `id` = '".$user['id']."' LIMIT 1");
///////// Лог Пользователя ///// By MyStyle
$text = 'Посадили: + <span class="level">'.$rat.'</span> <img width="16" height="16" alt="" title="" src="images/zombi/xp.png">';
$_SESSION['msg'] = $text;
header("Location: ./?mscrypt");
exit;
}else{
err_money($need-$user['money']);
}
}elseif(isset($_GET['mscrypt']) && num($_GET['mscrypt'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_mscrypt` WHERE `user` = '".$user['id']."' AND `id` = '".num($_GET['mscrypt'])."' AND `time` = '0' LIMIT 1"),0)!=0){
$farm = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_mscrypt` WHERE `id` = '".num($_GET['mscrypt'])."'"));
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_mscrypt_m`"),0);
$k_page=k_page($k_post,$user['set']);
$page=page($k_page);
$start=$user['set']*$page-$user['set'];
$q=mysql_query("SELECT * FROM `mystyle_mscrypt_m` LIMIT $start, $user[set]");
while($post=mysql_fetch_array($q))
{
$cena = $post['money']/2;
echo '<li class="emptyPanel"><span class="whiteBoldLink textshadow"><div>
<img class="portrait pt6 pl6 pr6 center kartinki_div" width="60" height="60" src="images/mscrypt/pole/'.$post['img'].'.png" alt="" />
<span style="clear: both;">Уровень: '.$post['level'].'</span>
<br /><span class="pt6">Созреет через: '.time_left($post['time']).'</span>
<span class="whiteBoldLink fr">Даёт после сбора: <span><img width="16" height="16" alt="" title="" src="images/zombi/xp.png"> '.$post['exp'].'</span> <span>
<img width="16" height="16" alt="" title="" src="images/zombi/coins.png"> '.$post['money'].'</span></span>';
echo '<div style="clear:both"></div></div></li>';
if($user['level']>=$post['level']){
echo '<a class="btnwom" href="?mscrypt='.num($_GET['mscrypt']).'&id='.$post['id'].'">Посадить
<span class="money nobr textshadow"><img width="16" height="16" src="images/zombi/coins.png" alt=""/> <span class="required">'.$cena.'</span></span>
</a>';
}
echo '</div></li>';
}
if ($k_page>1)str("?mscrypt=".num($_GET['mscrypt'])."&",$k_page,$page); // Вывод страниц
echo '<a href="./?mscrypt" class="btn">Назад на кладбище</a>';
}else{
//////////////////////////////////////////////////////////// Ниже код глав клад ////////////////////////////////////////////////////////////////////////
$user['set'] = 9;
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_mscrypt` WHERE `user` = '".$user['id']."'"),0);
$k_page=k_page($k_post,$user['set']);
$page=page($k_page);
$start=$user['set']*$page-$user['set'];
echo '<table class="center pt6 pb6" style="margin:0 auto; width: 80%;">';
$q=mysql_query("SELECT * FROM `mystyle_mscrypt` WHERE `user` = '".$user['id']."' LIMIT $start, $user[set]");
while($post=mysql_fetch_array($q))
{
$sr = $start+1;
if($sr == 1)echo '<tr class="whiteBoldLink textshadow">';
if($sr == 4)echo '<tr class="whiteBoldLink textshadow">';
if($sr == 7)echo '<tr class="whiteBoldLink textshadow">';
/////////////////////////////////////////////////////////
@$bte = $post['time']-time();
@$timr = $bte/$post['time_left']*100;
echo '<td>';
if($post['time'] < time()){}else{
echo '<span class="fr like">'.time_left($post['time']-$time).'</span>';
}
if($post['time'] < time() && $post['time'] != 0){
echo '<a href="?mscrypt&collect='.$post['id'].'" title="Трава созрела, пора собирать..."><img class="btnp fr" width="16" height="16" alt="o" src="/images/icons/tick.png"/></a>';
}
if(!$post['img']){
echo '<a href="./?mscrypt='.$post['id'].'" title="Посадить траву...">
<img src="images/mscrypt/pole/mswer.png" alt="" /></a>
<div><div><div class="fr" style="padding: 5px 0 0 5px; width: 100%;">
<div class="expBorder"><div class="expline2" style="width:0%;"></div></div></div>';
}else{
echo '<img src="images/mscrypt/pole/'.$post['img'].'.png" alt="" />';
if($post['time'] < time()){
echo '<div><div><div class="fr" style="padding: 5px 0 0 5px; width: 100%;">
<div class="expBorder"><div class="expline2" style="width:0%;"></div></div></div>';
}else{
echo '<div><div><div class="fr" style="padding: 5px 0 0 5px; width: 100%;">
<div class="expBorder"><div class="expline2" style="width:'.$timr.'%;"></div></div></div>';
}
echo '</td>';
}
/////////////////////////////////////////////////////////
if($sr == 3)echo '</tr>';
if($sr == 6)echo '</tr>';
if($sr == 9)echo '</tr>';
$start++;
}
echo '</table>';
}
echo '<div class="feedbackPanel"><center>
Вы попали на кладбище, тут находиться множество останков погибших зомби, и само здесь процветает волщебная трава за которую дают не только опыт но и золото!
</center></div>';
?>