Файл: LinkMod/LinkBaby.php
Строк: 131
<?php
if(isset($_GET['Final'])){
echo '
<div class="feedbackPanel textshadow">
<div class="whiteBoldLink textshadow center">Ты занял '.$baby['mesto'].' место на доске почета.</div>
<div>
Премия:
</div>
+<span class="title"><span class="expirience nobr textshadow">
<img height="16" width="16" src="images/icons/level.png"> <span>'.$baby['plus_rating'].'</span>
</span></span>
+<span><span class="money nobr textshadow">
<img width="16" height="16" src="images/icons/ruby.png" alt=""/>
<span>'.$baby['plus_rubies'].'</span></span></span>
<div class="pt12">
<a class="btn" href="?LinkBaby">Продолжить</a>
</div>
</div>
</div>';
}
if(isset($_GET['LinkStart'])){
$rating = rand(1,10);
$rubies = rand(1,3);
/////////////////////////
$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;
$rat_user = $taty+$dom+$bone;
/////////////////////////
if($baby['col'] == 0){
mysql_query("UPDATE `mystyle_baby` SET `plus_rubies` = '$rubies', `plus_rating` = '$rat_user', `rating` = '".($baby['rating']+$rating)."', `time` = '".($time+1800)."', `col` = '".($baby['col']+3)."' WHERE `user` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `mystyle_user` SET `linkbaby` = '".($user['linkbaby']+1)."',`ruby` = '".($user['ruby']+$rubies)."', `rating` = '".($user['rating']+$rat_user)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `mystyle_game4` SET `col2` = '0', `col` = '3' WHERE `user` = '$user[id]' LIMIT 1");
if($ver4['col2'] == $ver4['col']){
mysql_query("UPDATE `mystyle_zadaniya_user` SET `type` = 'yes' WHERE `limit` = '4' AND `user` = '".$user['id']."'");
}else{
$stc = 1;
mysql_query("UPDATE `mystyle_zadaniya_user` SET `col2` = '".($ver4['col2']+$stc)."' WHERE `limit` = '4' AND `user` = '".$user['id']."'");
}
header("Location: ?LinkBaby&Final");
exit;
}elseif($baby['time'] < $time){
if($baby['list'] == 1){
mysql_query("UPDATE `mystyle_baby` SET `time` = '$time', `rating` = '".($baby['rating']+$rating)."', `time` = '".($time+600)."', `list` = '".($baby['list']+4)."', `col` = '".($baby['col']-1)."' WHERE `user` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `mystyle_game4` SET `col2` = '".($user_v4['col2']+1)."' WHERE `user` = '$user[id]' LIMIT 1");
}else{
mysql_query("UPDATE `mystyle_baby` SET `rating` = '".($baby['rating']+$rating)."', `list` = '".($baby['list']-1)."' WHERE `user` = '$user[id]' LIMIT 1");
}
}else{
}///time
header("Location: ?LinkBaby");
exit;
}
if($baby['col'] == 1)$name = 'Кабинете';
if($baby['col'] == 2)$name = 'Цеху';
if($baby['col'] == 3)$name = 'Лесу';
if($baby['col'] == 0)$name = 'Заберите премию';
echo '<div class="whiteBoldLink textshadow center pt12 pb6">Работа в, '.$name.'</div>';
echo '<div class="body feedbackPanel textshadow">
Сейчас ты на почетном<strong><span>'.$baby['mesto'].'</span></strong> месте.
</div>';
if($baby['col'] == 0){
echo '<a class="btnm center whiteBoldLink" href="?LinkBaby&LinkStart">
<span>Забрать премию</span>
</a>';
}elseif($baby['time'] < time()){
if($baby['list'] == 5){
echo '<a class="btnm center whiteBoldLink" href="?LinkBaby&LinkStart">
<span>Работать в поте лица</span>
</a>';
}elseif($baby['list'] == 4){
echo '<a class="btnm center whiteBoldLink" href="?LinkBaby&LinkStart">
<span>Работать</span>
</a>';
}elseif($baby['list'] == 3){
echo '<a class="btnm center whiteBoldLink" href="?LinkBaby&LinkStart">
<span>Трудиться</span>
</a>';
}elseif($baby['list'] == 2){
echo '<a class="btnm center whiteBoldLink" href="?LinkBaby&LinkStart">
<span>Трудиться упорнее</span>
</a>';
}elseif($baby['list'] == 1){
echo '<a class="btnm center whiteBoldLink" href="?LinkBaby&LinkStart">
<span>Вкалывать</span>
</a>';
}}else{
echo '<a class="btnm center whiteBoldLink" href="index.php?">
<span>Работать через '.time_left($baby['time']-$time).'</span>
</a>';
}
echo '<div>
<div>
<table class="center pt6 pb6" style="margin:0 auto; width: 80%;">
<tr class="whiteBoldLink textshadow">
<td>Место</td>
<td>Имя</td>
<td>Рейтинг</td>
</tr>
<tr class="blueSecColor textshadow">';
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_baby` ORDER BY `rating` DESC"),0);
if ($k_post==0)
{
echo "Пусто!";
}
$k_page=k_page($k_post,$user['set']);
$page=page($k_page);
$start=$user['set']*$page-$user['set'];
$q=mysql_query("SELECT * FROM `mystyle_baby` ORDER BY `rating` DESC LIMIT $start, $user[set]");
echo '<ul>';
while($post=mysql_fetch_array($q))
{
$sr = $start+1;
if($post['user'] == $user['id']){
mysql_query("UPDATE `mystyle_baby` SET `mesto` = '$sr' WHERE `user` = '$user[id]' LIMIT 1");
}else{
}
echo '<tr class="blueSecColor textshadow">
<td>'.$sr.'</td>
<td>
<span class="nobr">';
if($post['user'] == $user['id']){
echo '<b>'.users($post['user']).'</b>';
}else{
echo ''.users($post['user']).'';
}
echo '</span>
</td>
<td>';
if($post['rating']){
echo ''.$post['rating'].'';
}else{ echo '0'; }
echo '</td>
</tr>';
$start++;
}
echo '</table></div></div></div>';
echo '<div class="center pt12 pb18">';
if ($k_page>1)str("?LinkBaby&",$k_page,$page);
echo '</div></div></div>';
?>