<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()+",";