mirror of
https://github.com/janickiy/yii2-nomer
synced 2025-03-09 15:39:59 +00:00
add files to project
This commit is contained in:
commit
5cac498444
3729 changed files with 836998 additions and 0 deletions
55
modules/admin/views/tokens/index.php
Normal file
55
modules/admin/views/tokens/index.php
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $model \app\models\Token */
|
||||
/* @var $dataProvider \yii\data\ActiveDataProvider */
|
||||
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
use yii\widgets\ActiveForm;
|
||||
use app\models\Token;
|
||||
|
||||
$this->title = 'Токены';
|
||||
|
||||
?>
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'token')->textInput() ?>
|
||||
<?= $form->field($model, 'type')->dropDownList(Token::getTypes()) ?>
|
||||
<?= $form->field($model, 'server_id')->textInput(['type' => 'number']) ?>
|
||||
<?= Html::submitButton('Добавить', ['class' => 'btn btn-success']) ?>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
<hr>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
'id',
|
||||
[
|
||||
'attribute' => 'type',
|
||||
'value' => function (Token $model) {
|
||||
return Token::getTypeName($model->type);
|
||||
}
|
||||
],
|
||||
'server_id',
|
||||
'token',
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'value' => function (Token $model) {
|
||||
return Token::getStatusName($model->status);
|
||||
}
|
||||
],
|
||||
'tm_ban',
|
||||
[
|
||||
'format' => 'raw',
|
||||
'header' => 'Действия',
|
||||
'value' => function(Token $model) {
|
||||
return '<a href="' . Url::to(['tokens/delete', 'id' => $model->id]) . '" onclick="return confirm(\'Удалить токен?\')"><i class="icon-trash"></i></a>';
|
||||
}
|
||||
]
|
||||
]
|
||||
]) ?>
|
Loading…
Add table
Add a link
Reference in a new issue