Ejemplo n.º 1
0
<?php

use yii\helpers\Html;
use app\modules\admin\modules\users\Module;
/* @var $this yii\web\View */
/* @var $model app\modules\admin\modules\users\models\User */
$this->title = Module::t('module', 'TITLE_CREATE');
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN'), 'url' => ['/admin/default/index']];
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN_USERS'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="admin-users-default-create">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <?php 
echo $this->render('_form', ['model' => $model]);
?>

</div>
Ejemplo n.º 2
0
use app\components\grid\LinkColumn;
use app\modules\admin\modules\users\models\User;
use kartik\date\DatePicker;
use app\modules\admin\modules\users\Module;
/* @var $this yii\web\View */
/* @var $searchModel \app\modules\admin\modules\users\models\search\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Module::t('module', 'ADMIN_USERS');
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN'), 'url' => ['/admin/default/index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="admin-users-default-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <?php 
$gridColumn = [['class' => 'yii\\grid\\SerialColumn'], ['filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_from', 'attribute2' => 'date_to', 'type' => DatePicker::TYPE_RANGE, 'separator' => '<i class="glyphicon glyphicon-arrow-right"></i>', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]), 'attribute' => 'created_at', 'format' => ['date', 'php:d M Y г., H:i:s']], ['class' => LinkColumn::className(), 'attribute' => 'username'], 'email:email', ['class' => SetColumn::className(), 'filter' => User::getStatusesArray(), 'attribute' => 'status', 'name' => 'statusName', 'cssCLasses' => [User::STATUS_ACTIVE => 'success', User::STATUS_WAIT => 'warning', User::STATUS_BLOCKED => 'default']], ['filter' => User::getRolesArray(), 'attribute' => 'role', 'value' => 'RoleName'], ['class' => ActionColumn::className()]];
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumn, 'responsive' => true, 'hover' => true, 'pjax' => false, 'resizableColumns' => true, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['class' => 'btn btn-default', 'title' => Module::t('module', 'RESET_GRID')])], '{toggleData}'], 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-user"></i> ' . Html::encode($this->title) . '</h3>', 'type' => 'primary', 'before' => Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Module::t('module', 'BUTTON_CREATE'), ['create'], ['class' => 'btn btn-success', 'data-pjax' => 0])]]);
?>

</div>
Ejemplo n.º 3
0
<?php

use yii\helpers\Html;
use app\modules\admin\modules\users\Module;
/* @var $this yii\web\View */
/* @var $model app\modules\admin\modules\users\models\User */
$this->title = $model->username;
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN'), 'url' => ['/admin/default/index']];
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN_USERS'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->username, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Module::t('module', 'TITLE_UPDATE');
?>
<div class="admin-users-default-update">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <?php 
echo $this->render('_form', ['model' => $model]);
?>

</div>
Ejemplo n.º 4
0
use app\modules\admin\modules\users\models\User;
use app\modules\admin\modules\users\Module;
/* @var $this yii\web\View */
/* @var $model app\modules\admin\modules\users\models\User */
$this->title = $model->username;
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN'), 'url' => ['/admin/default/index']];
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN_USERS'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="admin-users-default-view">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a(Module::t('module', 'BUTTON_UPDATE'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a(Module::t('module', 'BUTTON_DELETE'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Module::t('module', 'CONFIRM_DELETE'), 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'username', 'email:email', ['attribute' => 'status', 'format' => 'raw', 'value' => $model->getDetailStatusTitle($model->status)], ['attribute' => 'created_at', 'format' => ['date', 'php:d M Y г., H:i:s']], ['attribute' => 'updated_at', 'format' => ['date', 'php:d M Y г., H:i:s']], ['attribute' => 'role', 'value' => $model->getRoleName()]]]);
?>

</div>
Ejemplo n.º 5
0
echo $form->field($model, 'email')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'newPassword')->passwordInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'newPasswordRepeat')->passwordInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'status')->dropDownList(User::getStatusesArray());
?>

    <?php 
echo $form->field($model, 'role')->dropDownList(User::getRolesArray());
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Module::t('module', 'BUTTON_CREATE') : Module::t('module', 'BUTTON_SAVE'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>