require_once dirname(__FILE__).'/include/config.inc.php';
require_once dirname(__FILE__).'/include/hosts.inc.php';
require_once dirname(__FILE__).'/include/forms.inc.php';
$page['title'] = _('Host inventory');
$page['file'] = 'hostinventories.php';
$page['scripts'] = ['multilineinput.js', 'items.js'];
$hostId = getRequest('hostid', 0);
require_once dirname(__FILE__).'/include/page_header.php';
'hostid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'filter_set' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
'filter_rst' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
'filter_field' => [T_ZBX_STR, O_OPT, null, null, null],
'filter_field_value' => [T_ZBX_STR, O_OPT, null, null, null],
'filter_exact' => [T_ZBX_INT, O_OPT, null, 'IN(0,1)', null],
'filter_groups' => [T_ZBX_INT, O_OPT, P_ONLY_ARRAY, DB_ID, null],
'cancel' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
'sort' => [T_ZBX_STR, O_OPT, P_SYS,
IN('"name","pr_macaddress_a","pr_name","pr_os","pr_serialno_a","pr_tag","pr_type"'),
'sortorder' => [T_ZBX_STR, O_OPT, P_SYS, IN('"'.ZBX_SORT_DOWN.'","'.ZBX_SORT_UP.'"'), null]
if (getRequest('hostid') && !isReadableHosts([getRequest('hostid')])) {
$sortField = getRequest('sort', CProfile::get('web.'.$page['file'].'.sort', 'name'));
$sortOrder = getRequest('sortorder', CProfile::get('web.'.$page['file'].'.sortorder', ZBX_SORT_UP));
CProfile::update('web.'.$page['file'].'.sort', $sortField, PROFILE_TYPE_STR);
CProfile::update('web.'.$page['file'].'.sortorder', $sortOrder, PROFILE_TYPE_STR);