1
0
Fork 0
mirror of https://github.com/janickiy/yii2-nomer synced 2025-03-09 15:39:59 +00:00
yii2-nomer/modules/admin/views/stats/detailed.php
2020-02-05 06:34:26 +03:00

40 lines
1.1 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/* @var $this \yii\web\View */
/* @var $type integer */
/* @var $date string */
/* @var $filter string */
/* @var $dataProvider \yii\data\ActiveDataProvider */
use yii\grid\GridView;
use yii\helpers\Html;
use yii\helpers\Url;
use app\models\ResultCache;
$this->title = 'Статистика по ' . ResultCache::getTypeName($type) . ' за ' . $date;
echo Html::dropDownList('filter', $filter, [
'all' => 'Все',
'found' => 'Найден',
'not_found' => 'Не найден'
]);
echo GridView::widget([
'dataProvider' => $dataProvider,
'filterSelector' => 'select[name="filter"]',
'columns' => [
[
'format' => 'raw',
'header' => 'Номер телефона',
'value' => function ($row) {
return Html::a($row['phone'], Url::to('/' . preg_replace('/^7/', '8', $row['phone'])));
}
],
[
'header' => 'Найден',
'value' => function ($row) {
return $row['success'] ? 'Да' : 'Нет';
}
]
]
]);