surat/frontend/modules/administrator/views/user/view.php

59 lines
2.0 KiB
PHP
Raw Normal View History

2024-12-25 03:04:59 +00:00
<?php
use common\models\User;
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\User */
$this->title = $model->realname;
$this->params['breadcrumbs'][] = ['label' => 'ผู้ใช้งาน', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="card">
<div class="card-header d-flex align-items-center justify-content-between">
<h5 class="card-title"><?= $this->title ?></h5>
<?= Html::a('<i class="fa fa-edit"></i> แก้ไข', ['update', 'id' => $model->id], ['class' => 'btn btn-sm btn-primary btn-block']) ?></li>
<?= Html::a('<i class="fa fa-trash"></i> ลบ', ['delete', 'id' => $model->id], [
'class' => 'btn btn-sm btn-danger btn-block',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</div>
<div class="card-body">
<?= DetailView::widget([
'model' => $model,
'attributes' => [
//'id',
'username',
'auth_key',
'password_hash',
'password_reset_token',
'email:email',
'report_name',
'realname',
'position',
//'employment_type_id',
//'supervisor_id',
//'department_id',
'role',
'tel_x',
'last_login_at',
[
'attribute' => 'status',
'value' => function ($model) {
$arr = [User::STATUS_ACTIVE => 'ใช้งาน', User::STATUS_NOT_ACTIVE => 'ไม่ใช้งาน'];
return $arr[$model->status];
}
],
'created_at:datetime',
'updated_at:datetime',
],
]) ?>
</div>
</div>