Файл: system/up.php
Строк: 90
<?php
require_once('sys.php');
if ($user) {
echo '<div class="foot">';
if ($set['start'] == 12) {
echo '<a href="/menu.php">';
}
echo '<b><span style="color: #ffd555;"><small>' . $set['mesto'] . '</small></span></b></a><span style="float: right;">' . $icon_mail . ' <a href=""><img src="/images/icons/refresh.png" width="18px" height="18px" alt="Обновить"></a></span></div><div class="main">';
$level = file('data/lvl.dat');
if ($set['lvl'] < 220) {
$exp = _NumFilter($level[$set['lvl'] + 1]);
} else {
$exp = FALSE;
}
if ($set['exp'] >= $exp) {
$exp_lvl = $set['exp'] - $exp;
mysql_query("UPDATE `user_set` SET `lvl`=`lvl`+'1', `exp`='" . $exp_lvl . "', `hp`='" . $set['max_hp'] . "', `mp`='" . $set['max_mp'] . "', `udar`='" . $set['max_udar'] . "', `skill`=`skill`+'5' WHERE `id`='" . $user_id . "' LIMIT 1");
mysql_query("UPDATE `user_superunit` SET `ataka`=`ataka`+'5', `zaschita`=`zaschita`+'5' WHERE `id_unit`='1' AND `id_user`='" . $user_id . "' LIMIT 1");
mysql_query("UPDATE `user_superunit` SET `ataka`=`ataka`+'5', `zaschita`=`zaschita`+'5' WHERE `id_unit`='2' AND `id_user`='" . $user_id . "' LIMIT 1");
mysql_query("UPDATE `user_superunit` SET `ataka`=`ataka`+'5', `zaschita`=`zaschita`+'5' WHERE `id_unit`='3' AND `id_user`='" . $user_id . "' LIMIT 1");
mysql_query("UPDATE `user_superunit` SET `ataka`=`ataka`+'0', `zaschita`=`zaschita`+'5' WHERE `id_unit`='4' AND `id_user`='" . $user_id . "' LIMIT 1");
mysql_query("UPDATE `user_superunit` SET `ataka`=`ataka`+'0', `zaschita`=`zaschita`+'5' WHERE `id_unit`='5' AND `id_user`='" . $user_id . "' LIMIT 1");
mysql_query("UPDATE `user_superunit` SET `ataka`=`ataka`+'5', `zaschita`=`zaschita`+'5' WHERE `id_unit`='6' AND `id_user`='" . $user_id . "' LIMIT 1");
mysql_query("UPDATE `user_superunit` SET `ataka`=`ataka`+'5', `zaschita`=`zaschita`+'0' WHERE `id_unit`='7' AND `id_user`='" . $user_id . "' LIMIT 1");
mysql_query("UPDATE `user_superunit` SET `ataka`=`ataka`+'5', `zaschita`=`zaschita`+'0' WHERE `id_unit`='8' AND `id_user`='" . $user_id . "' LIMIT 1");
mysql_query("UPDATE `user_superunit` SET `ataka`=`ataka`+'5', `zaschita`=`zaschita`+'5' WHERE `id_unit`='9' AND `id_user`='" . $user_id . "' LIMIT 1");
mysql_query("UPDATE `user_superunit` SET `ataka`=`ataka`+'50', `zaschita`=`zaschita`+'50' WHERE `id_unit`='10' AND `id_user`='" . $user_id . "' LIMIT 1");
$_SESSION['light'] = '<span class="quality-4">Вы получили новый уровень!</span></div><div class="mini-line"></div>';
}
$set = _FetchAssoc("SELECT * FROM `user_set` WHERE `id`='" . $user_id . "'");
?><div class="exp_bar"><div class="progress" style="width: <?= round(100 / ($exp / ($set['exp']))) ?>%"></div></div><?
if ($set['skill'] > 0) {
$skill_kol = '#ff3434';
} else {
$skill_kol = '#3c3';
}
echo '<table width="100%"><tr><td width="33%" align="center"><a href="/bank.php"><div class="head"><img src="/images/icons/baks.png" alt="Бакс"/><b><span style="color: #9c9;"><small> ' . number_format($set['baks']) . '</b></span></small></div></a></td><td width="33%" align="center"><a href="/bank.php?case=donat"><div class="head"><img src="/images/icons/gold.png" alt="Золото"/><b><span style="color: #ffd555;"><small> ' . number_format($set['gold']) . '</b></span></small></div></a></td><td width="33%" align="center"><a href="/pers.php?case=raspred"><div class="head"><img src="/images/icons/lvl.png" alt="*"/><b><span style="color: ' . $skill_kol . ';"><small> ' . $set['lvl'] . '</b></span></small></div></a></td><tr><td width="33%" align="center"><a href="/hosp.php"><div class="head"><img src="/images/icons/hp.png" alt="*"><b><span style="color: #c66;"><small> ' . $set['hp'] . '</b></span></small></div></a></td><td width="33%" align="center"><a href="/mission.php"><div class="head"><img src="/images/icons/mp.png" alt="*"><b><span style="color: #9cc;"><small> ' . $set['mp'] . '</b></span></small></div></a></td><td width="33%" align="center"><a href="/voina.php?case=vrag"><div class="head"><img src="/images/icons/ataka.png" alt="*"><b><span style="color: #ffffff;"><small> ' . $set['udar'] . '</b></span></small></div></a></td></tr></table><div class="mini-line"></div></div>';
} else {
echo '<div class="foot center"><b style="color: #999;">«' . $game . '»</b></div><div class="line"></div>';
}
if (isset($_SESSION['err'])) {
echo '<div class="error center"><img src="/images/icons/error.png"> ' . $_SESSION['err'] . '</div>';
$_SESSION['err'] = NULL;
}
if (isset($_SESSION['ok'])) {
echo '<div class="ok center"><img src="/images/icons/ok.png"> ' . $_SESSION['ok'] . '</div>';
$_SESSION['ok'] = NULL;
}
if (isset($_SESSION['light'])) {
echo '<div class="block_light center">' . $_SESSION['light'] . '</div>';
$_SESSION['light'] = NULL;
}
?>