добавлена лицензия в PHP файлы

This commit is contained in:
rsgrinko committed 2022-07-15 00:29:53 +03:00
1 parent 4f1275727b
commit f99506e117
52 files changed
+2082 -1055

No files matched your search

+69 -51
View File
@@ -1,4 +1,23 @@
<?php
/**
* Copyright (c) 2022 Roman Grinko <rsgrinko@gmail.com>
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
use Core\CoreException;
use Core\ExternalServices\Telegram;
@@ -7,7 +26,7 @@
const USE_ROUTER = true;
require_once $_SERVER['DOCUMENT_ROOT'] . '/core/bootstrap.php';
?>
?>
<!doctype html>
<html lang="ru">
<head>
@@ -22,7 +41,8 @@
<nav class="navbar navbar-expand-md navbar-dark bg-dark" aria-label="Fourth navbar example">
<div class="container-fluid">
<a class="navbar-brand" href="#">Delta Framework</a>
<button class="navbar-toggler collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample04" aria-controls="navbarsExample04" aria-expanded="false" aria-label="Toggle navigation">
<button class="navbar-toggler collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample04"
aria-controls="navbarsExample04" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
@@ -50,49 +70,53 @@
</nav>
<div class="container">
<div class="row justify-content-md-center">
<div class="col-md">
<?php
echo $_REQUEST['route'] . '<br>';
if (User::isAuthorized()) {
global $USER;
echo str_replace('<table style="', '<table style="width:100%;', SystemFunctions::arrayToTable($USER->getAllUserData(), 'Информация о пользователе'));
}
<?php
echo $_REQUEST['route'] . '<br>';
if (User::isAuthorized()) {
global $USER;
echo str_replace(
'<table style="',
'<table style="width:100%;',
SystemFunctions::arrayToTable($USER->getAllUserData(), 'Информация о пользователе')
);
}
//echo str_replace('<table style="', '<table style="width:100%;', SystemFunctions::arrayToTable(Cache::getCacheInfo(), 'Информация о кэше'));
//echo str_replace('<table style="', '<table style="width:100%;', SystemFunctions::arrayToTable(Cache::getCacheInfo(), 'Информация о кэше'));
$count = (int)(DB::getInstance())->query('select count(*) as count from users')[0]['count'];
Pagination::execute($_REQUEST['page'], $count, 2);
$limit = Pagination::getLimit();
$count = (int)(DB::getInstance())->query('select count(*) as count from users')[0]['count'];
Pagination::execute($_REQUEST['page'], $count, 2);
$limit = Pagination::getLimit();
$arData = (DB::getInstance())->query('select * from users order by id desc limit ' . $limit);
$arData = (DB::getInstance())->query('select * from users order by id desc limit ' . $limit);
$arResult = [];
foreach ($arData as $element) {
//(new User($element['id']))->addToGroup(2);
$arResult[$element['id']] = [
'id' => $element['id'],
'login' => $element['login'],
//'password' => $element['password'],
'name' => $element['name'],
'email' => $element['email'],
'image' => $element['image'],
'token' => $element['token'],
'last_active' => $element['last_active'],
'groups' => array_map(function($element){ return Roles::getAllRoles()[$element]; }, (new User($element['id']))->getRolesObject()->getRoles()),
//'groups_human' => User::getAllGroups(),
$arResult = [];
foreach ($arData as $element) {
//(new User($element['id']))->addToGroup(2);
$arResult[$element['id']] = [
'id' => $element['id'],
'login' => $element['login'],
//'password' => $element['password'],
'name' => $element['name'],
'email' => $element['email'],
'image' => $element['image'],
'token' => $element['token'],
'last_active' => $element['last_active'],
'groups' => array_map(function ($element) {
return Roles::getAllRoles()[$element];
}, (new User($element['id']))->getRolesObject()->getRoles()),
//'groups_human' => User::getAllGroups(),
];
}
echo '<nav aria-label="Page navigation example">';
Pagination::show('page');
echo '</nav>';
];
}
echo '<nav aria-label="Page navigation example">';
Pagination::show('page');
echo '</nav>';
echo str_replace('<table style="', '<table style="width:100%;', SystemFunctions::arrayToTable($arResult, 'Пользователи'));
?>
echo str_replace('<table style="', '<table style="width:100%;', SystemFunctions::arrayToTable($arResult, 'Пользователи'));
?>
</div>
</div>
</div>
@@ -107,26 +131,20 @@ echo str_replace('<table style="', '<table style="width:100%;', SystemFunctions:
</ul>
<?php
$finish_time = microtime(true);
$delta = round($finish_time - START_TIME, 3);
$delta = round($finish_time - START_TIME, 3);
if ($delta < 0.001) {
$delta = 0.001;
}
$cacheSize = Cache::getCacheSize();
echo '<p class="text-center text-muted">Использовано ОЗУ: '
. round(memory_get_usage() / 1024 / 1024, 2)
. ' МБ / БД: '
. round(DB::$workingTime, 3)
. ' сек ('
. DB::$quantity
. ' шт.) / Кэш: '
. Files::convertBytes($cacheSize)
. ' / Генерация: '
. $delta
. ' сек</p>';
echo '<p class="text-center text-muted">Использовано ОЗУ: ' . round(memory_get_usage() / 1024 / 1024, 2) . ' МБ / БД: ' . round(
DB::$workingTime,
3
) . ' сек (' . DB::$quantity . ' шт.) / Кэш: ' . Files::convertBytes($cacheSize) . ' / Генерация: ' . $delta . ' сек</p>';
?>
<p class="text-center text-muted">© <?=date('Y');?> Delta Project</p>
<p class="text-center text-muted">© <?= date('Y'); ?> Delta Project</p>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</body>
</html>