2018-10-11 11:15:09 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use yii\grid\GridView;
|
|
|
|
use yii\helpers\Html;
|
|
|
|
use yii\widgets\DetailView;
|
|
|
|
|
|
|
|
/* @var $this yii\web\View */
|
|
|
|
/* @var $model backend\modules\card\models\UserCard */
|
2019-11-14 17:21:34 +03:00
|
|
|
/* @var $userData common\models\User */
|
2018-10-12 14:52:08 +03:00
|
|
|
/* @var $skills \common\models\CardSkill */
|
|
|
|
/* @var $skill \common\models\Skill */
|
2019-11-18 10:36:13 +03:00
|
|
|
/* @var $modelFildValue yii\data\ActiveDataProvider */
|
2018-10-11 11:15:09 +03:00
|
|
|
|
|
|
|
$this->title = $model->fio;
|
|
|
|
$this->params['breadcrumbs'][] = ['label' => 'User Cards', 'url' => ['index']];
|
|
|
|
$this->params['breadcrumbs'][] = $this->title;
|
|
|
|
?>
|
|
|
|
<div class="user-card-view">
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<?= Html::a('Редактировать', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<?= DetailView::widget([
|
|
|
|
'model' => $model,
|
|
|
|
'attributes' => [
|
|
|
|
'fio',
|
|
|
|
'passport',
|
|
|
|
[
|
2018-10-12 14:52:08 +03:00
|
|
|
'attribute' => 'Photo',
|
2018-10-11 11:15:09 +03:00
|
|
|
'format' => 'raw',
|
2019-11-14 17:21:34 +03:00
|
|
|
'value' => function ($model) {
|
2018-10-11 11:15:09 +03:00
|
|
|
return Html::tag('img', null, ['src' => $model->photo, 'width' => '100px']);
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2018-10-12 14:52:08 +03:00
|
|
|
'attribute' => 'Resume',
|
2018-10-11 11:15:09 +03:00
|
|
|
'format' => 'raw',
|
2019-11-14 17:21:34 +03:00
|
|
|
'value' => function ($model) {
|
2018-10-11 11:15:09 +03:00
|
|
|
return Html::a('Скачать', $model->resume, ['target' => '_blank']);
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2018-10-12 14:52:08 +03:00
|
|
|
'attribute' => 'gender',
|
2018-10-11 11:15:09 +03:00
|
|
|
'value' => $model->gendersText,
|
|
|
|
],
|
|
|
|
|
|
|
|
'email:email',
|
|
|
|
|
|
|
|
'dob',
|
|
|
|
[
|
2018-10-12 14:52:08 +03:00
|
|
|
'attribute' => 'status',
|
2018-10-11 11:15:09 +03:00
|
|
|
'value' => $model->status0->name,
|
|
|
|
],
|
2018-10-11 17:45:35 +03:00
|
|
|
'salary',
|
2018-10-12 14:52:08 +03:00
|
|
|
[
|
|
|
|
'attribute' => 'position_id',
|
2018-11-06 11:44:27 +03:00
|
|
|
'value' => (isset($model->position->name)) ? $model->position->name : 'Без должности',
|
2018-10-12 14:52:08 +03:00
|
|
|
],
|
2018-10-11 11:15:09 +03:00
|
|
|
'created_at',
|
|
|
|
'updated_at',
|
|
|
|
],
|
|
|
|
]) ?>
|
|
|
|
|
2018-10-12 14:52:08 +03:00
|
|
|
<h2>Навыки</h2>
|
|
|
|
|
2019-11-14 17:21:34 +03:00
|
|
|
<?php foreach ($skills as $skill) : ?>
|
2018-10-12 14:52:08 +03:00
|
|
|
<span class="btn btn-default btn-sm"><?= $skill['skill']->name; ?></span>
|
|
|
|
<?php endforeach; ?>
|
2018-10-11 11:15:09 +03:00
|
|
|
<h2>Дополнительные сведения</h2>
|
|
|
|
|
|
|
|
<?= GridView::widget([
|
|
|
|
'dataProvider' => $modelFildValue,
|
2019-11-14 17:21:34 +03:00
|
|
|
'layout' => "{items}",
|
2018-10-11 11:15:09 +03:00
|
|
|
'columns' => [
|
|
|
|
'field.name:text:Поле',
|
2019-07-26 16:02:35 +03:00
|
|
|
[
|
2019-07-26 16:21:32 +03:00
|
|
|
'attribute' => 'value',
|
|
|
|
'format' => 'raw',
|
2019-11-14 17:21:34 +03:00
|
|
|
'value' => function ($model) {
|
|
|
|
if ($model->type_file == 'file') {
|
2019-07-26 16:21:32 +03:00
|
|
|
return $model->value . ' (' . Html::a('Скачать', $model->value, ['target' => '_blank', 'download' => 'download']) . ')';
|
2019-07-26 16:02:35 +03:00
|
|
|
}
|
2019-07-26 16:21:32 +03:00
|
|
|
return $model->value;
|
|
|
|
}
|
2019-07-26 16:02:35 +03:00
|
|
|
],
|
2018-10-11 11:15:09 +03:00
|
|
|
],
|
|
|
|
]); ?>
|
2019-11-14 17:21:34 +03:00
|
|
|
|
|
|
|
</div>
|