AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.145.163.148
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/bitrix/www/bitrix/modules/perfmon/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/modules/perfmon/admin/perfmon_history.php
<?php
use Bitrix\Main\Loader;

define('ADMIN_MODULE_NAME', 'perfmon');
define('PERFMON_STOP', true);
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_admin_before.php';
/** @var CMain $APPLICATION */
/** @var CDatabase $DB */
/** @var CUser $USER */
Loader::includeModule('perfmon');
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/perfmon/prolog.php';

IncludeModuleLangFile(__FILE__);

$RIGHT = CMain::GetGroupRight('perfmon');
if ($RIGHT == 'D')
{
	$APPLICATION->AuthForm(GetMessage('ACCESS_DENIED'));
}

$sTableID = 'tbl_perfmon_history';
$lAdmin = new CAdminList($sTableID);

$arID = $lAdmin->GroupAction();
if ($arID && $RIGHT >= 'W')
{
	if ($_REQUEST['action_target'] == 'selected')
	{
		$rsData = CPerfomanceHistory::GetList(['ID' => 'ASC']);
		while ($arRes = $rsData->Fetch())
		{
			$arID[] = $arRes['ID'];
		}
	}

	foreach ($arID as $ID)
	{
		if ($ID == '')
		{
			continue;
		}
		$ID = intval($ID);
		if ($_REQUEST['action'] === 'delete')
		{
				CPerfomanceHistory::Delete($ID);
		}
	}
}

$lAdmin->AddHeaders([
	[
		'id' => 'ID',
		'content' => GetMessage('PERFMON_HIST_ID'),
		'align' => 'right',
		'default' => true,
	],
	[
		'id' => 'TIMESTAMP_X',
		'content' => GetMessage('PERFMON_HIST_TIMESTAMP_X'),
		'align' => 'right',
		'default' => true,
	],
	[
		'id' => 'TOTAL_MARK',
		'content' => GetMessage('PERFMON_HIST_TOTAL_MARK'),
		'align' => 'right',
		'default' => true,
	],
	[
		'id' => 'ACCELERATOR_ENABLED',
		'content' => GetMessage('PERFMON_HIST_ACCELERATOR_ENABLED'),
		'align' => 'right',
		'default' => true,
	],
]);

$rsData = CPerfomanceHistory::GetList(['ID' => 'DESC']);

$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage('PERFMON_HIST_PAGE')));

while ($arRes = $rsData->GetNext())
{
	$row =& $lAdmin->AddRow($arRes['ID'], $arRes);

	$row->AddViewField('TOTAL_MARK', perfmon_NumberFormat($arRes['TOTAL_MARK'], 2));
	$row->AddCheckField('ACCELERATOR_ENABLED', false);

	$arActions = [];
	if ($RIGHT >= 'W')
	{
		$arActions[] = [
			'ICON' => 'delete',
			'DEFAULT' => 'Y',
			'TEXT' => GetMessage('PERFMON_HIST_DELETE'),
			'ACTION' => "if(confirm('" . GetMessageJS('PERFMON_HIST_DELETE_CONFIRM') . "')) " . $lAdmin->ActionDoGroup($arRes['ID'], 'delete'),
		];
	}

	if (!empty($arActions))
	{
		$row->AddActions($arActions);
	}
}

$lAdmin->AddFooter(
	[
		[
			'title' => GetMessage('MAIN_ADMIN_LIST_SELECTED'),
			'value' => $rsData->SelectedRowsCount(),
		],
	]
);

$aContext = [];
$lAdmin->AddAdminContextMenu($aContext);

$lAdmin->AddFooter(
	[
		[
			'title' => GetMessage('MAIN_ADMIN_LIST_SELECTED'),
			'value' => $rsData->SelectedRowsCount(),
		],
		[
			'counter' => true,
			'title' => GetMessage('MAIN_ADMIN_LIST_CHECKED'),
			'value' => '0',
		],
	]
);

$aGroupActions = [];
if ($RIGHT >= 'W')
{
	$aGroupActions['delete'] = GetMessage('MAIN_ADMIN_LIST_DELETE');
}
$lAdmin->AddGroupActionTable($aGroupActions);

$lAdmin->CheckListMode();
$APPLICATION->SetTitle(GetMessage('PERFMON_HIST_TITLE'));
require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_admin_after.php';
$lAdmin->DisplayList();
require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_admin.php';

Anon7 - 2022
AnonSec Team