Файл: LinkUser/LinkProgulka.php
Строк: 120
<?php
/**
* @author MyStyle
* @copyright 2013
*/
if(isset($_GET['LinkUserWalkOk'])){
if ($user_walk['time'] < time())
{
if($user_walk['type'] == 'no'){
if($user_walk['money']){
mysql_query("UPDATE `mystyle_user` SET `ruby` = '".($user['ruby']+$user_walk['money'])."' WHERE `id` = '$user[id]'");
}else{
}
mysql_query("UPDATE `mystyle_user` SET `rating` = '".($user['rating']+$user_walk['rating'])."' WHERE `id` = '$user[id]'");
mysql_query("DELETE FROM `mystyle_walk` WHERE `user` = '".$user['id']."'");
}else{
header('Location: ?LinkWalk&walks');
exit;
}
echo '<div><div class="emptyPanel whiteLink">';
if($user_walk['type'] == 'no'){
echo 'Опыт + <span><span class="expirience nobr textshadow"><img height="16" width="16" src="images/icons/level.png"> <span>'.$user_walk['rating'].'</span></span></span>';
if($user_walk['money']){
echo '<div><span>Ты заработал <span><span class="money nobr textshadow"><img width="16" height="16" src="images/icons/ruby.png" alt=""/> <span>'.$user_walk['money'].'</span></span>.</span>
<span></span></div><div style="clear:both;">';
}else{
echo '<div><span>Ты много шланговал поэтому ничего не заработал.</span>
<span></span></div><div style="clear:both;">';
}
}
echo '</div></div>
<a class="btn pt6" href="?LinkWalk"><img width="16" height="16" src="images/icons/left.png" alt="назад"/>
На заработки</a></div>';
}
}
if($user_walk['type'] == 'no'){
echo '<div><div class="frame center"><span class="whiteBoldLink">Вы отработали положенное время.</span><br/></div>
<a class="btn pt6 center" href="?LinkWalk&LinkUserWalkOk">Получить зарплату</a></div>';
}elseif(isset($_GET['walks'])){
if ($user_walk['time'] < time())
{
echo '<div><div class="frame center">На работе вы можете заработать ценные вещи.</div>
<div><div align="center"><img alt="o" width="120" height="60" src="images/park.jpg"/></div>
<div class="btn"><a class="whiteBoldLink" href="?LinkWalk&LinkUserWalk1"><div><span>Собирать мусор в парке</span>
<span class="fr">1 час</span></div></a></div></div><div>
<div align="center"><img alt="o" width="120" height="60" src="images/opushka.jpg"/>
</div><div class="btn"><a class="whiteBoldLink" href="?LinkWalk&LinkUserWalk2"><div><span>Валить деревья</span>
<span class="fr">2 часа</span></div></a></div></div></div>';
}else{
echo '<div><div class="frame center">
<span class="whiteBoldLink">Ваша собака гуляет.</span><br/>
<span>До конца прогулки осталось: '.time_left($user_walk['time']-$time).'</span></div></div>';
}
echo '<div class="emptyPanel">Чем дольше работаете, тем больше шанс найти ценные вещи.<br/>
</div>';
}elseif(isset($_GET['LinkUserWalk1'])){
if ($user_walk['time'] < time())
{
$time = 3600;
$ti = rand(1,4);
if($ti == 2){
$money = rand(1,10);
}
/////////////////////////
$taty = rand(10,100);
if(isset($user['dom_exp']))$dom = (($taty/100)*$user['dom_exp']);else$dom = 1;
if(isset($user['dom_bone']))$bone = (($taty/100)*$user['bone_exp']);else$bone = 1;
$raty = $taty+$dom+$bone;
/////////////////////////
mysql_query("INSERT INTO `mystyle_walk` SET `time` = '".time()."'+$time, `rating` = '".$raty."', `user` = '".$user['id']."', `money` = '".$money."'");
header('Location: ?LinkWalk&walks');
exit;
}else{
header('Location: ?LinkWalk&walks');
exit;
}
}elseif(isset($_GET['LinkUserWalk2'])){
if ($user_walk['time'] < time())
{
$time = 7200;
$ti = rand(1,4);
if($ti == 2){
$money = rand(1,25);
}
/////////////////////////
$taty = rand(10,100);
if(isset($user['dom_exp']))$dom = (($taty/100)*$user['dom_exp']);else$dom = 1;
if(isset($user['dom_bone']))$bone = (($taty/100)*$user['bone_exp']);else$bone = 1;
$raty = $taty+$dom+$bone;
/////////////////////////
mysql_query("INSERT INTO `mystyle_walk` SET `time` = '".time()."'+$time, `rating` = '".$raty."', `user` = '".$user['id']."', `money` = '".$money."'");
header('Location: ?LinkWalk&walks');
exit;
}else{
header('Location: ?LinkWalk&walks');
exit;
}
}else{
header('Location: ?LinkWalk&walks');
exit;
}
?>