%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
| Server IP : 14.207.165.8 / Your IP : 216.73.216.26 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/ppaobm/backend/theme/adminlte/admin/ |
Upload File : |
<?php
/*
* This file is part of the Dektrium project.
*
* (c) Dektrium project <http://github.com/dektrium>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
//use yii\grid\GridView;
use kartik\grid\GridView;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\web\View;
use yii\widgets\Pjax;
use yii\helpers\ArrayHelper;
use kartik\export\ExportMenu;
use backend\modules\location_center\models\LocationCenter;
/**
* @var \yii\web\View $this
* @var \yii\data\ActiveDataProvider $dataProvider
* @var \dektrium\user\models\UserSearch $searchModel
*/
$this->title = 'รายชื่อเจ้าหน้าที่';
$this->params['breadcrumbs'][] = $this->title;
?>
<?php
$gridColumns = [
[
'class' => 'kartik\grid\SerialColumn',
'contentOptions' => ['class' => 'kartik-sheet-style'],
'width' => '0.5%',
'header' => '#',
'headerOptions' => ['class' => 'kartik-sheet-style']
],
// 'email',
// [
// 'attribute' => 'id',
// 'headerOptions' => ['style' => 'width:90px;'], # 90px is sufficient for 5-digit user ids
// 'contentOptions' => function ($model) {
// return [
// 'style' => 'cursor:pointer;',
// 'id' => $model['id'],
// 'onclick' => 'window.location.href = "/user/admin/update?id="+(this.id)',
// ];
// },
// ],
[
'attribute' => 'username',
'contentOptions' => function ($model) {
return [
'style' => 'cursor:pointer;',
'id' => $model['id'],
'onclick' => 'window.location.href = "/user/admin/update?id="+(this.id)',
];
},
],
// 'email:email',
[
'attribute' => 'name',
'label' => 'ชื่อ-นามสกุล',
'value' => function ($model) {
$model = \backend\models\Profile::find()->where(['user_id' => $model->id])->one();
return $model->name;
},
'format' => 'html',
'contentOptions' => function ($model) {
return [
'style' => 'cursor:pointer;',
'id' => $model['id'],
'onclick' => 'window.location.href = "/user/admin/update?id="+(this.id)',
];
},
],
[
'attribute' => 'location_center',
'label' => 'ศูนย์ประสานแผนประจำอำเภอ',
'value' => function ($model) {
$model = \backend\models\Profile::find()->where(['user_id' => $model->id])->one();
$location = backend\modules\location_center\models\LocationCenter::find()->where(['id' => $model->departments])->one();
return $location->name;
},
'format' => 'html',
'contentOptions' => function ($model) {
return [
'style' => 'cursor:pointer;',
'id' => $model['id'],
'onclick' => 'window.location.href = "/user/admin/update?id="+(this.id)',
];
},
],
// [
// 'attribute' => 'created_at',
// 'value' => function ($model) {
// if (extension_loaded('intl')) {
// return Yii::t('user', '{0, date, MMMM dd, YYYY HH:mm}', [$model->created_at]);
// } else {
// return date('Y-m-d G:i:s', $model->created_at);
// }
// },
// ],
// [
// 'attribute' => 'last_login_at',
// 'value' => function ($model) {
// if (!$model->last_login_at || $model->last_login_at == 0) {
// return Yii::t('user', 'Never');
// } else if (extension_loaded('intl')) {
// return Yii::t('user', '{0, date, MMMM dd, YYYY HH:mm}', [$model->last_login_at]);
// } else {
// return date('Y-m-d G:i:s', $model->last_login_at);
// }
// },
// ],
[
'header' => Yii::t('user', 'Confirmation'),
'value' => function ($model) {
if ($model->isConfirmed) {
return '<div class="text-center">
<span class="text-success">' . Yii::t('user', 'Confirmed') . '</span>
</div>';
} else {
return Html::a(Yii::t('user', 'Confirm'), ['confirm', 'id' => $model->id], [
'class' => 'btn btn-xs btn-success btn-block',
'data-method' => 'post',
'data-confirm' => Yii::t('user', 'Are you sure you want to confirm this user?'),
]);
}
},
'format' => 'raw',
'visible' => Yii::$app->getModule('user')->enableConfirmation,
],
[
'header' => Yii::t('user', 'Block status'),
'value' => function ($model) {
if ($model->isBlocked) {
return Html::a(Yii::t('user', 'Unblock'), ['block', 'id' => $model->id], [
'class' => 'btn btn-xs btn-success btn-block',
'data-method' => 'post',
'data-confirm' => Yii::t('user', 'Are you sure you want to unblock this user?'),
]);
} else {
return Html::a(Yii::t('user', 'Block'), ['block', 'id' => $model->id], [
'class' => 'btn btn-xs btn-danger btn-block',
'data-method' => 'post',
'data-confirm' => Yii::t('user', 'Are you sure you want to block this user?'),
]);
}
},
'format' => 'raw',
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{update} {delete}',
'buttons' => [
'resend_password' => function ($url, $model, $key) {
if (\Yii::$app->user->identity->isAdmin && !$model->isAdmin) {
return '
<a data-method="POST" data-confirm="' . Yii::t('user', 'Are you sure?') . '" href="' . Url::to(['resend-password', 'id' => $model->id]) . '">
<span title="' . Yii::t('user', 'Generate and send new password to user') . '" class="glyphicon glyphicon-envelope">
</span> </a>';
}
},
'switch' => function ($url, $model) {
if (\Yii::$app->user->identity->isAdmin && $model->id != Yii::$app->user->id && Yii::$app->getModule('user')->enableImpersonateUser) {
return Html::a('<span class="glyphicon glyphicon-user"></span>', ['/user/admin/switch', 'id' => $model->id], [
'title' => Yii::t('user', 'Become this user'),
'data-confirm' => Yii::t('user', 'Are you sure you want to switch to this user for the rest of this Session?'),
'data-method' => 'POST',
]);
}
}
]
],
];
?>
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= Html::encode($this->title) ?>
<small>ศูนย์ประสานแผนพัฒนาท้องถิ่นประจำอำเภอ</small>
</h1>
</section>
<section class="content-header">
<?= $this->render('/admin/_menu') ?>
</section>
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box">
<div class="box-body">
<?php Pjax::begin() ?>
<?=
GridView::widget([
'id' => 'grid-admin',
'dataProvider' => $dataProvider,
// 'filterModel' => $searchModel,
'options' => [
'class' => 'table table-bordered table-striped'
],
'filterRowOptions' => ['class' => 'kartik-sheet-style'],
'layout' => "{items}\n{pager}",
'showPageSummary' => false,
// 'panel' => [
// 'type' => GridView::TYPE_PRIMARY
// ],
'panelTemplate' => '
<div class="panel {type}">
{items}
<div class="clearfix">
{pager}
</div>
<div class="clearfix"></div>
</div>',
'pjax' => true,
'pjaxSettings' => [
'neverTimeout' => true,
'enablePushState' => true,
'options' => ['id' => 'grid-' . Yii::$app->controller->module->id . Yii::$app->controller->action->id,],
],
// 'pager' => Yii::$app->params['pagerX'],
'toolbar' => [
'{export}',
'{toggleData}'
],
'export' => [
'label' => 'ดาว์โหลดเอกสาร',
'fontAwesome' => true,
'showConfirmAlert' => false,
'target' => \kartik\grid\GridView::TARGET_BLANK
],
'exportConfig' => [
\kartik\grid\GridView::EXCEL => false,
],
'responsive' => true,
'responsiveWrap' => false,
'hover' => true,
'headerRowOptions' => ['class' => 'header-table-center',],
'columns' => $gridColumns,
'krajeeDialogSettings' => ['overrideYiiConfirm' => false]
]);
?>
<?php Pjax::end() ?>
</div>
</div>
</div>
</div>
</section>
</div>