71 lines
3.1 KiB
PHP
Executable File
71 lines
3.1 KiB
PHP
Executable File
<?php
|
||
|
||
use yii\web\View;
|
||
use yii\widgets\ActiveForm;
|
||
use common\helpers\UserHelper;
|
||
use common\components\user\models\User;
|
||
|
||
/**
|
||
* @var $this View
|
||
* @var $form ActiveForm
|
||
* @var $model User
|
||
*/
|
||
|
||
$attribute = '';
|
||
if ($model->type == UserHelper::TYPE_ADMIN) {
|
||
$attribute = 'admin';
|
||
?>
|
||
<div class="col-xs-12 col-md-8 col-lg-4 mb-3">
|
||
<?= $form->field($model, $attribute . '[birthday]')->textInput(['maxlength' => 100])->label(Yii::t('user', 'День рождения')) ?>
|
||
</div>
|
||
<?php }
|
||
|
||
if ($model->type == UserHelper::TYPE_EMPLOYEE) {
|
||
$attribute = 'employee';
|
||
?>
|
||
<div class="col-xs-12 col-md-8 col-lg-4 mb-3">
|
||
<?= $form->field($model, $attribute . '[birthday]')->textInput(['maxlength' => 100])->label(Yii::t('user', 'День рождения')) ?>
|
||
</div>
|
||
<div class="col-xs-12 col-md-8 col-lg-4 mb-3">
|
||
<?= $form->field($model, $attribute . '[about]')->textInput(['maxlength' => 255])->label(Yii::t('user', 'О себе')) ?>
|
||
</div>
|
||
<div class="col-xs-12 col-md-8 col-lg-4 mb-3">
|
||
<?= $form->field($model, $attribute . '[nick_name]')->textInput(['maxlength' => 100])->label(Yii::t('user', 'Ник')) ?>
|
||
</div>
|
||
<div class="col-xs-12 col-md-8 col-lg-4 mb-3">
|
||
<?= $form->field($model, $attribute . '[web]')->textInput(['maxlength' => 100])->label(Yii::t('user', 'Соц.сети')) ?>
|
||
</div>
|
||
<div class="col-xs-12 col-md-8 col-lg-4 mb-3">
|
||
<?= $form->field($model, $attribute . '[test_count]')->textInput(['maxlength' => 100])->label(Yii::t('user', 'Попытка тестирования')) ?>
|
||
</div>
|
||
<div class="col-xs-12 col-md-8 col-lg-4 mb-3">
|
||
<?= $form->field($model, $attribute . '[test_result]')->textInput(['maxlength' => 100])->label(Yii::t('user', 'Результат тестирования')) ?>
|
||
</div>
|
||
<?php }
|
||
|
||
if ($model->type == UserHelper::TYPE_CUSTOMER) {
|
||
$attribute = 'customer';
|
||
} ?>
|
||
|
||
<div class="row">
|
||
<div class="col-xs-6 col-md-2 mb-3">
|
||
<?= $form->field($model, $attribute . '[location]')->dropDownList(UserHelper::locationNames(), ['prompt' => Yii::t('user', '...')])->label(Yii::t('user', 'Код страны')) ?>
|
||
</div>
|
||
<div class="col-xs-6 col-md-2 mb-3">
|
||
<?= $form->field($model, $attribute . '[phone]')->textInput(['maxlength' => 100, 'placeholder' => '901 234 56 78'])->label(Yii::t('user', 'Телефон')) ?>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-xs-12 col-md-8 col-lg-4 mb-3">
|
||
<?= $form->field($model, $attribute . '[last_name]')->textInput(['maxlength' => 100])->label(Yii::t('user', 'Фамилия')) ?>
|
||
</div>
|
||
<div class="col-xs-12 col-md-8 col-lg-4 mb-3">
|
||
<?= $form->field($model, $attribute . '[first_name]')->textInput(['maxlength' => 100])->label(Yii::t('user', 'Имя')) ?>
|
||
</div>
|
||
<div class="col-xs-12 col-md-8 col-lg-4 mb-3">
|
||
<?= $form->field($model, $attribute . '[middle_name]')->textInput(['maxlength' => 100])->label(Yii::t('user', 'Отчество')) ?>
|
||
</div>
|
||
<div class="col-xs-12 col-md-8 col-lg-4 mb-3">
|
||
<?= $form->field($model, $attribute . '[telegram]')->textInput(['maxlength' => 100])->label(Yii::t('user', 'Телеграм')) ?>
|
||
</div>
|