another final version

This commit is contained in:
lopar 2019-01-16 00:03:58 +02:00
parent ecaaede66b
commit 5ca0b2d397
1 changed files with 14 additions and 22 deletions

View File

@ -13,6 +13,7 @@ if ($user['battle'] != 0) {
}
$status = 'Внимание! Моментальная оплата без подтверждения!';
$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
function setProfession($name, $type, $needMoney, $needLevel)
{
@ -30,15 +31,14 @@ function setProfession($name, $type, $needMoney, $needLevel)
return 'Вы получили профессию!';
}
if ($_POST['smith']) $status = setProfession('smith',1,300,3);
if ($_POST['mercenary']) $status = setProfession('mercenary',2,700,5);
if ($_POST['medic']) $status = setProfession('medic',2,700,5);
if ($get == 'smith') $status = setProfession('smith', 1, 300, 3);
if ($get == 'mercenary') $status = setProfession('mercenary', 2, 700, 5);
if ($get == 'medic') $status = setProfession('medic', 2, 700, 5);
if ($_GET['exit'] == 1) {
if ($get == 'exit') {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = ?i AND `online`.`id` = ?i', $user['id'], $user['id']);
header('Location: city.php');
}
?>
<!DOCTYPE html>
<html>
@ -49,19 +49,15 @@ if ($_GET['exit'] == 1) {
</head>
<body>
<div class="topRoomButtons">
<form action="city.php?act=go&level=2702" method=POST>
<input type="button" class="btns" value="Обновить" onclick="location.href='main.php';"/>
<input type="button" class="btns button-route" value="Вернуться" onclick="location.href='?exit=1';"/>
</form>
<button onclick="location.href='main.php'">Обновить</button>
<button onclick="location.href='?exit'">Вернуться</button>
</div>
<h1>Академия</h1>
<div><?php if (!empty($status)) err($status); ?></div>
<div class="appblock">
<span class="legend">Наёмник</span>
<?php if (empty($user['prof2'])): ?>
<form method="post">
<input type="submit" name="mercenary" value="Изучить профессию" title="Изучить профессию">
</form>
<button onclick="location.href='?mercenary'">Изучить профессию</button>
<?php else: ?>
<button style="color: darkred" disabled>У вас уже есть боевая профессия</button>
<?php endif; ?>
@ -75,9 +71,7 @@ if ($_GET['exit'] == 1) {
<div class="appblock">
<span class="legend">Лекарь</span>
<?php if (empty($user['prof2'])): ?>
<form method="post">
<input type="submit" name="medic" value="Изучить профессию" title="Изучить профессию">
</form>
<button onclick="location.href='?medic'">Изучить профессию</button>
<?php else: ?>
<button style="color: darkred" disabled>У вас уже есть боевая профессия</button>
<?php endif; ?>
@ -100,8 +94,8 @@ if ($_GET['exit'] == 1) {
<div class="appblock">
<span class="legend">Кузнец</span>
<button disabled>Недоступно</button>
<span class="wrap">Цена<span class="num">300</span></span>
<span class="wrap">Уровень персонажа<span class="num">5</span></span>
<span class="wrap">Цена<span class="num">5000</span></span>
<span class="wrap">Уровень персонажа<span class="num">10</span></span>
<span class="wrap">
Кузнец может создавать новые предметы используя расходные материалы. Мирная профессия.
</span>
@ -109,9 +103,7 @@ if ($_GET['exit'] == 1) {
<div class="appblock">
<span class="legend">Оружейник</span>
<?php if (empty($user['prof1'])): ?>
<form method="post">
<input type="submit" name="smith" value="Изучить профессию" title="Изучить профессию">
</form>
<button onclick="location.href='?smith'">Изучить профессию</button>
<?php else: ?>
<button style="color: darkred" disabled>У вас уже есть мирная профессия</button>
<?php endif; ?>
@ -124,8 +116,8 @@ if ($_GET['exit'] == 1) {
<div class="appblock">
<span class="legend">Алхимик</span>
<button disabled>Недоступно</button>
<span class="wrap">Цена<span class="num">500</span></span>
<span class="wrap">Уровень персонажа<span class="num">8</span></span>
<span class="wrap">Цена<span class="num">5000</span></span>
<span class="wrap">Уровень персонажа<span class="num">10</span></span>
<span class="wrap">
Алхимик может создавать новые зелья используя расходные материалы. Мирная профессия.
</span>