• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP order_result函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中order_result函数的典型用法代码示例。如果您正苦于以下问题:PHP order_result函数的具体用法?PHP order_result怎么用?PHP order_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了order_result函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: doAction

 protected function doAction()
 {
     $data = ['sid' => $this->getUserSID(), 'eventids' => $this->getInput('eventids'), 'message' => $this->getInput('message', ''), 'acknowledge_type' => $this->getInput('acknowledge_type', ZBX_ACKNOWLEDGE_SELECTED), 'backurl' => $this->getInput('backurl', 'tr_status.php'), 'unack_problem_events_count' => 0, 'unack_events_count' => 0];
     if (count($this->getInput('eventids')) == 1) {
         $events = API::Event()->get(['output' => [], 'eventids' => $this->getInput('eventids'), 'source' => EVENT_SOURCE_TRIGGERS, 'object' => EVENT_OBJECT_TRIGGER, 'select_acknowledges' => ['clock', 'message', 'alias', 'name', 'surname']]);
         if ($events) {
             $data['event'] = ['acknowledges' => $events[0]['acknowledges']];
             order_result($data['acknowledges'], 'clock', ZBX_SORT_DOWN);
         }
     }
     $events = API::Event()->get(['output' => ['objectid', 'acknowledged', 'value'], 'eventids' => $this->getInput('eventids'), 'source' => EVENT_SOURCE_TRIGGERS, 'object' => EVENT_OBJECT_TRIGGER]);
     $triggerids = [];
     foreach ($events as $event) {
         if ($event['acknowledged'] == EVENT_ACKNOWLEDGED) {
             $data['unack_problem_events_count']++;
             $data['unack_events_count']++;
         } elseif ($event['value'] == TRIGGER_VALUE_FALSE) {
             $data['unack_problem_events_count']++;
         }
         $triggerids[$event['objectid']] = true;
     }
     $triggerids = array_keys($triggerids);
     $data['unack_problem_events_count'] += API::Event()->get(['countOutput' => true, 'source' => EVENT_SOURCE_TRIGGERS, 'object' => EVENT_OBJECT_TRIGGER, 'objectids' => $triggerids, 'filter' => ['acknowledged' => EVENT_NOT_ACKNOWLEDGED, 'value' => TRIGGER_VALUE_TRUE]]);
     $data['unack_events_count'] += API::Event()->get(['countOutput' => true, 'source' => EVENT_SOURCE_TRIGGERS, 'object' => EVENT_OBJECT_TRIGGER, 'objectids' => $triggerids, 'filter' => ['acknowledged' => EVENT_NOT_ACKNOWLEDGED]]);
     $response = new CControllerResponseData($data);
     $response->setTitle(_('Alarm acknowledgements'));
     $this->setResponse($response);
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:28,代码来源:CControllerAcknowledgeEdit.php


示例2: doAction

 protected function doAction()
 {
     $sortField = $this->getInput('sort', CProfile::get('web.proxies.php.sort', 'host'));
     $sortOrder = $this->getInput('sortorder', CProfile::get('web.proxies.php.sortorder', ZBX_SORT_UP));
     CProfile::update('web.proxies.php.sort', $sortField, PROFILE_TYPE_STR);
     CProfile::update('web.proxies.php.sortorder', $sortOrder, PROFILE_TYPE_STR);
     $config = select_config();
     $data = ['uncheck' => $this->hasInput('uncheck'), 'sort' => $sortField, 'sortorder' => $sortOrder, 'config' => ['max_in_table' => $config['max_in_table']]];
     $data['proxies'] = API::Proxy()->get(['output' => ['proxyid', 'host', 'status', 'lastaccess', 'tls_connect', 'tls_accept'], 'selectHosts' => ['hostid', 'name', 'status'], 'sortfield' => $sortField, 'limit' => $config['search_limit'] + 1, 'editable' => true, 'preservekeys' => true]);
     // sorting & paging
     order_result($data['proxies'], $sortField, $sortOrder);
     $url = (new CUrl('zabbix.php'))->setArgument('action', 'proxy.list');
     $data['paging'] = getPagingLine($data['proxies'], $sortOrder, $url);
     foreach ($data['proxies'] as &$proxy) {
         order_result($proxy['hosts'], 'name');
     }
     unset($proxy);
     // get proxy IDs for a *selected* page
     $proxyIds = array_keys($data['proxies']);
     if ($proxyIds) {
         // calculate performance
         $dbPerformance = DBselect('SELECT h.proxy_hostid,SUM(1.0/i.delay) AS qps' . ' FROM hosts h,items i' . ' WHERE h.hostid=i.hostid' . ' AND h.status=' . HOST_STATUS_MONITORED . ' AND i.status=' . ITEM_STATUS_ACTIVE . ' AND i.delay<>0' . ' AND i.flags<>' . ZBX_FLAG_DISCOVERY_PROTOTYPE . ' AND ' . dbConditionInt('h.proxy_hostid', $proxyIds) . ' GROUP BY h.proxy_hostid');
         while ($performance = DBfetch($dbPerformance)) {
             $data['proxies'][$performance['proxy_hostid']]['perf'] = round($performance['qps'], 2);
         }
         // get items
         $items = API::Item()->get(['proxyids' => $proxyIds, 'groupCount' => true, 'countOutput' => true, 'webitems' => true, 'monitored' => true]);
         foreach ($items as $item) {
             $data['proxies'][$item['proxy_hostid']]['item_count'] = $item['rowscount'];
         }
     }
     $response = new CControllerResponseData($data);
     $response->setTitle(_('Configuration of proxies'));
     $this->setResponse($response);
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:35,代码来源:CControllerProxyList.php


示例3: doAction

 protected function doAction()
 {
     $sortField = $this->getInput('sort', CProfile::get('web.media_types.php.sort', 'description'));
     $sortOrder = $this->getInput('sortorder', CProfile::get('web.media_types.php.sortorder', ZBX_SORT_UP));
     CProfile::update('web.media_type.php.sort', $sortField, PROFILE_TYPE_STR);
     CProfile::update('web.media_types.php.sortorder', $sortOrder, PROFILE_TYPE_STR);
     $config = select_config();
     $data = ['uncheck' => $this->hasInput('uncheck'), 'sort' => $sortField, 'sortorder' => $sortOrder];
     // get media types
     $data['mediatypes'] = API::Mediatype()->get(['output' => ['mediatypeid', 'description', 'type', 'smtp_server', 'smtp_helo', 'smtp_email', 'exec_path', 'gsm_modem', 'username', 'status'], 'limit' => $config['search_limit'] + 1, 'editable' => true, 'preservekeys' => true]);
     if ($data['mediatypes']) {
         // get media types used in actions
         $actions = API::Action()->get(['output' => ['actionid', 'name'], 'selectOperations' => ['operationtype', 'opmessage'], 'mediatypeids' => array_keys($data['mediatypes'])]);
         foreach ($data['mediatypes'] as &$mediaType) {
             $mediaType['typeid'] = $mediaType['type'];
             $mediaType['type'] = media_type2str($mediaType['type']);
             $mediaType['listOfActions'] = [];
             foreach ($actions as $action) {
                 foreach ($action['operations'] as $operation) {
                     if ($operation['operationtype'] == OPERATION_TYPE_MESSAGE && $operation['opmessage']['mediatypeid'] == $mediaType['mediatypeid']) {
                         $mediaType['listOfActions'][$action['actionid']] = ['actionid' => $action['actionid'], 'name' => $action['name']];
                     }
                 }
             }
             order_result($mediaType['listOfActions'], 'name');
         }
         unset($mediaType);
         order_result($data['mediatypes'], $sortField, $sortOrder);
     }
     $url = (new CUrl('zabbix.php'))->setArgument('action', 'mediatype.list');
     $data['paging'] = getPagingLine($data['mediatypes'], $sortOrder, $url);
     $response = new CControllerResponseData($data);
     $response->setTitle(_('Configuration of media types'));
     $this->setResponse($response);
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:35,代码来源:CControllerMediatypeList.php


示例4: doAction

 protected function doAction()
 {
     $sortField = $this->getInput('sort', CProfile::get('web.scripts.php.sort', 'name'));
     $sortOrder = $this->getInput('sortorder', CProfile::get('web.scripts.php.sortorder', ZBX_SORT_UP));
     CProfile::update('web.scripts.php.sort', $sortField, PROFILE_TYPE_STR);
     CProfile::update('web.scripts.php.sortorder', $sortOrder, PROFILE_TYPE_STR);
     $config = select_config();
     $data = ['uncheck' => $this->hasInput('uncheck'), 'sort' => $sortField, 'sortorder' => $sortOrder];
     // list of scripts
     $data['scripts'] = API::Script()->get(['output' => ['scriptid', 'name', 'command', 'host_access', 'usrgrpid', 'groupid', 'type', 'execute_on'], 'editable' => true, 'limit' => $config['search_limit'] + 1]);
     // sorting & paging
     order_result($data['scripts'], $sortField, $sortOrder);
     $url = (new CUrl('zabbix.php'))->setArgument('action', 'script.list');
     $data['paging'] = getPagingLine($data['scripts'], $sortOrder, $url);
     // find script host group name and user group name. set to '' if all host/user groups used.
     $usrgrpids = [];
     $groupids = [];
     foreach ($data['scripts'] as &$script) {
         $script['userGroupName'] = null;
         // all user groups
         $script['hostGroupName'] = null;
         // all host groups
         if ($script['usrgrpid'] != 0) {
             $usrgrpids[] = $script['usrgrpid'];
         }
         if ($script['groupid'] != 0) {
             $groupids[] = $script['groupid'];
         }
     }
     unset($script);
     if ($usrgrpids) {
         $userGroups = API::UserGroup()->get(['output' => ['name'], 'usrgrpids' => $usrgrpids, 'preservekeys' => true]);
         foreach ($data['scripts'] as &$script) {
             if ($script['usrgrpid'] != 0 && array_key_exists($script['usrgrpid'], $userGroups)) {
                 $script['userGroupName'] = $userGroups[$script['usrgrpid']]['name'];
             }
             unset($script['usrgrpid']);
         }
         unset($script);
     }
     if ($groupids) {
         $hostGroups = API::HostGroup()->get(['output' => ['name'], 'groupids' => $groupids, 'preservekeys' => true]);
         foreach ($data['scripts'] as &$script) {
             if ($script['groupid'] != 0 && array_key_exists($script['groupid'], $hostGroups)) {
                 $script['hostGroupName'] = $hostGroups[$script['groupid']]['name'];
             }
             unset($script['groupid']);
         }
         unset($script);
     }
     $response = new CControllerResponseData($data);
     $response->setTitle(_('Configuration of scripts'));
     $this->setResponse($response);
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:54,代码来源:CControllerScriptList.php


示例5: discovery_check_type2str

function discovery_check_type2str($type = null)
{
    $discovery_types = array(SVC_SSH => S_SSH, SVC_LDAP => S_LDAP, SVC_SMTP => S_SMTP, SVC_FTP => S_FTP, SVC_HTTP => S_HTTP, SVC_POP => S_POP, SVC_NNTP => S_NNTP, SVC_IMAP => S_IMAP, SVC_TCP => S_TCP, SVC_AGENT => S_ZABBIX_AGENT, SVC_SNMPv1 => S_SNMPV1_AGENT, SVC_SNMPv2 => S_SNMPV2_AGENT, SVC_SNMPv3 => S_SNMPV3_AGENT, SVC_ICMPPING => S_ICMPPING);
    if (is_null($type)) {
        order_result($discovery_types);
        return $discovery_types;
    } else {
        if (isset($discovery_types[$type])) {
            return $discovery_types[$type];
        } else {
            return S_UNKNOWN;
        }
    }
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:14,代码来源:discovery.inc.php


示例6: doAction

 protected function doAction()
 {
     // default values
     $data = ['sid' => $this->getUserSID(), 'scriptid' => 0, 'name' => '', 'type' => ZBX_SCRIPT_TYPE_CUSTOM_SCRIPT, 'execute_on' => ZBX_SCRIPT_EXECUTE_ON_AGENT, 'command' => '', 'commandipmi' => '', 'description' => '', 'usrgrpid' => 0, 'groupid' => 0, 'host_access' => 0, 'confirmation' => '', 'enable_confirmation' => 0, 'hgstype' => 0];
     // get values from the dabatase
     if ($this->hasInput('scriptid')) {
         $scripts = API::Script()->get(['output' => ['scriptid', 'name', 'type', 'execute_on', 'command', 'description', 'usrgrpid', 'groupid', 'host_access', 'confirmation'], 'scriptids' => $this->getInput('scriptid')]);
         $script = $scripts[0];
         $data['scriptid'] = $script['scriptid'];
         $data['name'] = $script['name'];
         $data['type'] = $script['type'];
         $data['execute_on'] = $script['execute_on'];
         $data['command'] = $script['type'] == ZBX_SCRIPT_TYPE_CUSTOM_SCRIPT ? $script['command'] : '';
         $data['commandipmi'] = $script['type'] == ZBX_SCRIPT_TYPE_IPMI ? $script['command'] : '';
         $data['description'] = $script['description'];
         $data['usrgrpid'] = $script['usrgrpid'];
         $data['groupid'] = $script['groupid'];
         $data['host_access'] = $script['host_access'];
         $data['confirmation'] = $script['confirmation'];
         $data['enable_confirmation'] = $script['confirmation'] !== '';
         $data['hgstype'] = $script['groupid'] != 0 ? 1 : 0;
     }
     // overwrite with input variables
     $this->getInputs($data, ['name', 'type', 'execute_on', 'command', 'commandipmi', 'description', 'usrgrpid', 'groupid', 'host_access', 'confirmation', 'enable_confirmation', 'hgstype']);
     // get host group
     if ($data['groupid'] == 0) {
         $data['hostgroup'] = null;
     } else {
         $hostgroups = API::HostGroup()->get(['groupids' => [$data['groupid']], 'output' => ['groupid', 'name']]);
         $hostgroup = $hostgroups[0];
         $data['hostgroup'][] = ['id' => $hostgroup['groupid'], 'name' => $hostgroup['name']];
     }
     // get list of user groups
     $usergroups = API::UserGroup()->get(['output' => ['usrgrpid', 'name']]);
     order_result($usergroups, 'name');
     $data['usergroups'] = $usergroups;
     $response = new CControllerResponseData($data);
     $response->setTitle(_('Configuration of scripts'));
     $this->setResponse($response);
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:40,代码来源:CControllerScriptEdit.php


示例7: CTableInfo

$table = new CTableInfo(_('No hosts found.'));
$table->setHeader(array(make_sorting_header($groupFieldTitle === '' ? _('Field') : $groupFieldTitle, 'inventory_field', $sortField, $sortOrder), make_sorting_header(_('Host count'), 'host_count', $sortField, $sortOrder)));
// to show a report, we will need a host group and a field to aggregate
if ($pageFilter->groupsSelected && $groupFieldTitle !== '') {
    $options = array('output' => array('hostid', 'name'), 'selectInventory' => array($_REQUEST['groupby']), 'withInventory' => true);
    if ($pageFilter->groupid > 0) {
        $options['groupids'] = $pageFilter->groupid;
    }
    $hosts = API::Host()->get($options);
    // aggregating data by chosen field value
    $report = array();
    foreach ($hosts as $host) {
        if ($host['inventory'][$_REQUEST['groupby']] !== '') {
            // same names with different letter casing are considered the same
            $lowerValue = mb_strtolower($host['inventory'][$_REQUEST['groupby']]);
            if (!isset($report[$lowerValue])) {
                $report[$lowerValue] = array('inventory_field' => $host['inventory'][$_REQUEST['groupby']], 'host_count' => 1);
            } else {
                $report[$lowerValue]['host_count'] += 1;
            }
        }
    }
    order_result($report, $sortField, $sortOrder);
    foreach ($report as $rep) {
        $row = array(new CSpan(zbx_str2links($rep['inventory_field']), 'pre'), new CLink($rep['host_count'], 'hostinventories.php?filter_field=' . $_REQUEST['groupby'] . '&filter_field_value=' . urlencode($rep['inventory_field']) . '&filter_set=1&filter_exact=1' . url_param('groupid')));
        $table->addRow($row);
    }
}
$hostinvent_wdgt->addItem($table);
$hostinvent_wdgt->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:hostinventoriesoverview.php


示例8: CSpan

    $cbFilter = new CSpan(S_DISABLED, 'red underline pointer');
    $cbFilter->setAttribute('onclick', "\$('dashform').enable(); create_var('" . $dashForm->getName() . "', 'filterEnable', 1, true);");
}
$dashForm->addRow(S_DASHBOARD_FILTER, $cbFilter);
$dashForm->addVar('groupids', $groupids);
$cmbGroups = new CComboBox('grpswitch', $grpswitch, 'submit();');
$cmbGroups->addItem(0, S_ALL_S);
$cmbGroups->addItem(1, S_SELECTED);
if (!$filterEnable) {
    $cmbGroups->setAttribute('disabled', 'disabled');
}
$dashForm->addRow(S_HOST_GROUPS, $cmbGroups);
if ($grpswitch == 1) {
    $options = array('nodeids' => get_current_nodeid(true), 'groupids' => $groupids, 'output' => API_OUTPUT_EXTEND);
    $groups = CHostGroup::get($options);
    order_result($groups, 'name');
    $lstGroups = new CListBox('del_groups[]', null, 15);
    $lstGroups->setAttribute('style', 'width: 200px;');
    foreach ($groups as $gnum => $group) {
        $lstGroups->addItem($group['groupid'], get_node_name_by_elid($group['groupid'], true, ':') . $group['name']);
    }
    if (!$filterEnable) {
        $lstGroups->setAttribute('disabled', 'disabled');
    }
    $addButton = new CButton('add', S_ADD, "return PopUp('popup_right.php?dstfrm=" . $dashForm->getName() . "&permission=" . PERM_READ_WRITE . "',450,450);");
    if (!$filterEnable) {
        $addButton->setAttribute('disabled', 'disabled');
    }
    $delButton = new CButton('delete', S_DELETE_SELECTED);
    if (!$filterEnable) {
        $delButton->setAttribute('disabled', 'disabled');
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:dashconf.php


示例9: CLink

     $name[] = new CLink($sourceTemplate['name'], '?parent_discoveryid=' . $hostPrototype['sourceDiscoveryRuleId'], 'unknown');
     $name[] = NAME_DELIMITER;
 }
 $name[] = new CLink($hostPrototype['name'], '?form=update&parent_discoveryid=' . $discoveryRule['itemid'] . '&hostid=' . $hostPrototype['hostid']);
 // template list
 if (empty($hostPrototype['templates'])) {
     $hostTemplates = '-';
 } else {
     $hostTemplates = array();
     order_result($hostPrototype['templates'], 'name');
     foreach ($hostPrototype['templates'] as $template) {
         $caption = array();
         $caption[] = new CLink($template['name'], 'templates.php?form=update&templateid=' . $template['templateid'], 'unknown');
         $linkedTemplates = $this->data['linkedTemplates'][$template['templateid']]['parentTemplates'];
         if ($linkedTemplates) {
             order_result($linkedTemplates, 'name');
             $caption[] = ' (';
             foreach ($linkedTemplates as $tpl) {
                 $caption[] = new CLink($tpl['name'], 'templates.php?form=update&templateid=' . $tpl['templateid'], 'unknown');
                 $caption[] = ', ';
             }
             array_pop($caption);
             $caption[] = ')';
         }
         $hostTemplates[] = $caption;
         $hostTemplates[] = ', ';
     }
     if ($hostTemplates) {
         array_pop($hostTemplates);
     }
 }
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:configuration.host.prototype.list.php


示例10: drawMapLinkLabels

function drawMapLinkLabels(&$im, $map, $mapInfo, $resolveMacros = true)
{
    global $colors;
    $links = $map['links'];
    $selements = $map['selements'];
    foreach ($links as $link) {
        if (empty($link['label'])) {
            continue;
        }
        $selement1 = $selements[$link['selementid1']];
        list($x1, $y1) = get_icon_center_by_selement($selement1, $mapInfo[$link['selementid1']], $map);
        $selement2 = $selements[$link['selementid2']];
        list($x2, $y2) = get_icon_center_by_selement($selement2, $mapInfo[$link['selementid2']], $map);
        if (isset($selement1['elementsubtype']) && $selement1['elementsubtype'] == SYSMAP_ELEMENT_AREA_TYPE_CUSTOM) {
            if ($selement1['areatype'] == SYSMAP_ELEMENT_AREA_TYPE_CUSTOM) {
                $w = $selement1['width'];
                $h = $selement1['height'];
            } else {
                $w = $map['width'];
                $h = $map['height'];
            }
            list($x1, $y1) = calculateMapAreaLinkCoord($x1, $y1, $w, $h, $x2, $y2);
        }
        if (isset($selement2['elementsubtype']) && $selement2['elementsubtype'] == SYSMAP_ELEMENT_AREA_TYPE_CUSTOM) {
            if ($selement2['areatype'] == SYSMAP_ELEMENT_AREA_TYPE_CUSTOM) {
                $w = $selement2['width'];
                $h = $selement2['height'];
            } else {
                $w = $map['width'];
                $h = $map['height'];
            }
            list($x2, $y2) = calculateMapAreaLinkCoord($x2, $y2, $w, $h, $x1, $y1);
        }
        $drawtype = $link['drawtype'];
        $color = convertColor($im, $link['color']);
        $linktriggers = $link['linktriggers'];
        order_result($linktriggers, 'triggerid');
        if (!empty($linktriggers)) {
            $max_severity = 0;
            $triggers = array();
            foreach ($linktriggers as $link_trigger) {
                if ($link_trigger['triggerid'] == 0) {
                    continue;
                }
                $id = $link_trigger['linktriggerid'];
                $triggers[$id] = zbx_array_merge($link_trigger, get_trigger_by_triggerid($link_trigger['triggerid']));
                if ($triggers[$id]['status'] == TRIGGER_STATUS_ENABLED && $triggers[$id]['value'] == TRIGGER_VALUE_TRUE) {
                    if ($triggers[$id]['priority'] >= $max_severity) {
                        $drawtype = $triggers[$id]['drawtype'];
                        $color = convertColor($im, $triggers[$id]['color']);
                        $max_severity = $triggers[$id]['priority'];
                    }
                }
            }
        }
        $label = $link['label'];
        $label = str_replace("\r", '', $label);
        $strings = explode("\n", $label);
        $box_width = 0;
        $box_height = 0;
        foreach ($strings as $snum => $str) {
            $strings[$snum] = $resolveMacros ? CMacrosResolverHelper::resolveMapLabelMacros($str) : $str;
        }
        foreach ($strings as $str) {
            $dims = imageTextSize(8, 0, $str);
            $box_width = $box_width > $dims['width'] ? $box_width : $dims['width'];
            $box_height += $dims['height'] + 2;
        }
        $boxX_left = round(($x1 + $x2) / 2 - $box_width / 2 - 6);
        $boxX_right = round(($x1 + $x2) / 2 + $box_width / 2 + 6);
        $boxY_top = round(($y1 + $y2) / 2 - $box_height / 2 - 4);
        $boxY_bottom = round(($y1 + $y2) / 2 + $box_height / 2 + 2);
        switch ($drawtype) {
            case MAP_LINK_DRAWTYPE_DASHED_LINE:
            case MAP_LINK_DRAWTYPE_DOT:
                dashedRectangle($im, $boxX_left, $boxY_top, $boxX_right, $boxY_bottom, $color);
                break;
            case MAP_LINK_DRAWTYPE_BOLD_LINE:
                imagerectangle($im, $boxX_left - 1, $boxY_top - 1, $boxX_right + 1, $boxY_bottom + 1, $color);
                // break; is not ne
            // break; is not ne
            case MAP_LINK_DRAWTYPE_LINE:
            default:
                imagerectangle($im, $boxX_left, $boxY_top, $boxX_right, $boxY_bottom, $color);
        }
        imagefilledrectangle($im, $boxX_left + 1, $boxY_top + 1, $boxX_right - 1, $boxY_bottom - 1, $colors['White']);
        $increasey = 4;
        foreach ($strings as $str) {
            $dims = imageTextSize(8, 0, $str);
            $labelx = ($x1 + $x2) / 2 - $dims['width'] / 2;
            $labely = $boxY_top + $increasey;
            imagetext($im, 8, 0, $labelx, $labely + $dims['height'], $colors['Black'], $str);
            $increasey += $dims['height'] + 2;
        }
    }
}
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:96,代码来源:maps.inc.php


示例11: get


//.........这里部分代码省略.........
                         $result[$dservice['dserviceid']]['drules'] = array();
                     }
                     $result[$dservice['dserviceid']]['drules'][] = array('druleid' => $dservice['druleid']);
                 }
                 // dhostids
                 if (isset($dservice['dhostid']) && is_null($options['selectDHosts'])) {
                     if (!isset($result[$dservice['dserviceid']]['dhosts'])) {
                         $result[$dservice['dserviceid']]['dhosts'] = array();
                     }
                     $result[$dservice['dserviceid']]['dhosts'][] = array('dhostid' => $dservice['dhostid']);
                 }
                 // dcheckids
                 if (isset($dservice['dcheckid']) && is_null($options['selectDChecks'])) {
                     if (!isset($result[$dservice['dserviceid']]['dchecks'])) {
                         $result[$dservice['dserviceid']]['dchecks'] = array();
                     }
                     $result[$dservice['dserviceid']]['dchecks'][] = array('dcheckid' => $dservice['dcheckid']);
                 }
                 $result[$dservice['dserviceid']] += $dservice;
             }
         }
     }
     if (!is_null($options['countOutput'])) {
         return $result;
     }
     // Adding Objects
     // select_drules
     if (!is_null($options['selectDRules'])) {
         $objParams = array('nodeids' => $nodeids, 'dserviceids' => $dserviceids, 'preservekeys' => 1);
         if (is_array($options['selectDRules']) || str_in_array($options['selectDRules'], $subselectsAllowedOutputs)) {
             $objParams['output'] = $options['selectDRules'];
             $drules = API::DRule()->get($objParams);
             if (!is_null($options['limitSelects'])) {
                 order_result($drules, 'name');
             }
             foreach ($drules as $druleid => $drule) {
                 unset($drules[$druleid]['dservices']);
                 $count = array();
                 foreach ($drule['dservices'] as $dnum => $dservice) {
                     if (!is_null($options['limitSelects'])) {
                         if (!isset($count[$dservice['dserviceid']])) {
                             $count[$dservice['dserviceid']] = 0;
                         }
                         $count[$dservice['dserviceid']]++;
                         if ($count[$dservice['dserviceid']] > $options['limitSelects']) {
                             continue;
                         }
                     }
                     $result[$dservice['dserviceid']]['drules'][] =& $drules[$druleid];
                 }
             }
         } elseif (API_OUTPUT_COUNT == $options['selectDRules']) {
             $objParams['countOutput'] = 1;
             $objParams['groupCount'] = 1;
             $drules = API::DRule()->get($objParams);
             $drules = zbx_toHash($drules, 'dserviceid');
             foreach ($result as $dserviceid => $dservice) {
                 if (isset($drules[$dserviceid])) {
                     $result[$dserviceid]['drules'] = $drules[$dserviceid]['rowscount'];
                 } else {
                     $result[$dserviceid]['drules'] = 0;
                 }
             }
         }
     }
     // selectDHosts
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:67,代码来源:CDService.php


示例12: navigation_bar_calc

if (getRequest('favobj') === 'timeline' && hasRequest('elementid') && hasRequest('period')) {
    navigation_bar_calc('web.hostscreen', getRequest('elementid'), true);
}
if ($page['type'] == PAGE_TYPE_JS || $page['type'] == PAGE_TYPE_HTML_BLOCK) {
    require_once dirname(__FILE__) . '/include/page_footer.php';
    exit;
}
/*
 * Display
 */
$data = array('hostid' => getRequest('hostid', 0), 'fullscreen' => $_REQUEST['fullscreen'], 'screenid' => getRequest('screenid', CProfile::get('web.hostscreen.screenid', null)), 'period' => getRequest('period'), 'stime' => getRequest('stime'));
CProfile::update('web.hostscreen.screenid', $data['screenid'], PROFILE_TYPE_ID);
// get screen list
$data['screens'] = API::TemplateScreen()->get(array('hostids' => $data['hostid'], 'output' => API_OUTPUT_EXTEND));
$data['screens'] = zbx_toHash($data['screens'], 'screenid');
order_result($data['screens'], 'name');
// get screen
$screenid = null;
if (!empty($data['screens'])) {
    $screen = !isset($data['screens'][$data['screenid']]) ? reset($data['screens']) : $data['screens'][$data['screenid']];
    if (!empty($screen['screenid'])) {
        $screenid = $screen['screenid'];
    }
}
$data['screen'] = API::TemplateScreen()->get(array('screenids' => $screenid, 'hostids' => $data['hostid'], 'output' => API_OUTPUT_EXTEND, 'selectScreenItems' => API_OUTPUT_EXTEND));
$data['screen'] = reset($data['screen']);
// get host
if (!empty($data['screen']['hostid'])) {
    $data['host'] = get_host_by_hostid($data['screen']['hostid']);
}
// render view
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:host_screen.php


示例13: CUrl

$sortLink = new CUrl();
$sortLink->setArgument('parent_discoveryid', $this->data['parent_discoveryid']);
$sortLink = $sortLink->getUrl();
$itemTable->setHeader(array(new CCheckBox('all_items', null, "checkAll('" . $itemForm->getName() . "', 'all_items', 'group_itemid');"), make_sorting_header(_('Name'), 'name', $sortLink), make_sorting_header(_('Key'), 'key_', $sortLink), make_sorting_header(_('Interval'), 'delay', $sortLink), make_sorting_header(_('History'), 'history', $sortLink), make_sorting_header(_('Trends'), 'trends', $sortLink), make_sorting_header(_('Type'), 'type', $sortLink), _('Applications'), make_sorting_header(_('Status'), 'status', $sortLink)));
foreach ($this->data['items'] as $item) {
    $description = array();
    if (!empty($item['templateid'])) {
        $template_host = get_realhost_by_itemid($item['templateid']);
        $templateDiscoveryRuleId = get_realrule_by_itemid_and_hostid($this->data['parent_discoveryid'], $template_host['hostid']);
        $description[] = new CLink($template_host['name'], '?parent_discoveryid=' . $templateDiscoveryRuleId, 'unknown');
        $description[] = NAME_DELIMITER;
    }
    $description[] = new CLink($item['name_expanded'], '?form=update&itemid=' . $item['itemid'] . '&parent_discoveryid=' . $this->data['parent_discoveryid']);
    $status = new CLink(itemIndicator($item['status']), '?group_itemid=' . $item['itemid'] . '&parent_discoveryid=' . $this->data['parent_discoveryid'] . '&go=' . ($item['status'] ? 'activate' : 'disable'), itemIndicatorStyle($item['status']));
    if (!empty($item['applications'])) {
        order_result($item['applications'], 'name');
        $applications = zbx_objectValues($item['applications'], 'name');
        $applications = implode(', ', $applications);
        if (empty($applications)) {
            $applications = '-';
        }
    } else {
        $applications = '-';
    }
    $itemTable->addRow(array(new CCheckBox('group_itemid[' . $item['itemid'] . ']', null, null, $item['itemid']), $description, $item['key_'], $item['delay'], $item['history'], in_array($item['value_type'], array(ITEM_VALUE_TYPE_STR, ITEM_VALUE_TYPE_LOG, ITEM_VALUE_TYPE_TEXT)) ? '' : $item['trends'], item_type2str($item['type']), new CCol($applications, 'wraptext'), $status));
}
// create go buttons
$goComboBox = new CComboBox('go');
$goOption = new CComboItem('activate', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected item prototypes?'));
$goComboBox->addItem($goOption);
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:configuration.item.prototype.list.php


示例14: _

$param1SecCount = [['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT, 'M' => $metrics], ['C' => _('Time shift'), 'T' => T_ZBX_INT]];
$param1Sec = [['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT]];
$param1Str = [['C' => 'T', 'T' => T_ZBX_STR]];
$param2SecCount = [['C' => 'V', 'T' => T_ZBX_STR], ['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT, 'M' => $metrics]];
$param3SecVal = [['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT, 'M' => $metrics], ['C' => 'V', 'T' => T_ZBX_STR], ['C' => 'O', 'T' => T_ZBX_STR], ['C' => _('Time shift'), 'T' => T_ZBX_INT]];
$param3SecPercent = [['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT, 'M' => $metrics], ['C' => _('Time shift'), 'T' => T_ZBX_INT], ['C' => _('Percentage') . ' (P)', 'T' => T_ZBX_DBL]];
$paramSecIntCount = [['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT, 'M' => $metrics], ['C' => _('Mask'), 'T' => T_ZBX_STR], ['C' => _('Time shift'), 'T' => T_ZBX_INT]];
$paramForecast = [['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT, 'M' => $metrics], ['C' => _('Time shift'), 'T' => T_ZBX_INT], ['C' => _('Time') . ' (t)', 'T' => T_ZBX_INT], ['C' => _('Fit'), 'T' => T_ZBX_STR], ['C' => _('Mode'), 'T' => T_ZBX_STR]];
$paramTimeleft = [['C' => _('Last of') . ' (T)', 'T' => T_ZBX_INT, 'M' => $metrics], ['C' => _('Time shift'), 'T' => T_ZBX_INT], ['C' => _('Threshold'), 'T' => T_ZBX_DBL], ['C' => _('Fit'), 'T' => T_ZBX_STR]];
$allowedTypesAny = [ITEM_VALUE_TYPE_FLOAT => 1, ITEM_VALUE_TYPE_STR => 1, ITEM_VALUE_TYPE_LOG => 1, ITEM_VALUE_TYPE_UINT64 => 1, ITEM_VALUE_TYPE_TEXT => 1];
$allowedTypesNumeric = [ITEM_VALUE_TYPE_FLOAT => 1, ITEM_VALUE_TYPE_UINT64 => 1];
$allowedTypesStr = [ITEM_VALUE_TYPE_STR => 1, ITEM_VALUE_TYPE_LOG => 1, ITEM_VALUE_TYPE_TEXT => 1];
$allowedTypesLog = [ITEM_VALUE_TYPE_LOG => 1];
$allowedTypesInt = [ITEM_VALUE_TYPE_UINT64 => 1];
$functions = ['abschange[<]' => ['description' => _('Absolute difference between last and previous value is < N'), 'allowed_types' => $allowedTypesAny], 'abschange[>]' => ['description' => _('Absolute difference between last and previous value is > N'), 'allowed_types' => $allowedTypesAny], 'abschange[=]' => ['description' => _('Absolute difference between last and previous value is = N'), 'allowed_types' => $allowedTypesAny], 'abschange[<>]' => ['description' => _('Absolute difference between last and previous value is NOT N'), 'allowed_types' => $allowedTypesAny], 'avg[<]' => ['description' => _('Average value of a period T is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'avg[>]' => ['description' => _('Average value of a period T is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'avg[=]' => ['description' => _('Average value of a period T is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'avg[<>]' => ['description' => _('Average value of a period T is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'delta[<]' => ['description' => _('Difference between MAX and MIN value of a period T is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'delta[>]' => ['description' => _('Difference between MAX and MIN value of a period T is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'delta[=]' => ['description' => _('Difference between MAX and MIN value of a period T is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'delta[<>]' => ['description' => _('Difference between MAX and MIN value of a period T is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'change[<]' => ['description' => _('Difference between last and previous value is < N'), 'allowed_types' => $allowedTypesAny], 'change[>]' => ['description' => _('Difference between last and previous value is > N'), 'allowed_types' => $allowedTypesAny], 'change[=]' => ['description' => _('Difference between last and previous value is = N'), 'allowed_types' => $allowedTypesAny], 'change[<>]' => ['description' => _('Difference between last and previous value is NOT N'), 'allowed_types' => $allowedTypesAny], 'count[<]' => ['description' => _('Number of successfully retrieved values V (which fulfill operator O) for period T is < N'), 'params' => $param3SecVal, 'allowed_types' => $allowedTypesAny], 'count[>]' => ['description' => _('Number of successfully retrieved values V (which fulfill operator O) for period T is > N'), 'params' => $param3SecVal, 'allowed_types' => $allowedTypesAny], 'count[=]' => ['description' => _('Number of successfully retrieved values V (which fulfill operator O) for period T is = N'), 'params' => $param3SecVal, 'allowed_types' => $allowedTypesAny], 'count[<>]' => ['description' => _('Number of successfully retrieved values V (which fulfill operator O) for period T is NOT N'), 'params' => $param3SecVal, 'allowed_types' => $allowedTypesAny], 'diff[=]' => ['description' => _('Difference between last and preceding values, then N = 1, 0 - otherwise'), 'allowed_types' => $allowedTypesAny], 'diff[<>]' => ['description' => _('Difference between last and preceding values, then N NOT 1, 0 - otherwise'), 'allowed_types' => $allowedTypesAny], 'last[<]' => ['description' => _('Last (most recent) T value is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesAny], 'last[>]' => ['description' => _('Last (most recent) T value is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesAny], 'last[=]' => ['description' => _('Last (most recent) T value is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesAny], 'last[<>]' => ['description' => _('Last (most recent) T value is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesAny], 'max[<]' => ['description' => _('Maximum value for period T is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'max[>]' => ['description' => _('Maximum value for period T is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'max[=]' => ['description' => _('Maximum value for period T is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'max[<>]' => ['description' => _('Maximum value for period T is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'min[<]' => ['description' => _('Minimum value for period T is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'min[>]' => ['description' => _('Minimum value for period T is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'min[=]' => ['description' => _('Minimum value for period T is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'min[<>]' => ['description' => _('Minimum value for period T is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'percentile[<]' => ['description' => _('Percentile P of a period T is < N'), 'params' => $param3SecPercent, 'allowed_types' => $allowedTypesNumeric], 'percentile[>]' => ['description' => _('Percentile P of a period T is > N'), 'params' => $param3SecPercent, 'allowed_types' => $allowedTypesNumeric], 'percentile[=]' => ['description' => _('Percentile P of a period T is = N'), 'params' => $param3SecPercent, 'allowed_types' => $allowedTypesNumeric], 'percentile[<>]' => ['description' => _('Percentile P of a period T is NOT N'), 'params' => $param3SecPercent, 'allowed_types' => $allowedTypesNumeric], 'prev[<]' => ['description' => _('Previous value is < N'), 'allowed_types' => $allowedTypesAny], 'prev[>]' => ['description' => _('Previous value is > N'), 'allowed_types' => $allowedTypesAny], 'prev[=]' => ['description' => _('Previous value is = N'), 'allowed_types' => $allowedTypesAny], 'prev[<>]' => ['description' => _('Previous value is NOT N'), 'allowed_types' => $allowedTypesAny], 'str[=]' => ['description' => _('Find string V in last (most recent) value. N = 1 - if found, 0 - otherwise'), 'params' => $param2SecCount, 'allowed_types' => $allowedTypesAny], 'str[<>]' => ['description' => _('Find string V in last (most recent) value. N NOT 1 - if found, 0 - otherwise'), 'params' => $param2SecCount, 'allowed_types' => $allowedTypesAny], 'strlen[<]' => ['description' => _('Length of last (most recent) T value in characters is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesStr], 'strlen[>]' => ['description' => _('Length of last (most recent) T value in characters is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesStr], 'strlen[=]' => ['description' => _('Length of last (most recent) T value in characters is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesStr], 'strlen[<>]' => ['description' => _('Length of last (most recent) T value in characters is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesStr], 'sum[<]' => ['description' => _('Sum of values of a period T is < N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'sum[>]' => ['description' => _('Sum of values of a period T is > N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'sum[=]' => ['description' => _('Sum of values of a period T is = N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'sum[<>]' => ['description' => _('Sum of values of a period T is NOT N'), 'params' => $param1SecCount, 'allowed_types' => $allowedTypesNumeric], 'date[<]' => ['description' => _('Current date is < N'), 'allowed_types' => $allowedTypesAny], 'date[>]' => ['description' => _('Current date is > N'), 'allowed_types' => $allowedTypesAny], 'date[=]' => ['description' => _('Current date is = N'), 'allowed_types' => $allowedTypesAny], 'date[<>]' => ['description' => _('Current date is NOT N'), 'allowed_types' => $allowedTypesAny], 'dayofweek[<]' => ['description' => _('Day of week is < N'), 'allowed_types' => $allowedTypesAny], 'dayofweek[>]' => ['description' => _('Day of week is > N'), 'allowed_types' => $allowedTypesAny], 'dayofweek[=]' => ['description' => _('Day of week is = N'), 'allowed_types' => $allowedTypesAny], 'dayofweek[<>]' => ['description' => _('Day of week is NOT N'), 'allowed_types' => $allowedTypesAny], 'dayofmonth[<]' => ['description' => _('Day of month is < N'), 'allowed_types' => $allowedTypesAny], 'dayofmonth[>]' => ['description' => _('Day of month is > N'), 'allowed_types' => $allowedTypesAny], 'dayofmonth[=]' => ['description' => _('Day of month is = N'), 'allowed_types' => $allowedTypesAny], 'dayofmonth[<>]' => ['description' => _('Day of month is NOT N'), 'allowed_types' => $allowedTypesAny], 'fuzzytime[=]' => ['description' => _('Difference between item timestamp value and Zabbix server timestamp is over T seconds, then N = 0, 1 - otherwise'), 'params' => $param1Sec, 'allowed_types' => $allowedTypesAny], 'fuzzytime[<>]' => ['description' => _('Difference between item timestamp value and Zabbix server timestamp is over T seconds, then N NOT 0, 1 - otherwise'), 'params' => $param1Sec, 'allowed_types' => $allowedTypesAny], 'regexp[=]' => ['description' => _('Regular expression V matching last value in period T, then N = 1, 0 - otherwise'), 'params' => $param2SecCount, 'allowed_types' => $allowedTypesAny], 'regexp[<>]' => ['description' => _('Regular expression V matching last value in period T, then N NOT 1, 0 - otherwise'), 'params' => $param2SecCount, 'allowed_types' => $allowedTypesAny], 'iregexp[=]' => ['description' => _('Regular expression V matching last value in period T, then N = 1, 0 - otherwise (non case-sensitive)'), 'params' => $param2SecCount, 'allowed_types' => $allowedTypesAny], 'iregexp[<>]' => ['description' => _('Regular expression V matching last value in period T, then N NOT 1, 0 - otherwise (non case-sensitive)'), 'params' => $param2SecCount, 'allowed_types' => $allowedTypesAny], 'logeventid[=]' => ['description' => _('Event ID of last log entry matching regular expression T, then N = 1, 0 - otherwise'), 'params' => $param1Str, 'allowed_types' => $allowedTypesLog], 'logeventid[<>]' => ['description' => _('Event ID of last log entry matching regular expression T, then N NOT 1, 0 - otherwise'), 'params' => $param1Str, 'allowed_types' => $allowedTypesLog], 'logseverity[<]' => ['description' => _('Log severity of the last log entry is < N'), 'allowed_types' => $allowedTypesLog], 'logseverity[>]' => ['description' => _('Log severity of the last log entry is > N'), 'allowed_types' => $allowedTypesLog], 'logseverity[=]' => ['description' => _('Log severity of the last log entry is = N'), 'allowed_types' => $allowedTypesLog], 'logseverity[<>]' => ['description' => _('Log severity of the last log entry is NOT N'), 'allowed_types' => $allowedTypesLog], 'logsource[=]' => ['description' => _('Log source of the last log entry matching parameter T, then N = 1, 0 - otherwise'), 'params' => $param1Str, 'allowed_types' => $allowedTypesLog], 'logsource[<>]' => ['description' => _('Log source of the last log entry matching parameter T, then N NOT 1, 0 - otherwise'), 'params' => $param1Str, 'allowed_types' =&g 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP order_weight_price函数代码示例发布时间:2022-05-15
下一篇:
PHP order_refund函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap