battles/hostel_checkpoint.php

24 lines
1.8 KiB
PHP

<?
session_start();
if (empty($_SESSION['uid'])) {
header('Location: index.php');
exit;
}
require_once "functions.php";
$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
$base = [1 => [8, 16, 24, 32], 2 => [15, 30, 45, 60], 3 => [25, 50, 75, 100], 4 => [40, 80, 120, 160]];
if (isset($_POST['act']) && $_POST['act'] == 'pay' && isset($user['id']) && isset($hostel['id'])) {
echo '<fieldset class="hostelClientState">';
echo '<legend>Предварительная оплата</legend>';
echo '<div style="text-align: center;"><p class="NORMAL" style="margin: 5px 0">';
echo 'Аренда оплачена по: <b>' . date('h:i d.m.y', $hostel['time']) . '</b> <small>(' . timeOut($hostel['time'] - time()) . ')</small></p></div>';
echo '<table align="center" class="periods"><caption style="text-align: left;">Выберите срок предоплаты.</caption>
<tbody>
<tr class="caption"><th>Сутки</th><td title="7 дн.">7</td><td title="14 дн.">14</td><td title="21 дн.">21</td><td title="28 дн.">28</td></tr>
<tr class="value"><th>Сумма</th><td title="7 дн."><a href="?pays=1">' . $base[$hostel['type']][0] . '</a></td><td title="14 дн."><a href="?pays=2">' . $base[$hostel['type']][1] . '</a></td><td title="21 дн."><a href="?pays=3">' . $base[$hostel['type']][2] . '</a></td><td title="28 дн."><a href="?pays=4">' . $base[$hostel['type']][3] . '</a></td></tr>
</tbody>
</table>
<div style="color: red; font-size: 9px; padding-top: 3px;"><b>Внимание!</b> При расторжении договора или смене тарифа, внесенная плата не возвращается</div></fieldset></div>';
}