?> <?php echo $form->field($model, 'last_name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'first_name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'middle_name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'id_status')->dropDownList(ArrayHelper::map(StatusEmployee::find()->all(), 'id', 'title'))->label('Статус сотрудника'); ?> <?php echo $form->field($model, 'id_role')->dropDownList(ArrayHelper::map(Role::find()->all(), 'id', 'title'))->label('Должность сотрудника'); ?> <?php echo $form->field($model, 'birthday')->widget(DatePicker::className(), ['inline' => false, 'language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy']]); ?> <?php echo $form->field($model, 'date_start')->widget(DatePicker::className(), ['inline' => false, 'language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy']]); ?> <?php
use yii\grid\GridView; use yii\helpers\ArrayHelper; use app\models\StatusEmployee; use app\models\Role; use app\models\Deparment; $this->title = 'Сотрудники'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="employee-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a('Добавить сотрудника', ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'format' => 'integer', 'label' => 'ID', 'contentOptions' => ['style' => 'width: 40px']], 'fullNameEmployee', ['attribute' => 'statusTitle', 'format' => 'text', 'filter' => ArrayHelper::map(StatusEmployee::find()->all(), 'id', 'title')], ['attribute' => 'roleTitle', 'format' => 'text', 'filter' => ArrayHelper::map(Role::find()->all(), 'id', 'title')], 'fullPhoneNumberEmployee', ['attribute' => 'departmentName', 'format' => 'text', 'filter' => ArrayHelper::map(Deparment::find()->all(), 'id', 'title')], 'birthday', 'date_start', ['attribute' => 'date_end', 'format' => 'date', 'content' => function ($data) { if ($data->date_end == '01.01.1970') { return '---'; } else { return $data->date_end; } }], ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>