Source
$active_till = (DateTime::createFromFormat(ZBX_DATE, $report['active_till'], new DateTimeZone('UTC')))
<?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/>.
**/
/**
* @var CPartial $this
* @var array $data
*/
$table = (new CTableInfo())
->setHeader([
($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)
: null,
($data['source'] === 'scheduledreport-form')
? make_sorting_header(_('Name'), 'name', $data['sort'], $data['sortorder'],
(new CUrl('zabbix.php'))
->setArgument('action', 'scheduledreport.list')
->getUrl()
)
: [[_('Name'), (new CSpan())->addClass(ZBX_STYLE_ARROW_UP)]],
_('Owner'),
_('Repeats'),
_('Period'),
_('Last sent'),
_('Status'),
_('Info')
])
->setPageNavigation(array_key_exists('paging', $data) ? $data['paging'] : null);
$cycles = [
ZBX_REPORT_CYCLE_DAILY => _('Daily'),
ZBX_REPORT_CYCLE_WEEKLY => _('Weekly'),
ZBX_REPORT_CYCLE_MONTHLY => _('Monthly'),
ZBX_REPORT_CYCLE_YEARLY => _('Yearly')
];
$periods = [
ZBX_REPORT_PERIOD_DAY => _('Previous day'),
ZBX_REPORT_PERIOD_WEEK => _('Previous week'),
ZBX_REPORT_PERIOD_MONTH => _('Previous month'),
ZBX_REPORT_PERIOD_YEAR => _('Previous year')
];
$now = time();
foreach ($data['reports'] as $report) {
$name = new CLink($report['name'], (new CUrl('zabbix.php'))