require_once dirname(__FILE__).'/include/config.inc.php';
require_once dirname(__FILE__).'/include/hosts.inc.php';
$page['title'] = _('Availability report');
$page['file'] = 'report2.php';
$page['scripts'] = ['class.calendar.js', 'gtlc.js', 'report2.js'];
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
require_once dirname(__FILE__).'/include/page_header.php';
'mode' => [T_ZBX_INT, O_OPT, P_SYS, IN(implode(',', [AVAILABILITY_REPORT_BY_HOST, AVAILABILITY_REPORT_BY_TEMPLATE])), null],
'hostgroupid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'tpl_triggerid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'triggerid' => [T_ZBX_INT, O_OPT, P_SYS|P_NZERO, DB_ID, null],
'filter_groups' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'filter_hostids' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'filter_templateid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'filter_rst'=> [T_ZBX_STR, O_OPT, P_SYS, null, null],
'filter_set' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
'from' => [T_ZBX_RANGE_TIME, O_OPT, P_SYS, null, null],
'to' => [T_ZBX_RANGE_TIME, O_OPT, P_SYS, null, null]
validateTimeSelectorPeriod(getRequest('from'), getRequest('to'));
$report_mode = getRequest('mode', CProfile::get('web.avail_report.mode', AVAILABILITY_REPORT_BY_HOST));
CProfile::update('web.avail_report.mode', $report_mode, PROFILE_TYPE_INT);
if ($report_mode == AVAILABILITY_REPORT_BY_TEMPLATE) {
if (getRequest('hostgroupid') && !isReadableHostGroups([getRequest('hostgroupid')])) {
if (getRequest('filter_groups') && !isReadableHostGroups([getRequest('filter_groups')])) {
if (getRequest('filter_templateid') && !isReadableTemplates([getRequest('filter_templateid')])) {