2018-01-28 18:40:49 +02:00
< ?
session_start ();
2020-09-30 15:58:44 +03:00
if ( empty ( $_SESSION [ 'uid' ])) { header ( 'Location: index.php' ); exit ; }
2020-09-30 15:52:51 +03:00
require_once " functions.php " ;
2018-01-28 18:40:49 +02:00
$hostel = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `hostel` WHERE `uid` = "' . $user [ 'id' ] . '" LIMIT 1' ));
$base = array ( 1 => array ( 8 , 16 , 24 , 32 ), 2 => array ( 15 , 30 , 45 , 60 ), 3 => array ( 25 , 50 , 75 , 100 ), 4 => array ( 40 , 80 , 120 , 160 ));
if ( isset ( $_POST [ 'act' ]) && $_POST [ 'act' ] == 'pay' ) {
if ( isset ( $user [ 'id' ]) && isset ( $hostel [ 'id' ])) {
echo '<fieldset class="hostelClientState">' ;
echo '<legend>Предварительная оплата</legend>' ;
2020-09-18 02:06:32 +03:00
echo '<div style="text-align: center;"><p class="NORMAL" style="margin: 5px 0">' ;
2018-01-28 18:40:49 +02:00
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>' ;
}
}