Файл: test.zfarm.mobi/mystylepostr/3.php
Строк: 116
<?php
/////////////////////////
/*
Author MyStyle ZomBi.Biz
Год 2013 Права предоставлены автору Шехову Виталию Александровичу
http://vk.com/online_user
*/
/////////////////////////
if($user['postroyki3'] == 3){}else{
header("Location: ./");
exit;
}
echo '<div class="feedbackPanel">Торговец за монеты</div>';
echo url('btn', '?linkusersklad&veshi', 'Подарить коллекции');
/////////// выводим функции /////////////////////////////
if(isset($_POST['id_zomb']))
{
if (strlen2($_POST['id_zomb'])<1)err_game('Пустой ввод данных.');
else
{
$post = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_user` WHERE `id` = '".num($_POST['id_zomb'])."'"));
$mat = num($_POST['id_mat']);
$col = num($_POST['id_col']);
$col2 = num($_POST['id_col'])*1000;
if($mat == 1) $vers = $user['sunduk1'];
if($mat == 2) $vers = $user['sunduk2'];
if($mat == 3) $vers = $user['sunduk3'];
if($mat == 4) $vers = $user['sunduk4'];
if($mat == 5) $vers = $user['sunduk5'];
if($mat == 1) $ver1 = 'Брус';
if($mat == 2) $ver1 = 'Любви';
if($mat == 3) $ver1 = 'Золото';
if($mat == 4) $ver1 = 'Мрамор';
if($mat == 5) $ver1 = 'Камень';
if($mat == 1) $ver = 'sunduk1';
if($mat == 2) $ver = 'sunduk2';
if($mat == 3) $ver = 'sunduk3';
if($mat == 4) $ver = 'sunduk4';
if($mat == 5) $ver = 'sunduk5';
if($vers >= $col && $user['money'] >= $col2){
/////////////////////////////////////////////
$money = $user['money']-$col2;
$matts = $vers-$col;
$matuser = $post[''.$ver.'']+$col;
mysql_query("UPDATE `mystyle_user` SET `".$ver."` = '".$matts."', `money` = '".$money."' WHERE `id` = '".$user['id']."' LIMIT 1");
mysql_query("UPDATE `mystyle_user` SET `".$ver."` = '".$matuser."' WHERE `id` = '".$post['id']."' LIMIT 1");
/////////////////////////////////////////////
$rat = 100;
$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;
$rating = $user['rating']+$rat_user;
mysql_query("UPDATE `mystyle_user` SET `rating` = '".$rating."' WHERE `id` = '".num($user['id'])."'");
$text = 'Отправлено! + '.$rat_user.' к вашему опыту. ';
$_SESSION['msg'] = $text;
///////////////////////////////////////////////////////
$msg1 = 'Доброго Вам времени суток!<br />
Я вам отправил материал <span class="level">'.$ver1.'</span> + <span class="like">'.$col.'</span>';
mysql_query("INSERT INTO `mystyle_mail` SET `id_user` = '".num($_POST['id_zomb'])."', `id_kont` = '".$user['id']."', `msg` = '".my_esc($msg1)."', `time` = '$time', `type` = 'to'");
mysql_query("INSERT INTO `mystyle_mail` SET `id_user` = '".$user['id']."', `id_kont` = '".num($_POST['id_zomb'])."', `msg` = '".my_esc($msg1)."', `time` = '$time', `type` = 'at', `read` = '1'");
header("Location: ./?link3");
exit;
}else{
$text = 'У вас не хватает материала или монет.';
$_SESSION['msg'] = $text;
header("Location: ./?link3");
exit;
}
}
}
/////////////////////////////////////////////////////////
echo '<div><div><table class="center pt6 pb6" style="margin:0 auto; width: 80%;"><tr class="whiteBoldLink textshadow">
<td><img width="25" height="25" src="images/who_postroyki/s_woodblocks.png" alt="" /></td>
<td><img width="25" height="25" src="images/who_postroyki/s_bamboo.png" alt="" /></td>
<td><img width="25" height="25" src="images/who_postroyki/brain.png" alt="" /></td>
<td><img width="25" height="25" src="images/who_postroyki/s_blackm.png" alt="" /></td>
<td><img width="25" height="25" src="images/who_postroyki/stone3.png" alt="" /></td>
</tr>
<tr class="whiteBoldLink textshadow">
<td>Брус</td>
<td>Любви</td>
<td>Золото</td>
<td>Мрамор</td>
<td>Камень</td>
</tr>';
echo '<tr class="blueSecColor textshadow">
<td>'.$user['sunduk1'].'</td>
<td>'.$user['sunduk2'].'</td>
<td>'.$user['sunduk3'].'</td>
<td>'.$user['sunduk4'].'</td>
<td>'.$user['sunduk5'].'</td>
</tr>';
echo '</table></div></div></div>';
echo '<center>';
echo '<div class="emptyPanel">';
echo '<form method="post" id="id1"><div style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;overflow:hidden"></div>';
echo '<div class="pt12"><label for="pass">Выберите материал</label><span class="major">*</span></div>
<div>';
echo '<select class="btnp" name="id_mat">';
echo '<option class="major" value="1">Брус</option>';
echo '<option class="major" value="2">Любви</option>';
echo '<option class="major" value="3">Золото</option>';
echo '<option class="major" value="4">Мрамор</option>';
echo '<option class="major" value="5">Камень</option>';
echo '</select></div>';
echo '<div class="pt12"><label for="pass">Выберите количество</label><span class="major">*</span></div>
<div>';
echo '<select class="btnp" name="id_col">';
echo '<option class="major" value="1">1 - 1000 монет</option>';
echo '<option class="major" value="3">3 - 3000 монет</option>';
echo '<option class="major" value="5">5 - 5000 монет</option>';
echo '<option class="major" value="10">10 - 10000 монет</option>';
echo '<option class="major" value="20">20 - 20000 монет</option>';
echo '<option class="major" value="40">40 - 40000 монет</option>';
echo '<option class="major" value="60">60 - 60000 монет</option>';
echo '<option class="major" value="80">80 - 80000 монет</option>';
echo '<option class="major" value="100">100 - 100000 монет</option>';
echo '</select></div>';
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_friends` WHERE `user` = '".$user['id']."' ORDER BY `id` DESC"),0);
echo '<div class="pt12"><label for="pass">Выберите зомбяка</label><span class="major">*</span> ('.$k_post.')</div>
<div><select class="btnp" name="id_zomb">';
if($k_post == 0)
{
echo '<option value="">У вас нет друзей</option>';
}
$q=mysql_query("SELECT * FROM `mystyle_friends` WHERE `user` = '$user[id]'");
while($post=mysql_fetch_array($q))
{
$post_lit = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_user` WHERE `id` = '$post[ank]'"));
echo '<option class="major" value="'.$post_lit['id'].'">'.$post_lit['nick'].'</option>';
}
echo '</select></div>';
echo '<div class="pt12"><input type="submit" value="Готово!" class="btn bold" style="width: 100%; font-size: 16px;"/></div>
</form></div></div>';
echo '</center>';
?>