示例#1
0
/* @var $searchModel app\module\handbook\models\ClassroomsBusySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Забронювати аудиторію';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="classrooms-busy-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Забронювати аудиторію', ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['label' => 'Аудиторія', 'attribute' => 'id_classroom', 'value' => function ($data) {
    $classes = ClassRooms::findOne(['classrooms_id' => $data->id_classroom]);
    $housing = Housing::findOne(['housing_id' => $classes['id_housing']]);
    return $classes['classrooms_number'] . ' - ' . $housing['name'];
}], ['attribute' => 'lesson', 'value' => 'lesson0.lesson_time_name'], ['attribute' => 'day', 'value' => 'day', 'filter' => DatePicker::Widget(['model' => $searchModel, 'attribute' => 'day', 'inline' => false, 'language' => 'ua', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd', 'class' => 'ijjijj']])], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>