$table = (new CTableInfo())
($data['source'] === 'scheduledreport-form')
? (new CColHeader((new CCheckBox('all_scheduledreports'))
->setAttribute('data-source', $data['source'])
->onClick('checkAll(this.dataset.source, "all_scheduledreports", "reportids");')
))->addClass(ZBX_STYLE_CELL_WIDTH)
($data['source'] === 'scheduledreport-form')
? make_sorting_header(_('Name'), 'name', $data['sort'], $data['sortorder'],
->setArgument('action', 'scheduledreport.list')
: [[_('Name'), (new CSpan())->addClass(ZBX_STYLE_ARROW_UP)]],
->setPageNavigation(array_key_exists('paging', $data) ? $data['paging'] : null);
ZBX_REPORT_CYCLE_DAILY => _('Daily'),
ZBX_REPORT_CYCLE_WEEKLY => _('Weekly'),
ZBX_REPORT_CYCLE_MONTHLY => _('Monthly'),
ZBX_REPORT_CYCLE_YEARLY => _('Yearly')
ZBX_REPORT_PERIOD_DAY => _('Previous day'),
ZBX_REPORT_PERIOD_WEEK => _('Previous week'),
ZBX_REPORT_PERIOD_MONTH => _('Previous month'),
ZBX_REPORT_PERIOD_YEAR => _('Previous year')
foreach ($data['reports'] as $report) {
$name = new CLink($report['name'], (new CUrl('zabbix.php'))
->setArgument('action', 'scheduledreport.edit')
->setArgument('reportid', $report['reportid'])
if (($report['state'] == ZBX_REPORT_STATE_ERROR || $report['state'] == ZBX_REPORT_STATE_SUCCESS_INFO)
&& $report['info'] !== '') {
$info_icons[] = ($report['state'] == ZBX_REPORT_STATE_ERROR)
? makeErrorIcon($report['info'])
: makeWarningIcon($report['info']);
if ($report['status'] == ZBX_REPORT_STATUS_DISABLED) {
$status_name = _('Disabled');
$status_class = ZBX_STYLE_RED;
$status_name = _('Enabled');
$status_class = ZBX_STYLE_GREEN;
if ($report['active_till'] !== '') {
$active_till = (DateTime::createFromFormat(ZBX_DATE, $report['active_till'], new DateTimeZone('UTC')))
if ($active_till->getTimestamp() < $now) {
$status_name = _('Expired');
$status_class = ZBX_STYLE_GREY;