[*] новые фичи 3

This commit is contained in:
rsgrinko committed 2022-04-27 19:17:35 +03:00
1 parent 436839ac9a
commit 7fc566430f
4 files changed
+174 -13

No files matched your search

+20 -13
View File
@@ -36,6 +36,9 @@
<li class="nav-item">
<a class="nav-link" href="/?clear_cache=Y">{{CLEAR_CACHE_LINK_NAME}}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/phpcmd.php">{{PHP_CMD_LINK_NAME}}</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
@@ -59,28 +62,32 @@
//echo str_replace('<table style="', '<table style="width:100%;', SystemFunctions::arrayToTable(Cache::getCacheInfo(), 'Информация о кэше'));
$count = (int)(DB::getInstance())->query('select count(*) as count from d_posts where post_type="post" and post_status="publish"')[0]['count'];
$count = (int)(DB::getInstance())->query('select count(*) as count from d_users')[0]['count'];
Pagination::execute($_REQUEST['page'], $count, 2);
$limit = Pagination::getLimit();
$arPosts = (DB::getInstance())->query('select * from d_posts where post_type="post" and post_status="publish" order by id desc limit ' . $limit);
$arData = (DB::getInstance())->query('select * from d_users order by id desc limit ' . $limit);
$arResult = [];
foreach($arPosts as $post) {
$arResult[$post['ID']] = [
'title' => $post['post_title'],
'postname' => $post['post_name'],
'date' => $post['post_date'],
'userId' => $post['post_author'],
'userName' => (new User((int)$post['post_author']))->getName()
$arResult = [];
foreach ($arData as $element) {
$arResult[$element['id']] = [
'id' => $element['id'],
'login' => $element['login'],
//'password' => $element['password'],
'access_level' => $element['access_level'],
'name' => $element['name'],
'email' => $element['email'],
'image' => $element['image'],
'token' => $element['token'],
'last_active' => $element['last_active'],
];
}
];
}
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>