Esempio n. 1
0
	<?php 
echo $form->field($model, 'date_end')->widget(DatePicker::className(), ['inline' => false, 'language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy']]);
?>


    <?php 
echo $form->field($model, 'id_phone_code')->dropDownList(ArrayHelper::map(PhoneCode::find()->all(), 'id', 'code'))->label('Код телефона');
?>

    <?php 
echo $form->field($model, 'phone_number')->widget(MaskedInput::className(), ['name' => 'phone_number', 'mask' => '999-99-99', 'clientOptions' => ['removeMaskOnSubmit' => true]]);
?>

    <?php 
echo $form->field($model, 'id_department')->dropDownList(ArrayHelper::map(Deparment::find()->all(), 'id', 'title'))->label('Секция');
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Создать' : 'Обновить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
<script>
	$(function(){
Esempio n. 2
0
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>