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
29
modules/admin/views/settings/_bans.php
Normal file
29
modules/admin/views/settings/_bans.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $dataProvider \yii\data\ActiveDataProvider */
|
||||
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\Url;
|
||||
use yii\helpers\Html;
|
||||
use app\models\User;
|
||||
|
||||
echo GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
'id',
|
||||
[
|
||||
'format' => 'raw',
|
||||
'attribute' => 'email',
|
||||
'value' => function(User $model) {
|
||||
return Html::a($model->email, Url::toRoute(['users/view', 'id' => $model->id]));
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'ban',
|
||||
'value' => function(User $model) {
|
||||
return User::getBanStatusText($model->ban);
|
||||
}
|
||||
]
|
||||
]
|
||||
]);
|
31
modules/admin/views/settings/_blocked_phones.php
Normal file
31
modules/admin/views/settings/_blocked_phones.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $phones array */
|
||||
|
||||
$count = array_reduce($phones, function($acc, $data) {
|
||||
return [
|
||||
'all' => $acc['all'] += $data['all'],
|
||||
'unconfirmed' => $acc['unconfirmed'] += $data['confirmed'],
|
||||
'confirmed' => $acc['confirmed'] += $data['confirmed'],
|
||||
'vip' => $acc['vip'] += $data['vip']
|
||||
];
|
||||
}, ['all' => 0, 'unconfirmed' => 0, 'confirmed' => 0, 'vip' => 0]);
|
||||
|
||||
?>
|
||||
|
||||
<h3>Всего заблокировано <?= $count['all'] ?> номеров. Подтверждено: <?= $count['confirmed'] ?>. VIP <?= $count['vip'] ?></h3>
|
||||
|
||||
<table class="table table-striped table-bordered">
|
||||
<tr>
|
||||
<th>Дата</th>
|
||||
<th>Количество заблокированных мномеров</th>
|
||||
</tr>
|
||||
|
||||
<?php foreach ($phones as $date => $data): ?>
|
||||
<tr>
|
||||
<td><?= $date ?></td>
|
||||
<td>Всего: <?= $data['all'] ?>, подтверждено: <?= $data['confirmed'] ?>, VIP: <?= $data['vip'] ?>.</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
44
modules/admin/views/settings/_domains.php
Normal file
44
modules/admin/views/settings/_domains.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $model \app\models\UrlFilter */
|
||||
/* @var $dataProvider \yii\data\ActiveDataProvider */
|
||||
|
||||
use app\models\UrlFilter;
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
?>
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'url')->textInput() ?>
|
||||
<?= $form->field($model, 'type')->dropDownList(UrlFilter::getTypes()) ?>
|
||||
<?= Html::submitButton('Добавить', ['class' => 'btn btn-success']) ?>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
<hr>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
'id',
|
||||
'url',
|
||||
[
|
||||
'attribute' => 'type',
|
||||
'value' => function(UrlFilter $model) {
|
||||
return UrlFilter::typeText($model->type);
|
||||
}
|
||||
],
|
||||
[
|
||||
'format' => 'raw',
|
||||
'header' => 'Действия',
|
||||
'value' => function(UrlFilter $model) {
|
||||
return '<a href="' . Url::to(['settings/delete-domain', 'id' => $model->id]) . '" onclick="return confirm(\'Удалить домен?\')"><i class="icon-trash"></i></a>';
|
||||
}
|
||||
]
|
||||
]
|
||||
]) ?>
|
35
modules/admin/views/settings/_fingerprints.php
Normal file
35
modules/admin/views/settings/_fingerprints.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $dataProvider \yii\data\ActiveDataProvider */
|
||||
|
||||
use yii\grid\GridView;
|
||||
use app\models\UserFingerprint;
|
||||
use \app\models\User;
|
||||
use \yii\helpers\ArrayHelper;
|
||||
|
||||
echo GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
'hash',
|
||||
[
|
||||
'attribute' => 'user_ids',
|
||||
'header' => 'Пользователи',
|
||||
'value' => function ($data) {
|
||||
$userIds = trim(ArrayHelper::getValue($data, 'user_ids'), '{}');
|
||||
$userIds = preg_split('/,/', $userIds);
|
||||
$users = User::find()->where(['id' => $userIds])->all();
|
||||
return join(', ', ArrayHelper::getColumn($users, 'email'));
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'ips',
|
||||
'header' => 'IP адреса',
|
||||
'value' => function ($data) {
|
||||
$ips = trim(ArrayHelper::getValue($data, 'ips'), '{}');
|
||||
$ips = preg_split('/,/', $ips);
|
||||
return join(', ', $ips);
|
||||
}
|
||||
],
|
||||
]
|
||||
]);
|
73
modules/admin/views/settings/_search_index.php
Normal file
73
modules/admin/views/settings/_search_index.php
Normal file
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
|
||||
use yii\helpers\Html;
|
||||
use app\models\Settings;
|
||||
|
||||
?>
|
||||
|
||||
<?= Html::beginForm() ?>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th colspan="2">Индексы поиска</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска оператора</td>
|
||||
<td><?=Html::textInput('search_index_operator', Settings::get('search_index_operator', 0), ['class' => 'form-control']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска фото в Viber</td>
|
||||
<td><?=Html::textInput('search_index_viber', Settings::get('search_index_viber', 7), ['class' => 'form-control']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска во ВКонтакте VIP</td>
|
||||
<td><?=Html::textInput('search_index_vk_vip', Settings::get('search_index_vk_vip', 0), ['class' => 'form-control']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска во ВКонтакте</td>
|
||||
<td><?=Html::textInput('search_index_vk', Settings::get('search_index_vk', 15), ['class' => 'form-control']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска в Facebook</td>
|
||||
<td><?=Html::textInput('search_index_fb', Settings::get('search_index_fb', 15), ['class' => 'form-control']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска по Avito</td>
|
||||
<td><?=Html::textInput('search_index_avito', Settings::get('search_index_avito', 15), ['class' => 'form-control']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска в Google</td>
|
||||
<td><?= Html::textInput('search_index_google', Settings::get('search_index_google', 7), ["class" => 'form-control']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска по Auto.ru</td>
|
||||
<td><?= Html::textInput('search_index_avinfo', Settings::get('search_index_avinfo', 15), ['class' => 'form-control']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска в Sprut</td>
|
||||
<td><?= Html::textInput('search_index_sprut', Settings::get('search_index_sprut', 0), ['class' => 'form-control']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска в Truecaller</td>
|
||||
<td><?= Html::textInput('search_index_truecaller', Settings::get('search_index_truecaller', 15), ['class' => 'form-control']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска в Numbuster</td>
|
||||
<td><?= Html::textInput('search_index_numbuster', Settings::get('search_index_numbuster', 15), ['class' => 'form-control']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска в Инстаграмме</td>
|
||||
<td><?= Html::textInput('search_index_instagram', Settings::get('search_index_instagram', 20), ['class' => 'form-control']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска в Антипарконе</td>
|
||||
<td><?= Html::textInput('search_index_antiparkon', Settings::get('search_index_antiparkon', 5), ['class' => 'form-control']) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Индекс поиска в Телеграмме</td>
|
||||
<td><?= Html::textInput('search_index_telegram', Settings::get('search_index_telegram', 7), ['class' => 'form-control']) ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
<?= Html::endForm() ?>
|
55
modules/admin/views/settings/index.php
Normal file
55
modules/admin/views/settings/index.php
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $tab string */
|
||||
/* @var $model \yii\db\ActiveRecord */
|
||||
/* @var $dataProvider \yii\data\ActiveDataProvider */
|
||||
|
||||
use yii\bootstrap\Tabs;
|
||||
use yii\helpers\Url;
|
||||
|
||||
$this->title = 'Настройки';
|
||||
|
||||
echo Tabs::widget([
|
||||
'id' => 'SettingsTabsWidget',
|
||||
'renderTabContent' => false,
|
||||
'items' => [
|
||||
[
|
||||
'label' => 'Индексы поиска',
|
||||
'url' => Url::toRoute(['settings/index', 'tab' => 'index']),
|
||||
'active' => $tab == 'index'
|
||||
],
|
||||
[
|
||||
'label' => 'Заблокированные пользователи',
|
||||
'url' => Url::toRoute(['settings/index', 'tab' => 'bans']),
|
||||
'active' => $tab == 'bans'
|
||||
],
|
||||
[
|
||||
'label' => 'Домены',
|
||||
'url' => Url::toRoute(['settings/index', 'tab' => 'domains']),
|
||||
'active' => $tab == 'domains'
|
||||
],
|
||||
[
|
||||
'label' => 'Статистика по фингерпринтам',
|
||||
'url' => Url::toRoute(['settings/index', 'tab' => 'fingerprints']),
|
||||
'active' => $tab == 'fingerprints'
|
||||
],
|
||||
[
|
||||
'label' => 'Заблокированные номера',
|
||||
'url' => Url::toRoute(['settings/index', 'tab' => 'blocked-phones']),
|
||||
'active' => $tab == 'blocked-phones'
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
echo '<div class="tab-content">';
|
||||
|
||||
switch ($tab) {
|
||||
case 'index': echo $this->render('_search_index'); break;
|
||||
case 'bans': echo $this->render('_bans', compact('dataProvider')); break;
|
||||
case 'domains': echo $this->render('_domains', compact('model', 'dataProvider')); break;
|
||||
case 'fingerprints': echo $this->render('_fingerprints', compact('dataProvider')); break;
|
||||
case 'blocked-phones': echo $this->render('_blocked_phones', compact('phones')); break;
|
||||
}
|
||||
|
||||
echo '</div>';
|
Loading…
Add table
Add a link
Reference in a new issue