<div class="registration-form"> <?php $form = ActiveForm::begin(); ?> <?php echo Html::hiddenInput('id', $model->id, ['id' => 'without_id']); ?> <?php echo $form->field($model, 'department_id')->textInput(['value' => $model->departmentRel->name, 'disabled' => true, 'id' => 'department_id', 'department_id' => $model->department_id]); ?> <?php echo $form->field($model, 'check_in')->dropDownList(Registration::getCheckIn(), ['prompt' => Yii::t('general', 'Please select'), 'id' => 'check_in', 'disabled' => $model->status !== $model::STATUS_CONFIRM]); ?> <?php echo $form->field($model, 'check_out')->dropDownList(Registration::getCheckOut(), ['prompt' => Yii::t('general', 'Please select'), 'id' => 'check_out', 'disabled' => $model->status !== $model::STATUS_CONFIRM]); ?> <?php echo $form->field($model, 'hotel_id')->dropDownList(ArrayHelper::map($hotels, 'id', 'name'), ['prompt' => Yii::t('general', 'Please select'), 'id' => 'hotel_id', 'disabled' => $model->status !== $model::STATUS_CONFIRM]); ?> <?php echo $form->field($model, 'title')->dropDownList(Registration::getTitles(), ['prompt' => Yii::t('general', 'Please select')]); ?> <?php
<?php use yii\helpers\Html; use common\components\GridView; use common\models\Registration; use common\models\Hotel; /* @var $this yii\web\View */ /* @var $searchModel backend\models\RegistrationSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('app', 'Registrations'); ?> <div class="registration-index"> <?php $gridColumns = [['attribute' => 'status', 'value' => function ($data) { return isset($data->status) && array_key_exists($data->status, Registration::$reverseStatus) ? Registration::$reverseStatus[$data->status] : null; }, 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['data' => Registration::$statusNames + ['' => 'All']], 'headerOptions' => ['style' => 'min-width:115px;']], 'first_name', 'last_name', 'company', 'department', ['attribute' => 'hotel_id', 'value' => function ($data) { return isset($data->hotel) && $data->hotel ? $data->hotel->name : null; }, 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['data' => Hotel::getMap(), 'options' => ['prompt' => Yii::t('general', 'All')]], 'headerOptions' => ['style' => 'min-width:155px;']], ['attribute' => 'check_in', 'format' => ['date', 'php:d/m/Y'], 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['data' => Registration::getCheckIn(), 'options' => ['prompt' => Yii::t('general', 'All')]], 'headerOptions' => ['style' => 'min-width:115px;']], ['attribute' => 'check_out', 'format' => ['date', 'php:d/m/Y'], 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['data' => Registration::getCheckOut(), 'options' => ['prompt' => Yii::t('general', 'All')]], 'headerOptions' => ['style' => 'min-width:115px;']], ['attribute' => 'room_type_id', 'value' => function ($data) { return isset($data->roomType) && $data->roomType ? $data->roomType->name : null; }, 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['data' => \common\models\RoomType::getMap(), 'options' => ['prompt' => Yii::t('general', 'All')]]], ['attribute' => 'room_rate', 'value' => function ($data) { return isset($data->room_rate) ? Registration::generateRoomRate($data->room_rate) : null; }, 'format' => 'raw'], ['attribute' => 'updated_at', 'format' => ['date', 'php:h:i:s A d-m-Y']], 'd12', 'd13', 'd14', 'd15', 'd16']; // Generate a bootstrap responsive striped table with row highlighted on hover echo GridView::widget(['dataProvider' => $dataProvider, 'responsive' => true, 'hover' => true, 'columns' => $gridColumns, 'pjax' => true, 'resizableColumns' => false, 'toolbar' => [Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => Yii::t('kvgrid', 'Reset Grid')]), '{export}', '{toggleData}'], 'toggleDataOptions' => ['default' => 'all'], 'panelBeforeTemplate' => '<div class="pull-right"><div class="btn-toolbar kv-grid-toolbar" role="toolbar"><span class="pager-mini">{pager}</span>{toolbar}</div></div>{before}<div class="clearfix"></div>', 'panelAfterTemplate' => '{after}<span class="pager-mini clearfix">{pager}</span>', 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-list-alt"></i> Hotel Rooming List</h3>', 'footer' => false], 'exportConfig' => [GridView::EXCEL => [], GridView::CSV => ['config' => ['colDelimiter' => ';', 'rowDelimiter' => "\r\n"]], GridView::PDF => []]]); ?> </div>