<?php echo \app\components\mytools::getFullnameByUser($model->id); ?> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'username', 'fullname', 'access_token', 'auth_key', 'active', ['attribute' => 'userlog', 'value' => \app\components\mytools::getFullnameByUser($model->id)], 'datetimelog']]); ?> <h2>Roles / Peran</h2> <p> <?php echo Html::a('Add Role', ['addrole', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> </p> <?php //$roles = Yii::$app->authManager->getRolesByUser($model->id); $roles = (new yii\db\Query())->select('')->from('auth_assignment a')->join('INNER JOIN', 'auth_item b', 'b.name = a.item_name')->where(['a.user_id' => $model->id])->All(Yii::$app->authdb); $rolesProvider = new \yii\data\ArrayDataProvider(['allModels' => $roles]); echo GridView::widget(['dataProvider' => $rolesProvider, 'columns' => ['name', 'description', ['class' => yii\grid\ActionColumn::className(), 'template' => '{delete}', 'urlCreator' => function ($action, $model, $key, $index) { return Yii::$app->urlManager->createUrl(['rbac/authassignment/delete2', 'item_name' => $model['name'], 'user_id' => $model['user_id']]); }]]]); ?> <h2>Permissions / Otoritas</h2> <?php $permissions = Yii::$app->authManager->getPermissionsByUser($model->id); $permissionsProvider = new \yii\data\ArrayDataProvider(['allModels' => $permissions]); echo GridView::widget(['dataProvider' => $permissionsProvider, 'columns' => ['name', 'description', ['attribute' => 'type', 'content' => 'app\\components\\columncontent::authitemtype']]]); ?> </div>
<?php use yii\grid\GridView; echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['id', 'name', ['class' => yii\grid\ActionColumn::className(), 'template' => '{update} {delete}']]]);
//$langOption = new \appCMS\language\LanguageCms(); //echo $form->field($model, 'langs')->dropDownList(\app\models\tblLangs::makeDropDown(), [ 'style' => 'width: 120px;', 'onchange' => 'form.submit();']); ?> </div> </div> <div class="row" style="margin-top: 10px;"> <div class="col-lg-12"> <?php echo $form->field($model, 'search')->input('text', ['style' => 'width: 300px']); ?> <?php echo Html::submitButton('<i class="glyphicon glyphicon-search"></i> ค้นหา', ['class' => 'btn btn-danger']); ?> </div> </div> <?php ActiveForm::end(); ?> </div> </div><br/> <?php // $this->registerJs("$('a[data-pjax]').pjax()"); \yii\widgets\Pjax::begin(); echo GridView::widget(['id' => 'grid-id', 'dataProvider' => $model->search(), 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'headerOptions' => ['width' => '5%']], ['headerOptions' => ['width' => '40%'], 'header' => 'ชื่อเรื่อง', 'attribute' => 'title'], ['headerOptions' => ['width' => '20%'], 'header' => 'ชื่อไฟล์', 'attribute' => 'file_name'], ['headerOptions' => ['width' => '16%'], 'header' => 'หมวดหมู่', 'attribute' => 'catname'], ['headerOptions' => ['width' => '5%', 'style' => 'text-align:center;'], 'contentOptions' => ['align' => 'center'], 'class' => yii\grid\CMSColumn::className(), 'template' => '{published}', 'header' => 'แสดง', 'visible' => Yii::$app->user->can('Publisher')], ['headerOptions' => ['width' => '7%', 'style' => 'text-align:center;'], 'contentOptions' => ['align' => 'center'], 'class' => yii\grid\CMSColumn::className(), 'template' => '{up} {down}', 'header' => 'เรียง', 'visible' => Yii::$app->user->can('Administrator')], ['headerOptions' => ['width' => '7%', 'style' => 'text-align:center;'], 'contentOptions' => ['align' => 'center'], 'class' => yii\grid\ActionColumn::className(), 'template' => '{update} {delete}', 'header' => 'แก้ไข']]]); \yii\widgets\Pjax::end(); ?> </div> </div>
<?php use yii\helpers\Html; $columns = array_merge([['class' => yii\grid\ActionColumn::className(), 'template' => '{delete}', 'buttons' => ['delete' => function ($url, $model, $key) { $options = ['title' => Yii::t('yii', 'Delete'), 'aria-label' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0']; return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['delete-token', 'id' => $model['id']], $options); }]]], ['label', 'tokenMask']); $config = ['dataProvider' => $dataProvider, 'columns' => $columns]; echo yii\grid\GridView::widget($config);
use yii\grid\GridView; use yii\helpers\Html; $this->title = 'PayQR редактор кнопок'; ?> <div class="site-index"> <div class="jumbotron"></div> <div class="body-content"> <div class="row"> <?php if (\Yii::$app->user->getId()) { ?> <h2>Здесь представлены настройки кнопок пользователя</h2> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['id', 'name', ['class' => yii\grid\ActionColumn::className(), 'template' => '{update} {delete}', 'buttons' => ['update' => function ($url, $model, $key) { return Html::a('<span class="glyphicon glyphicon-pencil"></span>', '?r=payqr/button/edit&market_id=' . $key); }, 'delete' => function ($url, $model, $key) { return Html::a('<span class="glyphicon glyphicon-trash"></span>', '?r=payqr/button/delete&market_id=' . $key); }]]]]); if ($dataProvider->getTotalCount() == 0) { echo \yii\bootstrap\Html::a('Создать кнопку', ['payqr/button/edit'], ['class' => 'btn btn-primary']); } } else { echo "Вы незарегистрированный пользователь. Чтобы настроить кнопку пройдите процедуру регистрации/авторизации!"; } ?> </div> </div> </div>
<div class="panel-heading"> <h2> <i><?php echo Yii::t('app', 'Budgets'); ?> <?php echo HelpPopover::widget(['dataOptions' => ['content' => Yii::t('help', 'BudgetHelp')]]); ?> </i> </h2> </div> <div class="panel-body"> <div class="table-responsive"> <?php echo GridView::widget(['layout' => '{summary}{pager}{items}{pager}', 'dataProvider' => $dataProvider, 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => Yii::t('app', 'First'), 'lastPageLabel' => Yii::t('app', 'Last')], 'filterModel' => $searchModel, 'tableOptions' => ['class' => 'table table-striped table-bordered table-hover'], 'headerRowOptions' => ['class' => 'x'], 'columns' => [['class' => yii\grid\ActionColumn::className(), 'contentOptions' => ['nowrap' => 'nowrap']], 'title', 'income_limit', 'costs_limit', ['filter' => kartik\date\DatePicker::widget(['model' => $searchModel, 'attribute' => 'created_date', 'pluginOptions' => ['format' => 'dd.mm.yyyy']]), 'attribute' => 'created_date', 'format' => 'date']]]); ?> </div> </div> </div> <?php \yii\widgets\Pjax::end(); ?> </div>
echo $form->field($model, 'langs')->dropDownList(\app\models\tblLangs::makeDropDown(), ['style' => 'width: 120px;', 'onchange' => 'form.submit();']); ?> </div> </div> <div class="row" style="margin-top: 10px;"> <div class="col-lg-12"> <?php echo $form->field($model, 'search')->input('text', ['style' => 'width: 300px']); ?> <?php echo Html::submitButton('<i class="glyphicon glyphicon-search"></i> ค้นหา', ['class' => 'btn btn-danger']); ?> </div> </div> <?php echo $form->field($model, 'cid', ['options' => ['class' => 'sr-only']])->hiddenInput(); ?> <?php ActiveForm::end(); ?> </div> </div><br/> <?php Pjax::begin(); echo GridView::widget(['dataProvider' => $model->search($sess), 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'headerOptions' => ['width' => '5%']], ['headerOptions' => ['width' => '60%'], 'header' => 'ชื่อเรื่อง', 'attribute' => 'titles'], ['headerOptions' => ['width' => '20%'], 'header' => 'ปรับปรุงเมื่อ', 'attribute' => 'applyDate'], ['headerOptions' => ['width' => '5%', 'style' => 'text-align:center;'], 'contentOptions' => ['align' => 'center'], 'class' => yii\grid\CMSColumn::className(), 'template' => '{published}', 'header' => 'แสดง'], ['headerOptions' => ['width' => '10%', 'style' => 'text-align:center;'], 'contentOptions' => ['align' => 'center'], 'class' => yii\grid\ActionColumn::className(), 'template' => '{update} {delete}', 'header' => 'แก้ไข']]]); Pjax::end(); ?> </div> </div>