Files
Admin Nasledstvo ac168868ee Initial import
2026-05-01 20:52:04 +03:00

59 lines
1.6 KiB
PHP

<?php
use app\models\History;
use app\models\Subscriptions;
use app\models\TourObjects;
use app\widgets\FormWidget;
use app\widgets\services\Includes;
use app\widgets\TableWidget;
$tab = $_GET['tab'] ?? 'main';
$_GET['tab'] = $tab;
$filter = Yii::$app->getFilterData('and');
$filter[0] = 'and';
TableWidget::widget([
'top' => [
'title' => 'Хронология',
'data' => [
'index/dashboard' => 'Начало',
]
],
//'filter' => [
// [
// 'name' => ['Име на туристическия обект', 'c4'],
// ],
//],
'actions' => [],
'th' => [
'№' => 'c0 text-right',
'Потребител' => '',
'Действие' => '',
'Какво' => '',
'Дата и час' => '',
],
'model' => History::class,
'data' => History::find()->where(Yii::$app->getFilterData('and'))->orderBy(['date_time' => SORT_DESC])->loop([
'id',
'user',
function (History $h) {
switch ($h->action) {
case 1:
return '<span style="color: cornflowerblue; font-weight: bold"><i class="la la-plus-circle"></i> Въвеждане</span>';
case 2:
return '<span style="color: #228827; font-weight: bold"><i class="la la-pencil-square-o"></i> Редакция</span>';
}
},
function(History $h) {
return $h->table_name.' ID:'.$h->history_id;
},
function (History $h) {
return $h->formatDate($h->date_time, 'd.m.Y H:i');
}
], $_GET['p'] ?? 1, 50)
]);