Initial import

This commit is contained in:
Admin Nasledstvo
2026-05-01 20:52:04 +03:00
commit ac168868ee
10028 changed files with 2337954 additions and 0 deletions
@@ -0,0 +1,86 @@
<?php
use app\models\UserAdminGlobal;
use app\models\UserPublic;
use app\services\Auth;
use app\widgets\FormWidget;
use app\widgets\TableWidget;
$filter = [];
$filter['is_mobile_user'] = 1;
$u = Auth::userAdminGlobal();
TableWidget::widget([
'filter' => [
['email' => ['Ел. поща', 'c3']]
],
'top' => [
'title' => 'Потребители мобилно приложение',
'data' => [
'index/dashboard' => 'Начало',
'mobile-app/become-an-explorer-objects' => 'Мобилно приложение',
]
],
'actions' => [
//'new' => 'Нов потребител',
//'edit' => 'Редакция потребител',
//'delete' => 'Изтриване потребител',
'export' => 'Експорт (csv)'
],
'th' => [
'№' => 'c0 text-right',
'Ел. поща' => 'c3',
'Име' => '',
'Клубна карта' => 'c1 ct',
'Бр. точки' => 'c1 ct',
'Активен' => 'c02 ct'
],
'data' => UserPublic::find()->where($filter)->andWhere(Yii::$app->getFilterData())->orderBy(['id' => SORT_DESC])->loop([
'id',
function (UserPublic $model) {
return '<a href="?o=w&id=' . $model->id . '">' . $model->email . '</a>';
},
'full_name',
function (UserPublic $model) {
return $model->club_card ? '<span style="color: green">да</span>' : '<span style="color: darkred">не</span>';
},
function (UserPublic $model) {
return $model->getExplorerObjectsSumPoints();
},
function (UserPublic $model) {
return $model->statusSwitch('is_active', null, ['Потребителя е активиран', 'Потребителя е деактивиран']);
},
], $_GET['p'] ?? 1, 30),
//'ignoreIds' => [$u->id],
'exportData' => function () {
return [
'header' => [
'ID' => ['integer', 10],
'E-mail' => ['string', 50],
'Име и фамилия' => ['string', 50],
],
'data' => UserPublic::find()->where(Yii::$app->getFilterData())->orderBy(['full_name' => SORT_ASC])->loop([
'id',
'full_name',
'email',
]),
'file_name' => 'Потребители_публичен_портал' . date('Y_m_d_H_i')
];
}
]);
FormWidget::widget([
'top' => [
'title' => 'Потребител',
'title_edit' => 'Преглед на потребител',
'data' => [
'index/dashboard' => 'Начало',
'mobile-app/become-an-explorer-objects' => 'Мобилно приложение',
'mobile-app/users' => 'Потребители',
]
],
'writeView' => 'mobile-app/tabs/main/public-user_w',
'model' => UserPublic::class,
]);