8 isset(
$user) or require
$_SERVER[
'DOCUMENT_ROOT'] .
'/page/404.php';
12 <div
class=
"table-responsive p-2">
13 <table
id=
"table-users" class=
"table table-hover table-striped table-bordered table-sm text-nowrap small" style=
"width:100%">
14 <thead
class=
"bg-info text-center">
17 <th style=
"max-width:250px;">Группы доступа</th>
18 <th>Группа владелец</th>
20 <th>Время онлайна</th>
21 <th>Время регистрации</th>
23 <th>Крайний Request</th>
24 <th data-name=
"Email"><span
class=
"fa fa-at"></span></th>
26 <th style=
"max-width:200px;">Комментарий</th>
28 <th data-name=
"Вкл / выкл" style=
"width:60px;"><i
class=
"fa fa-power-off"></i></th>
29 <th data-name=
"Удалить" style=
"width: 25px;"><i
class=
"fa fa-trash"></i></th>
37 window.dataTablesConfigs[0].ajax =
'<?= Wrong\Models\Selects::find(7)->request ?>';
38 window.dataTablesConfigs[0].columnDefs = [{
40 targets: [8, 11, 12, 13]
42 window.dataTablesConfigs[0].initComplete =
function() {
43 $(
'#table-users_length label').append(
'<button class="btn btn-outline-primary btn-sm" data-toggle="modal" data-target="#add-user" style="font-size:12px;margin-left:7px;"><i class="fa fa-plus-circle"></i> Добавить</button><button class="btn btn-outline-primary btn-sm autoupdate" data-toggle="button" title="Автообновление таблицы" style="font-size:12px;margin-left:5px;"><i class="fa fa-play"></i></button><button class="btn btn-outline-primary btn-sm" data-toggle="modal" data-target="#hide-table-cols" title="Видимость колонок таблицы <b>' + $(
'title').text() +
'</b>" style="font-size:12px;margin-left:5px;"><i class="fa fa-table"></i></button><button class="btn btn-outline-primary btn-sm" data-toggle="modal" data-target="#view-page" data-uri="//wrong-mvc.com/docs/models.html#users" title="Документация" style="font-size:12px;margin-left:5px;"><i class="fa fa-question-circle"></i></button>');
45 $(
'#table-users_filter label').append(
'<button title="Фильтр" data-target="#filter" data-table="users" data-toggle="modal" class="btn btn-outline-primary btn-sm text-nowrap" style="font-size:12px;margin-left:5px;"><i class="fa fa-filter"></i></button><button id="reset-filter" data-action="filter" data-reset="true" data-table="users" data-callback="afterResetFilter" title="Сбросить фильтр" class="btn btn-warning btn-sm text-nowrap" style="font-size:12px;margin-left:5px;display:<?= isset($_SESSION['filter
']['users
']) ? 'inline-block
' : 'none
' ?>;"><i class="fa fa-close"></i></button>');
47 window.autoupdate = window.localStorage.autoupdate ? JSON.parse(window.localStorage.autoupdate) : {};
48 if (window.autoupdate[location.pathname]) {
49 $(
'.autoupdate').trigger(
'click');
52 $(
'#table-users').DataTable(window.dataTablesConfigs[0]);
55 function fromUser(response) {
57 errorToast(response.error);
60 $.getScript(
'/api/action/stackjs');
63 function toggledApi(response) {
65 errorToast(response.error);
68 $(
'#tgl-api-' + response.id).prop({
69 'checked': response.act
71 $(
'.toast').toast(
'hide');
73 dangerToast(response.message);
75 successToast(response.message);
78 $(
'.dataTable').DataTable().ajax.reload(
null,
false);
82 $(document).on(
'click',
'.autoupdate',
function() {
83 $(
this).find(
'.fa').toggleClass([
'fa-play',
'fa-stop']);
84 window.autoupdate[location.pathname] = $(
'.autoupdate').is(
'.active');
85 window.localStorage.autoupdate = JSON.stringify(window.autoupdate);
89 $(
'.autoupdate').is(
'.active') && $(
'.dataTable').DataTable().ajax.reload(
null,
false);
setcookie('FROM_UID', $uid, [ 'expires'=> time()+31536000, 'path'=> '/', 'domain'=> $_SERVER['HTTP_HOST'], 'secure'=> Wrong\Start\Env::$e->IS_SECURE, 'httponly'=> false, 'samesite'=> Wrong\Start\Env::$e->IS_SECURE ? 'None' :'Lax']) or setcookie('FROM_UID' $_SERVER['HTTP_HOST']