$this->params['breadcrumbs'][] = ['label' => Module::t('user-admin', 'Users'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->params['subtitle']; ?> <div class="user-update"> <div class="box box-success"> <div class="box-header"> <div class="pull-right"> <?php echo Html::a('<i class="fa fa-list"></i>', ['index'], ['class' => 'btn btn-default btn-sm', 'title' => Module::t('user-admin', 'List')]); ?> <?php echo Html::a('<i class="fa fa-money text-danger"></i>', ['debtor'], ['class' => 'btn btn-default btn-sm', 'title' => Module::t('user-admin', 'List debtors')]); ?> <?php echo Html::a('<i class="fa fa-eye"></i>', ['view', 'id' => $user->id], ['class' => 'btn btn-default btn-sm', 'title' => Module::t('user-admin', 'View')]); ?> <?php echo Html::a('<i class="fa fa-plus"></i>', ['create'], ['class' => 'btn btn-primary btn-sm', 'title' => Module::t('user-admin', 'Create')]); ?> <?php echo Html::a('<i class="fa fa-trash"></i>', ['delete', 'id' => $user->id], ['class' => 'btn btn-danger btn-sm', 'title' => Module::t('user-admin', 'Delete'), 'data-confirm' => Module::t('user-admin', 'Are you sure to delete this item?'), 'data-method' => 'post']); ?> </div> </div> <div class="box-body"> <?php echo $this->render('_form', compact('user', 'profile')); ?> </div> </div> </div>
<?php use yii\helpers\Html; use backend\modules\user\Module; /* @var $this yii\web\View */ /* @var $user common\models\User */ /* @var $profile common\models\Profile */ $this->title = Module::t('user-admin', 'Users'); $this->params['subtitle'] = Module::t('user-admin', 'Create user'); $this->params['breadcrumbs'][] = ['label' => $this->title, 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->params['subtitle']; ?> <div class="user-create"> <div class="box box-primary"> <div class="box-header"> <div class="pull-right"> <?php echo Html::a('<i class="fa fa-list"></i>', ['index'], ['class' => 'btn btn-default btn-sm', 'title' => Module::t('user-admin', 'List')]); ?> </div> </div> <div class="box-body"> <?php echo $this->render('_form', compact('user', 'profile')); ?> </div> </div> </div>
use backend\modules\timetable\Module as Timetable; use backend\modules\employment\Employment; use backend\modules\pay\Pay; use backend\modules\ticket\Ticket; use backend\modules\statistics\Statistics; if (!isset(Yii::$app->i18n->translations['rbac-admin'])) { Yii::$app->i18n->translations['rbac-admin'] = ['class' => 'yii\\i18n\\PhpMessageSource', 'sourceLanguage' => 'en', 'basePath' => '@mdm/admin/messages']; } $controllerPath = ''; $moduleId = ''; if (Yii::$app->controller->module->id) { $controllerPath = '/' . Yii::$app->controller->module->id; $moduleId = Yii::$app->controller->module->id; } $controllerPath .= '/' . Yii::$app->controller->id; ?> <aside class="main-sidebar"> <section class="sidebar"> <?php echo Nav::widget(['id' => 'adminlte-sidebar-menu', 'encodeLabels' => false, 'options' => ['class' => 'sidebar-menu'], 'activateItems' => true, 'activateParents' => true, 'items' => [['label' => Config::t('configuration', 'Configuration'), 'url' => ['/config/default/index'], 'visible' => Yii::$app->user->can('/config/*'), 'icon' => Config::getIcon()], ['label' => User::t('user-admin', 'Users'), 'url' => ['/user/default/index'], 'visible' => Yii::$app->user->can('/user/*'), 'icon' => User::getIcon()], ['label' => Group::t('group-admin', 'Groups'), 'url' => ['/group/default/index'], 'visible' => Yii::$app->user->can('/group/*'), 'icon' => Group::getIcon()], ['label' => Timetable::t('timetable-admin', 'Timetable'), 'url' => ['/timetable/default/index'], 'visible' => Yii::$app->user->can('/timetable/*'), 'icon' => Timetable::getIcon()], ['label' => Ticket::t('ticket', 'Tickets'), 'url' => ['/ticket/default/index'], 'visible' => Yii::$app->user->can('/ticket/*'), 'icon' => Ticket::getIcon()], ['label' => Pay::t('pay-admin', 'Pays'), 'url' => ['/pay/default/index'], 'visible' => Yii::$app->user->can('/pay/*'), 'icon' => Pay::getIcon()], ['label' => Employment::t('employment', 'Paid employments'), 'url' => ['/employment/default/index'], 'visible' => Yii::$app->user->can('/employment/*'), 'icon' => Employment::getIcon()], ['label' => News::t('eugenekei-news', 'News'), 'url' => ['/news/admin/index'], 'visible' => Yii::$app->user->can('/news/admin/*'), 'icon' => News::getIcon(), 'active' => $moduleId === 'news'], ['label' => Statistics::t('statistics', 'Statistics'), 'url' => ['/statistics/default/index'], 'visible' => Yii::$app->user->can('/statistics/*'), 'icon' => Statistics::getIcon()], ['label' => Yii::t('rbac-admin', 'Assignments'), 'url' => ['/rbac'], 'icon' => 'fa-legal', 'visible' => Yii::$app->user->can('/rbac/*'), 'active' => $moduleId === 'rbac', 'items' => [['label' => Yii::t('rbac-admin', 'Assignments'), 'url' => ['/rbac/assignment/index'], 'active' => $controllerPath === '/rbac/assignment'], ['label' => Yii::t('rbac-admin', 'Permissions'), 'url' => ['/rbac/permission/index'], 'active' => $controllerPath === '/rbac/permission'], ['label' => Yii::t('rbac-admin', 'Roles'), 'url' => ['/rbac/role/index'], 'active' => $controllerPath === '/rbac/role'], ['label' => Yii::t('rbac-admin', 'Routes'), 'url' => ['/rbac/route/index'], 'active' => $controllerPath === '/rbac/route'], ['label' => Yii::t('rbac-admin', 'Rules'), 'url' => ['/rbac/rule/index'], 'active' => $controllerPath === '/rbac/rule']]]]]); ?> </section> </aside> <?php //print_r(Yii::$app->i18n->translations);
use backend\modules\user\Module; use yii\grid\ActionColumn; use yii\helpers\Html; use backend\modules\pay\Pay; $module = new Module('user'); $this->title = Pay::t('pay-admin', 'Pays'); $this->params['subtitle'] = Pay::t('pay-admin', 'Choose a user'); $this->params['breadcrumbs'] = [$this->title]; $gridId = 'users-grid'; $gridConfig = ['id' => $gridId, 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'rowOptions' => function ($model) { $array = []; if ($model->profile->balance < 0) { $array['class'] = 'danger'; return $array; } }, 'columns' => [['label' => false, 'format' => 'image', 'value' => 'profile.fullAvatarUrl', 'contentOptions' => ['class' => 'grid-avatar']], 'profile.surname', 'profile.name', 'profile.middle_name', ['class' => ActionColumn::className(), 'header' => Module::t('user-admin', 'Actions'), 'headerOptions' => ['style' => 'width:55px;'], 'template' => '{pay}', 'buttons' => ['pay' => function ($url, $model) { $customurl = Yii::$app->getUrlManager()->createUrl(['/pay/default/create/', 'user_id' => $model->id]); return \yii\helpers\Html::a('<span class="fa fa-money"></span>', $customurl, ['title' => Pay::t('pay-admin', 'Pay'), 'data-pjax' => '0', 'class' => 'btn btn-default btn-xs']); }]]]]; ?> <div class="box box-primary"> <div class="box-header"> <div class="pull-right"> <?php echo Html::a('<i class="fa fa-list"></i>', ['index'], ['class' => 'btn btn-default btn-sm', 'title' => Pay::t('pay-admin', 'List')]); ?> </div> </div> <div class="box-body"> <?php echo GridView::widget($gridConfig);
/** * @inheritdoc */ public function attributeLabels() { return ['ids' => Module::t('timetable-admin', 'Classes'), 'date' => Module::t('timetable-admin', 'Date')]; }
?> </div> </div> <div class="box-body"> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'id' => $gridId, 'options' => ['class' => 'table-responsive'], 'filterModel' => $searchModel, 'rowOptions' => function ($model) { $array = []; if ($model->profile->balance < 0) { $array['class'] = 'danger'; return $array; } }, 'columns' => [['class' => CheckboxColumn::classname()], ['label' => false, 'format' => 'image', 'value' => 'profile.fullAvatarUrl', 'contentOptions' => ['class' => 'grid-avatar']], 'profile.surname', 'profile.name', 'profile.middle_name', ['attribute' => 'status', 'value' => function ($data) { return $data->statusArray[$data->status]; }, 'filter' => Html::activeDropDownList($searchModel, 'status', $statusArray, ['class' => 'form-control', 'prompt' => ''])], ['attribute' => 'created_at', 'format' => 'datetime', 'filterOptions' => ['class' => 'date-range-grid'], 'filter' => DateRangePicker::widget(['model' => $searchModel, 'attribute' => 'created_at', 'convertFormat' => true, 'presetDropdown' => true, 'options' => ['class' => 'form-control'], 'pluginOptions' => ['format' => 'Y-m-d H:i:s', 'dateLimit' => ['months' => 6], 'opens' => 'left']])], ['class' => 'yii\\grid\\ActionColumn', 'buttonOptions' => ['class' => 'btn btn-default btn-xs'], 'headerOptions' => ['style' => 'width:155px;'], 'header' => Module::t('user-admin', 'Actions'), 'template' => '{pay} {history} {view} {update} {delete}', 'buttons' => ['pay' => function ($url, $model) { $customurl = Yii::$app->getUrlManager()->createUrl(['/pay/default/create/', 'user_id' => $model->id]); return Yii::$app->user->can('/pay/*') ? \yii\helpers\Html::a('<span class="fa fa-money"></span>', $customurl, ['title' => Module::t('user-admin', 'Pay'), 'data-pjax' => '0', 'class' => 'btn btn-default btn-xs']) : ''; }, 'history' => function ($url, $model) { $customurl = Yii::$app->getUrlManager()->createUrl(['/pay/default/index/', 'PaySearch' => ['user_id' => $model->id]]); return Yii::$app->user->can('/pay/*') ? \yii\helpers\Html::a('<span class="fa fa-history"></span>', $customurl, ['title' => Module::t('user-admin', 'Payment history'), 'data-pjax' => '0', 'class' => 'btn btn-default btn-xs']) : ''; }]]]]); ?> </div> </div> </div>
</div> <div class="col-sm-3"> <?php echo $form->field($user, 'status')->dropDownList($user->getStatusArray(), ['prompt' => '']); ?> </div> <div class="col-sm-3"> <?php echo $form->field($profile, 'avatar_url')->widget(FileAPI::className(), ['crop' => true, 'cropResizeWidth' => 100, 'cropResizeHeight' => 100, 'settings' => ['url' => ['fileapi-upload'], 'imageSize' => ['minWidth' => 100, 'minHeight' => 100]]]); ?> </div> </div> </div> </div> <div class="form-group"> <?php echo Html::submitButton($user->isNewRecord ? Module::t('user-admin', 'Create') : Module::t('user-admin', 'Update'), ['class' => $user->isNewRecord ? 'btn btn-primary btn-large' : 'btn btn-success btn-large']); ?> </div> <?php ActiveForm::end(); ?> </div>
</div> <?php } if (Yii::$app->user->can('/user/*')) { ?> <div class="col-lg-3 col-md-4 col-xs-6"> <a class="btn btn-default btn-square-200px" href="<?php echo Url::toRoute('/user/default/debtor'); ?> "> <i class="fa fa-money fa-10x text-danger"> </i> <br/> <h4><?php echo User::t('user-admin', 'List debtors'); ?> </h4> </a> </div> <?php } if (Yii::$app->user->can('/timetable/*')) { ?> <div class="col-lg-3 col-md-4 col-xs-6"> <a class="btn btn-default btn-square-200px" href="<?php echo Url::toRoute('/timetable/default/view'); ?> "> <i class="fa fa-calendar fa-10x text-info">