Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use yii\helpers\Html;
- use kartik\detail\DetailView;
- use dlds\metronic\widgets\Panel;
- /* @var $this yii\web\View */
- /* @var $model app\models\User */
- $this->title = $model->full_name;
- $this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
- $this->params['breadcrumbs'][] = $this->title;
- ?>
- <div class="user-view">
- <!-- start user-view -->
- <h1><?= Html::encode($this->title) ?></h1>
- <p>
- <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
- <?= Html::a('Back to Previous Page', ['index'], ['class' => 'btn btn-warning']) ?>
- </p>
- <?php Panel::begin(['icon' => 'fa fa-info', 'title' => 'User Information I', 'type' => 'panel-info']); ?>
- <?= DetailView::widget([
- 'model' => $model,
- 'attributes' => [
- [
- 'attribute' => 'status',
- 'format' => 'html',
- 'value' => $model->status ? '<span class="label label-success">Active</span>' : '<span class="label label-danger">No Active</span>',
- 'labelColOptions' => [ 'style'=>'width:30%; text-align:right;' ]
- ],
- 'full_name',
- 'email:email',
- 'username',
- ],
- ]) ?>
- <?php Panel::end(); ?>
- <?php Panel::begin(['icon' => 'fa fa-check-square-o', 'title' => 'User Information II', 'type' => 'panel-info']); ?>
- <?= DetailView::widget([
- 'model' => $model,
- 'attributes' => [
- [
- 'label' => 'Branch Name',
- 'attribute' => 'branch_id',
- 'value' => isset($model->branch) ? $model->branch->name : "-",
- 'labelColOptions' => ['style'=>'width: 30%; text-align: right;']
- ],
- [
- 'label' => 'Manager Name',
- 'attribute' => 'manager_id',
- 'value' => isset($model->manager) ? $model->manager->full_name : "-",
- 'labelColOptions' => ['style'=>'width: 30%; text-align: right;']
- ],
- [
- 'label' => 'Location Name',
- 'attribute' => 'location_id',
- 'value' => isset($model->location) ? $model->location->name : "-",
- 'labelColOptions' => ['style'=>'width: 30%; text-align: right;']
- ],
- ['attribute' => 'created_at', 'format' => [ 'date', 'php: d-M-Y H:i:s' ], 'labelColOptions' => ['style' => 'width: 30%; text-align: right;']],
- ['attribute' => 'updated_at', 'format' => [ 'date', 'php: d-M-Y H:i:s' ], 'labelColOptions' => ['style' => 'width: 30%; text-align: right;']],
- ],
- ]) ?>
- <?php Panel::end(); ?>
- <!-- end user-view -->
- </div>
Advertisement
Add Comment
Please, Sign In to add comment