Файл: test.zfarm.mobi/mystylelipost/linkpostroykiuser.php
Строк: 31
<?php
/////////////////////////
/*
Author MyStyle ZomBi.Biz
Год 2013 Права предоставлены автору Шехову Виталию Александровичу
http://vk.com/online_user
*/
/////////////////////////
if(isset($_GET['linkpostroykiusergood']) && num($_GET['linkpostroykiusergood'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_postroyki` WHERE `id` = '".num($_GET['linkpostroykiusergood'])."'"),0)!=0){
$post = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_postroyki` WHERE `id` = '".num($_GET['linkpostroykiusergood'])."'"));
if($post['id'] == 1) $user_postroyki = $user['postroyki1'];
if($post['id'] == 2) $user_postroyki = $user['postroyki2'];
if($post['id'] == 3) $user_postroyki = $user['postroyki3'];
if($post['id'] == 4) $user_postroyki = $user['postroyki4'];
if($post['id'] == 5) $user_postroyki = $user['postroyki5'];
if($post['id'] == 6) $user_postroyki = $user['postroyki6'];
if($post['id'] == 7) $user_postroyki = $user['postroyki7'];
if($post['id'] == 8) $user_postroyki = $user['postroyki8'];
if($post['id'] == 9) $user_postroyki = $user['postroyki9'];
if($post['id'] == 10) $user_postroyki = $user['postroyki10'];
if($post['id'] == 11) $user_postroyki = $user['postroyki11'];
if($post['id'] == 12) $user_postroyki = $user['postroyki12'];
if($user_postroyki == $post['id']){
///////// Лог Пользователя ///// By MyStyle
$text = '<b>Вы уже купили - ('.$post['name'].')</b>';
$_SESSION['msg'] = $text;
}elseif($user['sunduk1']>=$post['col1'] && $user['sunduk2']>=$post['col2'] && $user['sunduk3']>=$post['col3'] && $user['sunduk4']>=$post['col4'] && $user['sunduk5']>=$post['col5']){
$user_postroyki = 'postroyki'.$post['id'].'';
update_user(''.$user_postroyki.'',$post['id']);
$col1 = $user['sunduk1']-$post['col1'];
$col2 = $user['sunduk2']-$post['col2'];
$col3 = $user['sunduk3']-$post['col3'];
$col4 = $user['sunduk4']-$post['col4'];
$col5 = $user['sunduk5']-$post['col5'];
update_user('sunduk1',$col1);
update_user('sunduk2',$col2);
update_user('sunduk3',$col3);
update_user('sunduk4',$col4);
update_user('sunduk5',$col5);
}else{
///////// Лог Пользователя ///// By MyStyle
$text = '<b>У вас недостаточно ресурсов для постройки ('.$post['name'].')</b>';
$_SESSION['msg'] = $text;
}
header("Location: ?usersunduk");
exit;
}else{
header("Location: ?usersunduk");
exit;
}
?>