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
43
modules/admin/views/sites/index.php
Normal file
43
modules/admin/views/sites/index.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $dataProvider \yii\data\ActiveDataProvider */
|
||||
|
||||
use yii\grid\ActionColumn;
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\Html;
|
||||
|
||||
$this->title = 'Список сайтов';
|
||||
|
||||
echo Html::tag('p', Html::a('Добавить сайт', ['sites/create'], ['class' => 'btn btn-primary']));
|
||||
|
||||
echo GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
'id',
|
||||
'name',
|
||||
'comment',
|
||||
'is_demo',
|
||||
[
|
||||
'header' => 'Платежи',
|
||||
'content' => function($model) use($payments) {
|
||||
return \Yii::$app->formatter->asCurrency(\yii\helpers\ArrayHelper::getValue($payments, [$model->id, "sum"], 0), "RUB");
|
||||
}
|
||||
],
|
||||
[
|
||||
'header' => 'Поиски',
|
||||
'content' => function($model) use($seaches) {
|
||||
return \yii\helpers\ArrayHelper::getValue($seaches, [$model->id, "count"], 0);
|
||||
}
|
||||
],
|
||||
[
|
||||
'class' => ActionColumn::className(),
|
||||
'template' => '{update} {delete}',
|
||||
'buttons' => [
|
||||
'set-demo' => function ($url, $model, $key) {
|
||||
return $model->is_demo ? Html::a('Выключить demo', ['set-demo', 'id' => $model->id], ['class' => 'btn btn-danger']) : Html::a('Включить demo', ['set-demo', 'id' => $model->id], ['class' => 'btn btn-success']);
|
||||
}
|
||||
]
|
||||
],
|
||||
]
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue