guild/backend/modules/card/views/user-card/index.php

92 lines
3.0 KiB
PHP
Raw Normal View History

2018-10-11 11:15:09 +03:00
<?php
use yii\helpers\Html;
use yii\grid\GridView;
2018-10-11 14:52:44 +03:00
use yii\helpers\Url;
2019-07-03 13:55:32 +03:00
use yii\widgets\ListView;
2018-10-11 11:15:09 +03:00
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\card\models\UserCardSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Профили';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-card-index">
<p>
<?= Html::a('Добавить', ['create'], ['class' => 'btn btn-success']) ?>
</p>
2020-01-17 16:28:25 +03:00
<?php
echo GridView::widget([
2018-10-11 11:15:09 +03:00
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
2018-10-11 14:52:44 +03:00
//'id',
[
2019-12-06 12:05:14 +03:00
'label' => 'Фото',
2018-10-11 14:52:44 +03:00
'format' => 'raw',
'value' => function ($model) {
return Html::img(Url::to($model->photo), [
2018-10-11 14:52:44 +03:00
'style' => 'width:100px;'
]);
},
],
2018-10-11 11:15:09 +03:00
'fio',
2019-12-09 10:54:39 +03:00
// 'city',
2018-12-03 12:10:39 +03:00
//'passport',
2021-08-12 13:57:00 +03:00
[
'attribute' => 'salary',
'visible' => Yii::$app->user->can('confidential_information')
],
2018-10-11 11:15:09 +03:00
'email:email',
//'gender',
//'dob',
2018-11-23 16:09:29 +03:00
[
'attribute' => 'status',
'value' => function ($model) {
2018-11-23 16:09:29 +03:00
return $model->status0->name;
},
'filter' => kartik\select2\Select2::widget([
'model' => $searchModel,
'attribute' => 'status',
'data' => \common\models\Status::getStatusesArray(\common\models\UseStatus::USE_PROFILE),
'options' => ['placeholder' => 'Начните вводить...', 'class' => 'form-control'],
2018-11-23 16:09:29 +03:00
'pluginOptions' => [
'allowClear' => true
],
]),
],
2018-10-11 11:15:09 +03:00
//'created_at',
//'updated_at',
2019-07-03 13:55:32 +03:00
[
'label' => 'Навыки',
'format' => 'raw',
'value' => function ($model) {
$str = '';
foreach ($model->skillValues as $item) {
$str .= $item->skill->name . ', ';
}
$str = substr($str, 0, -2);
return $str;
},
2019-07-03 13:55:32 +03:00
'filter' => kartik\select2\Select2::widget([
'attribute' => 'skills',
2019-07-03 13:55:32 +03:00
'model' => $searchModel,
'data' => \common\models\UserCard::getNameSkills(),
'options' => ['multiple' => true, 'placeholder' => 'Выбрать параметр', 'class' => 'form-control'],
2019-07-03 13:55:32 +03:00
'pluginOptions' => [
2021-09-07 15:24:24 +03:00
'allowClear' => true,
2019-07-03 13:55:32 +03:00
],
]),
],
2018-10-11 11:15:09 +03:00
['class' => 'yii\grid\ActionColumn'],
],
2020-01-17 16:28:25 +03:00
]);
2020-01-23 17:14:53 +03:00
echo "<h3>Сумма зарплат: " . $searchModel->total . "</h3>";
2020-01-17 16:28:25 +03:00
?>
</div>