<div class="page-header"> <h1><?php echo Html::encode($this->title); ?> </h1> </div> <div class="row"> <?php $form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'options' => ['enctype' => 'multipart/form-data']]); ?> </div> <?php echo $form->field($model, 'role_name')->dropDownList(app\models\Role::dropdown()); ?> <table class="table"> <tr> <th>Name</th> <?php foreach ($methods as $method) { echo '<th>' . $method . ' <input onclick="checkthis(\'' . $method . '\')" type="checkbox" id="all' . $method . '" ></th>'; } ?> </tr> <?php foreach ($controllers as $controller) { ?> <tr>
<h1><?php echo Html::encode($this->title); ?> </h1> </div> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?php $toolbars = [['content' => Html::a('<i class="glyphicon glyphicon-plus"></i>', ['user/create'], ['type' => 'button', 'title' => 'Add ' . $this->title, 'class' => 'btn btn-success']) . ' ' . Html::a('<i class="fa fa-file-excel-o"></i>', ['user/parsing'], ['type' => 'button', 'title' => 'Parsing Excel ' . $this->title, 'class' => 'btn btn-warning']) . ' ' . Html::button('<i class="fa fa-download"></i>', ['type' => 'button', 'title' => 'Excel Backup ' . $this->title, 'class' => 'btn btn-default', 'id' => 'backupExcel']) . ' ' . Html::button('<i class="glyphicon glyphicon-trash"></i>', ['type' => 'button', 'title' => 'Delete Selected ' . $this->title, 'class' => 'btn btn-danger', 'id' => 'deleteSelected']) . ' ' . Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['user/index', 'p_reset' => true], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Reset Grid']) . ' '], ['content' => '{dynagridFilter}{dynagridSort}{dynagrid}'], '{export}']; $panels = ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-book"></i> ' . $this->title . '</h3>', 'before' => '<div style="padding-top: 7px;"><em>* The table at the right you can pull reports & personalize</em></div>']; $columns = [['class' => 'kartik\\grid\\SerialColumn', 'order' => DynaGrid::ORDER_FIX_LEFT], 'id', ['attribute' => 'avatar', 'format' => 'html', 'value' => function ($data) { return $data->thumb; }], 'username', 'email:email', 'name', 'phone', 'city', ['attribute' => 'roleId', 'filter' => app\models\Role::dropdown(), 'value' => function ($data) { return $data->roles->name; }], ['class' => 'kartik\\grid\\BooleanColumn', 'attribute' => 'status', 'vAlign' => 'middle'], 'position', 'createDate', 'updateDate', ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => false, 'vAlign' => 'middle', 'viewOptions' => ['title' => 'view', 'data-toggle' => 'tooltip'], 'updateOptions' => ['title' => 'update', 'data-toggle' => 'tooltip'], 'deleteOptions' => ['title' => 'delete', 'data-toggle' => 'tooltip']], ['class' => '\\kartik\\grid\\CheckboxColumn', 'checkboxOptions' => ['class' => 'simple'], 'rowSelectedClass' => GridView::TYPE_SUCCESS]]; $dynagrid = DynaGrid::begin(['id' => 'user-grid', 'columns' => $columns, 'theme' => 'panel-primary', 'showPersonalize' => true, 'storage' => 'db', 'allowSortSetting' => true, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'showPageSummary' => true, 'floatHeader' => true, 'pjax' => true, 'panel' => $panels, 'toolbar' => $toolbars], 'options' => ['id' => 'User' . Yii::$app->user->identity->id]]); DynaGrid::end(); ?> </div> <?php $this->registerJs('$(document).on("click", "#backupExcel", function(){ var myUrl = window.location.href; location.href=myUrl.replace(/index/gi, "excel"); ; });$("#deleteSelected").on("click",function(){ var array = ""; $(".simple").each(function(index){ if($(this).prop("checked")){ array += $(this).val()+",";
<?php use yii\helpers\Html; use yii\grid\GridView; /* @var $this yii\web\View */ /* @var $dataProvider yii\data\ActiveDataProvider */ ?> <?php // если пользователь модератор if (Yii::$app->user->identity->role_id == app\models\Role::getIdByName('moderator')) { $this->title = 'Статьи'; } else { $this->title = 'Мои статьи'; } ?> <div class="news-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'title', 'slug', ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>
$this->beginBlock('main'); ?> <p> <?php echo $form->field($model, 'username')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'password')->passwordInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'role_id')->dropDownList(\yii\helpers\ArrayHelper::map(app\models\Role::find()->all(), 'id', 'name'), ['prompt' => 'Select']); ?> <?php echo $form->field($model, 'photo_url')->widget(\kartik\file\FileInput::className(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'png', 'jpeg', 'gif', 'bmp'], 'maxFileSize' => 250]]); ?> <?php if ($model->photo_url != null) { ?> <div class="form-group"> <div class="col-sm-6 col-sm-offset-3"> <?php echo Html::img(["uploads/" . $model->photo_url], ["width" => "150px"]); ?> </div> </div> <?php
echo Html::encode($this->title); ?> </title> <?php $this->head(); ?> </head> <body> <?php $this->beginBody(); ?> <div class="wrap"> <?php NavBar::begin([]); echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => [['label' => 'Home', 'url' => ['/news/index']], !Yii::$app->user->isGuest && Yii::$app->user->identity->role_id == app\models\Role::getIdByName('moderator') ? ['label' => 'Панель администратора', 'items' => [['label' => 'Профили пользователей', 'url' => ['/user/index']], ['label' => 'Неопубликованные статьи', 'url' => ['/news/unpublished']]]] : ['label' => '', 'visible' => FALSE], !Yii::$app->user->isGuest && Yii::$app->user->identity->role_id == app\models\Role::getIdByName('writer') ? ['label' => 'Мой профиль', 'items' => [['label' => 'Редактировать профиль', 'url' => ['/user/' . Yii::$app->user->identity->id]], ['label' => 'Мои статьи', 'url' => ['/news/articles/' . Yii::$app->user->identity->id]]]] : ['label' => '', 'visible' => FALSE], Yii::$app->user->isGuest ? ['label' => 'Login', 'url' => ['/news/login']] : ['label' => 'Logout (' . Yii::$app->user->identity->email . ')', 'url' => ['/news/logout'], 'linkOptions' => ['data-method' => 'post']]]]); NavBar::end(); ?> <div class="container"> <?php echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]); ?> <?php echo $content; ?> </div> </div> <?php $this->endBody(); ?>