2020-10-30 01:30:05 +02:00
< ? php
2022-01-27 01:15:33 +02:00
use Battles\User , Battles\Database\Db ;
2020-09-30 15:52:51 +03:00
require_once " functions.php " ;
2022-01-27 01:15:33 +02:00
$hostel = Db :: getInstance () -> execute ( 'select id, time, type from hostel where uid = ?' , User :: getInstance () -> getId ());
2020-09-30 22:12:34 +03:00
$base = [ 1 => [ 8 , 16 , 24 , 32 ], 2 => [ 15 , 30 , 45 , 60 ], 3 => [ 25 , 50 , 75 , 100 ], 4 => [ 40 , 80 , 120 , 160 ]];
2018-01-28 18:40:49 +02:00
2022-01-27 01:15:33 +02:00
if ( isset ( $_POST [ 'act' ]) && $_POST [ 'act' ] == 'pay' && isset ( $user [ 'id' ]) && ! empty ( $hostel -> fetchColumn ())) {
2018-01-28 18:40:49 +02:00
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">' ;
2022-01-27 01:15:33 +02:00
echo 'Аренда оплачена по: <b>' . date ( 'h:i d.m.y' , $hostel -> fetchColumn ( 1 )) . '</b> <small>(' . timeOut ( $hostel -> fetchColumn ( 1 ) - time ()) . ')</small></p></div>' ;
2018-01-28 18:40:49 +02:00
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>
2022-01-27 01:15:33 +02:00
<tr class="value"><th>Сумма</th><td title="7 дн."><a href="?pays=1">' . $base [ $hostel -> fetchColumn ( 2 )][ 0 ] . '</a></td><td title="14 дн."><a href="?pays=2">' . $base [ $hostel -> fetchColumn ( 2 )][ 1 ] . '</a></td><td title="21 дн."><a href="?pays=3">' . $base [ $hostel -> fetchColumn ( 2 )][ 2 ] . '</a></td><td title="28 дн."><a href="?pays=4">' . $base [ $hostel -> fetchColumn ( 2 )][ 3 ] . '</a></td></tr>
2018-01-28 18:40:49 +02:00
</tbody>
</table>
<div style="color: red; font-size: 9px; padding-top: 3px;"><b>Внимание!</b> При расторжении договора или смене тарифа, внесенная плата не возвращается</div></fieldset></div>' ;
}