Файл: test.zfarm.mobi/mystylelipost/linkdecor.php
Строк: 64
<?php
/////////////////////////
/*
Author MyStyle ZomBi.Biz
Год 2013 Права предоставлены автору Шехову Виталию Александровичу
http://vk.com/online_user
*/
/////////////////////////
what(0, 'LinkResursy');
if(isset($_GET['linkgood']) && num($_GET['linkgood'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_decor` WHERE `id` = '".num($_GET['linkgood'])."'"),0)!=0){
$fer = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_decor` WHERE `id` = '".num($_GET['linkgood'])."'"));
$need=$fer['machete'];
if($user['machete']>=$need){
$machete = $fer['machete']-1;
$col = $fer['col']-1;
$fer_exp = rand(10,100);
if($_SESSION['training'] == 'zadan')
{
$_SESSION['training'] = 'resyrsy';
}
$text = '+ <b>'.$fer_exp.' опыта</b>. + 1 '.$fer['line'].' в склад.';
$_SESSION['msg'] = $text;
$img = $fer['img'].'.png';
insert_decor('img',$fer['img'],'col',$col,'name',$fer['name'],'who',$fer['who'],'machete',$machete,'line',$fer['line'],'exp',$fer_exp,'user',$user['id']);
$exp = $user['rating']+$fer_exp;
$nimba = $user['machete']-1;
mysql_query("UPDATE `mystyle_user` SET `rating` = '".$exp."', `machete` = '".$nimba."' WHERE `id` = '".$user['id']."' LIMIT 1");
$sclad = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_sklad` WHERE `name` = '".$fer['who']."' AND `user` = '".$user['id']."'"));
if($fer['who'] == $sclad['name']){
$vol = $sclad['col']+1;
update_sclad('id',$sclad['id'],'col',$vol);
}else{
if($fer['line'] == 'брус.')$img = 'wood3_a.png';
if($fer['line'] == 'камн.')$img = 'stone3.png';
$money = $fer['exp']/2;
insert_sclad('user',$user['id'],'name',$fer['who'],'img',$img,'money',$money,'type',3,'col',1);
}
header("Location: ?linkuserresursy");
exit;
}else{
err_machete($need-$user['machete']);
}
}
echo '<div>
<div>
<table class="center pt6 pb6" style="margin:0 auto; width: 80%;">
<tr class="whiteBoldLink textshadow">
<td>Мачете</td>
<td>Ресурс</td>
<td>Название</td>
<td>Дает</td>
<td>Дейс.</td>
</tr>
<tr class="blueSecColor textshadow">';
$user['set'] = 5;
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_decor`"),0);
if ($k_post==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_decor` LIMIT $start, $user[set]");
echo '<ul>';
while($post=mysql_fetch_array($q))
{
$sr = $start+1;
echo '<tr class="blueSecColor textshadow">
<td>'.$post['machete'].'</td>
<td><img width="50" height="70" src="images/decor/'.$post['img'].'.png" alt="'.$post['name'].'" /></td>
<td>
<span class="nobr">'.$post['who'].'</span>
</td>
<td>'.$post['col'].' '.$post['line'].'</td>
</td>
<td><a href="?linkresursy&linkgood='.$post['id'].'">'.$post['name'].'</a></td>
</tr>';
$start++;
}
echo '</table></div></div></div>';
echo '<div class="center pt12 pb18">';
if ($k_page>1)str("?linkresursy&",$k_page,$page);
echo '</div></div></div><div class="feedbackPanel"><img width="50" height="50" src="images/zombi/anti_machete.png" />
- Мачете: приспособление для рубки ресурсов.<br /> Сейчас у вас их '.$user['machete'].'<br /><br /><a href="?linkusermachete" class="btnp">Купить мачете.</a></div>';
?>