Source
$resp_time = formatHistoryValue($item_history[$resptime_item['itemid']][0]['value'], $resptime_item);
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* A class to display web scenario details as a screen element by given "httptestid".
*/
class CScreenHttpTestDetails extends CScreenBase {
/**
* Process screen.
*
* @return CDiv (screen inside container)
*/
public function get() {
$this->dataId = 'httptest_details';
$httptest = API::HttpTest()->get([
'output' => ['httptestid', 'name', 'hostid'],
'selectSteps' => ['httpstepid', 'name', 'no'],
'httptestids' => $this->profileIdx2,
'preservekeys' => true
]);
$httptest = reset($httptest);
if (!$httptest) {
$messages = [[
'type' => 'error',
'message' => _('No permissions to referred object or it does not exist!')
]];
return $this->getOutput(makeMessageBox(ZBX_STYLE_MSG_BAD, $messages, null, false));
}
$httptest['lastfailedstep'] = 0;
$httptest['error'] = '';
// fetch http test execution data
$httptest_data = Manager::HttpTest()->getLastData([$httptest['httptestid']]);
if ($httptest_data) {
$httptest_data = reset($httptest_data);
}
// fetch HTTP step items
$items = DBfetchArray(DBselect(
'SELECT i.value_type,i.units,i.itemid,hi.type,hs.httpstepid'.
' FROM items i,httpstepitem hi,httpstep hs'.
' WHERE hi.itemid=i.itemid'.
' AND hi.httpstepid=hs.httpstepid'.
' AND hs.httptestid='.zbx_dbstr($httptest['httptestid'])