$session = Yii::$app->session;
$session['booking'] = $order_id;
$session['booking_liqpay'] = $order_id.mt_rand(9999,999999999);
<?php Pjax::begin(['id' => 'booking-form']) ?>
<?php if (!\app\models\Order::checkSessionOrder()): ?>
<?= BookingWidget::widget(); ?>
<?php Pjax::begin(['id' => 'datepicker-widget']); ?>
<div class="col-lg-6">
<?php
echo '<label class="control-label">Выберите дату</label>';
echo DatePicker::widget([
'model' => $time_table,
'attribute' => 'date_start',
'attribute2' => 'date_end',
'options' => ['placeholder' => 'Дата заезда'],
'options2' => ['placeholder' => 'Дата отъезда'],
'type' => DatePicker::TYPE_RANGE,
'form' => $form,
'separator' => '-',
'language' => Yii::$app->language == 'ua' ? 'uk' : Yii::$app->language,
'pluginOptions' => [
'datesDisabled' => $booked_days,
'format' => 'yyyy-mm-dd',
'autoclose' => true,
]
]);
?>
<div id="result_availability">
</div>
</div>
<?php Pjax::end(); ?>
<?php else: ?>
<div class="col-lg-12">
<h2>Вы успешно забронировали номер</h2>
<?= Html::Button('Оплатить', ['class' => 'btn btn-success btn-booking-pay', 'style' => 'margin-right:20px;display:inline-block;']); ?>
<?= Html::Button('Отменить бронь', ['class' => 'btn btn-danger btn-booking-cancel', 'style' => 'margin-right:20px;display:inline-block;']); ?>
</div>
<?php endif; ?>
<?php Pjax::end() ?>
$session = Yii::$app->session;
if(!empty($session['booking'])){
return true;
}
return false;
if (!\app\models\Order::checkSessionOrder()):
if (false):
<?php
use app\models\SmapPages;
use app\widgets\BookingWidget\BookingWidget;
use yii\helpers\Html;
use yii\widgets\Pjax;
use kartik\date\DatePicker;
use app\widgets\BannerWidget\BannerWidget;
/* @var $this yii\web\View */
$this->title = 'My Yii Application';
?>
<div id="liqpay_checkout"></div>
<script src="//static.liqpay.com/libjs/checkout.js" async></script>
<div class="container">
<div class="row margin-bottom-60 row about" id="about">
<div class="col-md-4 about-main">
<?= SmapPages::getSmapBlock('about')->name; ?>
<?= SmapPages::getSmapBlock('about')->smap_text; ?>
</div>
<div class="col-md-8 about-slider">
<div class="carousel slide carousel-v1" id="myCarousel">
<div class="carousel-inner">
<?= BannerWidget::widget(['id_pos' => 12]); ?>
</div>
<div class="carousel-arrow">
<a data-slide="prev" href="portfolio_item.html#myCarousel" class="left carousel-control">
<i class="fa fa-angle-left"></i>
</a>
<a data-slide="next" href="portfolio_item.html#myCarousel" class="right carousel-control">
<i class="fa fa-angle-right"></i>
</a>
</div>
</div>
</div>
</div><!--/end row-->
</div>
<div class="line-blocks line-blocks-about"></div>
<div class="container">
<div class="row margin-bottom-60 row restaurant" id="restaurant">
<div class="col-md-4 restaurant-main">
<?= Html::img('@web/images/restaurant.png', ['class' => 'smap_img']) ?>
<?= SmapPages::getSmapBlock('restaurant')->smap_text; ?>
</div>
<div class="col-md-8 restaurant-slider">
<div class="carousel slide carousel-v1" id="myCarousel1">
<div class="carousel-inner">
<?= BannerWidget::widget(['id_pos' => 13]); ?>
</div>
<div class="carousel-arrow">
<a data-slide="prev" href="portfolio_item.html#myCarousel1" class="left carousel-control">
<i class="fa fa-angle-left"></i>
</a>
<a data-slide="next" href="portfolio_item.html#myCarousel1" class="right carousel-control">
<i class="fa fa-angle-right"></i>
</a>
</div>
</div>
</div>
</div><!--/end row-->
</div>
<div class="line-blocks line-blocks-hotel"></div>
<div class="container">
<div class="row margin-bottom-60 row hotel" id="hotel">
<div class="col-md-8 hotel-slider">
<div class="carousel slide carousel-v1" id="myCarousel2">
<div class="carousel-inner">
<?= BannerWidget::widget(['id_pos' => 14]); ?>
</div>
<div class="carousel-arrow">
<a data-slide="prev" href="portfolio_item.html#myCarousel2" class="left carousel-control">
<i class="fa fa-angle-left"></i>
</a>
<a data-slide="next" href="portfolio_item.html#myCarousel2" class="right carousel-control">
<i class="fa fa-angle-right"></i>
</a>
</div>
</div>
</div>
<div class="col-md-4 hotel-main">
<?= Html::img('@web/images/hotel.png', ['class' => 'smap_img']) ?>
<?= SmapPages::getSmapBlock('hotel')->smap_text; ?>
</div>
</div><!--/end row-->
</div>
<div class="line-blocks line-blocks-booking"></div>
<div class="container">
<div class="row" id="booking">
<div id="fuzz">
<div class="msgbox">
<?= Html::img('@web/images/loading.gif') ?>
</div>
</div>
<h2><?= Yii::t('trans', 'bronirovanie-nomerov'); ?></h2>
<?php Pjax::begin(['id' => 'booking-form']) ?>
<?php if (!\app\models\Order::checkSessionOrder()): ?>
<?= BookingWidget::widget(); ?>
<?php Pjax::begin(['id' => 'datepicker-widget']); ?>
<div class="col-lg-6">
<?php
echo '<label class="control-label">Выберите дату</label>';
echo DatePicker::widget([
'model' => $time_table,
'attribute' => 'date_start',
'attribute2' => 'date_end',
'options' => ['placeholder' => 'Дата заезда'],
'options2' => ['placeholder' => 'Дата отъезда'],
'type' => DatePicker::TYPE_RANGE,
'form' => $form,
'separator' => '-',
'language' => Yii::$app->language == 'ua' ? 'uk' : Yii::$app->language,
'pluginOptions' => [
'datesDisabled' => $booked_days,
'format' => 'yyyy-mm-dd',
'autoclose' => true,
]
]);
?>
<div id="result_availability">
</div>
</div>
<?php Pjax::end(); ?>
<?php else: ?>
<div class="col-lg-12">
<h2>Вы успешно забронировали номер</h2>
<?= Html::Button('Оплатить', ['class' => 'btn btn-success btn-booking-pay', 'style' => 'margin-right:20px;display:inline-block;']); ?>
<?= Html::Button('Отменить бронь', ['class' => 'btn btn-danger btn-booking-cancel', 'style' => 'margin-right:20px;display:inline-block;']); ?>
</div>
<?php endif; ?>
<?php Pjax::end() ?>
</div>
<div class="col-md-12 map">
<iframe
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2627.048486934122!2d30.255281099999998!3d48.8191363!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x40d212e2922df25b%3A0x5fde589560cf5941!2z0JfQsNGB0YLQsNCy0LA!5e0!3m2!1sru!2sua!4v1465573515151"
frameborder="0" style="border:0" allowfullscreen></iframe>
</div>
</div>
<?php
echo '<label class="control-label">Выберите дату</label>';
echo DatePicker::widget([
'model' => $time_table,
'attribute' => 'date_start',
'attribute2' => 'date_end',
'options' => ['placeholder' => 'Дата заезда'],
'options2' => ['placeholder' => 'Дата отъезда'],
'type' => DatePicker::TYPE_RANGE,
'form' => $form,
'separator' => '-',
'language' => Yii::$app->language == 'ua' ? 'uk' : Yii::$app->language,
'pluginOptions' => [
'datesDisabled' => $booked_days,
'format' => 'yyyy-mm-dd',
'autoclose' => true,
]
]);
?>