当前位置: 首页>>代码示例>>PHP>>正文


PHP CTableInfo::setHeader方法代码示例

本文整理汇总了PHP中CTableInfo::setHeader方法的典型用法代码示例。如果您正苦于以下问题:PHP CTableInfo::setHeader方法的具体用法?PHP CTableInfo::setHeader怎么用?PHP CTableInfo::setHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CTableInfo的用法示例。


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

示例1: _getContent

 public function _getContent($refresh = false)
 {
     global $DB;
     $table = new CTableInfo(_('No email log data found'));
     $table->setHeader(array(_('System'), _('Interval'), _('Next Expected'), _('Last Seen'), _('Total Emails'), _('Actions')));
     $data = array();
     $db = mysql_connect("192.168.211.7", "zabbix", "asmd213)A)SDM@**@@");
     $result = DbFetchArray(DBselect('
                 SELECT email_schedule.*,COUNT(email_match.schedule) as `email_count` FROM email_tracker.email_schedule LEFT JOIN email_tracker.email_match ON email_match.schedule = email_schedule.id GROUP BY email_schedule.id ORDER BY exec_order 
             '));
     foreach ($result as $row) {
         //            $link_link = new CLink($row['name'],$row['url']);
         //            $link_link->setTarget("_blank");
         //            $map_link  = new CLink("map","/spider_report.php?wid=$row[aid]");
         //            $map_link->setTarget("_blank");
         $color = $row['missed'] == 0 ? 'green' : 'red';
         $last_seen = empty($row['last_seen']) || $row['last_seen'] == '0000-00-00 00:00:00' ? 'Never' : $row['last_seen'];
         $table->addRow(array(new CDiv($row['name']), new CDiv($row['expected_interval']), new CDiv($row['next_expected']), new CDiv(new CSpan($last_seen, $color)), new CDiv($row['email_count']), new CLink('Ack', '/zabbix/email.php?action=ack&id=' . $row['id'])));
         //		if (!isset($httpTestData[$row['httptestid']])) {
         //			$data[$row['groupid']]['unknown'] = empty($data[$row['groupid']]['unknown']) ? 1 : ++$data[$row['groupid']]['unknown'];
         //		}
         //		elseif ($httpTestData[$row['httptestid']]['lastfailedstep'] != 0) {
         //			$data[$row['groupid']]['failed'] = empty($data[$row['groupid']]['failed']) ? 1 : ++$data[$row['groupid']]['failed'];
         //		}
         //		else {
         //			$data[$row['groupid']]['ok'] = empty($data[$row['groupid']]['ok']) ? 1 : ++$data[$row['groupid']]['ok'];
         //		}
     }
     return $table;
 }
开发者ID:OneOaaS,项目名称:zabbix-dashboard-extension,代码行数:30,代码来源:dbemailmonitor.inc.php

示例2: _getContent

 public function _getContent($refresh = false)
 {
     $table = new CTableInfo(_('No web scenarios found.'));
     $table->setHeader(array(_('Website'), _('Links'), _('Broken Links')));
     $data = array();
     // fetch links between HTTP tests and host groups
     $result = DbFetchArray(DBselect('SELECT website.*, sum(status LIKE "2%") as links_ok, sum(status != "" AND NOT status LIKE "2%") as links_404, sum(status = "" OR status is null) as links_unchecked FROM zabbix_spider.website LEFT JOIN zabbix_spider.page ON page.website = Website.aid group by page.website;'));
     foreach ($result as $row) {
         $deadlinks = DbFetchArray(DBselect('SELECT * FROM zabbix_spider.page  WHERE NOT status IS NULL AND status != "200" AND status != "" and website = ' . $row['aid']));
         $deadlink_output = array();
         $link_options = array("target" => "_blank");
         foreach ($deadlinks as $deadlink) {
             $link_link = new CLink($deadlink['url'] == "" ? "root" : substr($deadlink['url'], 0, 50), ($deadlink['url'] == "" || $deadlink['url'][0] == "/" ? $row['url'] : "") . $deadlink['url']);
             $link_link->setTarget("_blank");
             $map_link = new CLink("map", $this->reportUrl . "?pid={$deadlink['aid']}");
             $map_link->setTarget("_blank");
             $info_link = new CLink($deadlink["status"], "http://www.checkupdown.com/status/E{$deadlink['status']}.html");
             $info_link->setTarget("_blank");
             $deadlink_output[] = new CDiv(array($link_link, " [ ", $map_link, " | ", $info_link, " ]"));
         }
         $link_link = new CLink($row['name'], $row['url']);
         $link_link->setTarget("_blank");
         $map_link = new CLink("map", $this->reportUrl . "?wid={$row['aid']}");
         $map_link->setTarget("_blank");
         $table->addRow(array(new CDiv(array($link_link, " [ ", $map_link, " ]")), new CDiv(array(new CSpan($row['links_ok'], 'green'), " / ", new CSpan($row['links_404'], 'red'), " / ", new CSpan($row['links_unchecked'], 'gray'))), new CDiv($deadlink_output)));
     }
     return $table;
 }
开发者ID:OneOaaS,项目名称:zabbix-dashboard-extension,代码行数:28,代码来源:dbwebspider.inc.php

示例3: makeAckTab

/**
 * Get acknowledgement table.
 *
 * @param array $event
 * @param array $event['acknowledges']
 * @param array $event['acknowledges']['clock']
 * @param array $event['acknowledges']['alias']
 * @param array $event['acknowledges']['message']
 *
 * @return CTableInfo
 */
function makeAckTab($event)
{
    $acknowledgeTable = new CTableInfo(_('No acknowledges found.'));
    $acknowledgeTable->setHeader(array(_('Time'), _('User'), _('Comments')));
    if (!empty($event['acknowledges']) && is_array($event['acknowledges'])) {
        foreach ($event['acknowledges'] as $acknowledge) {
            $acknowledgeTable->addRow(array(zbx_date2str(DATE_TIME_FORMAT_SECONDS, $acknowledge['clock']), getUserFullname($acknowledge), new CCol(zbx_nl2br($acknowledge['message']), 'wraptext')));
        }
    }
    return $acknowledgeTable;
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:22,代码来源:acknow.inc.php

示例4: get

 /**
  * Process screen.
  *
  * @return CDiv (screen inside container)
  */
 public function get()
 {
     // if screen is defined in template, then 'real_resourceid' is defined and should be used
     if (!empty($this->screenitem['real_resourceid'])) {
         $this->screenitem['resourceid'] = $this->screenitem['real_resourceid'];
     }
     if ($this->screenitem['dynamic'] == SCREEN_DYNAMIC_ITEM && !empty($this->hostid)) {
         $newitemid = get_same_item_for_host($this->screenitem['resourceid'], $this->hostid);
         $this->screenitem['resourceid'] = !empty($newitemid) ? $newitemid : 0;
     }
     if ($this->screenitem['resourceid'] == 0) {
         $table = new CTableInfo(_('No values found.'));
         $table->setHeader(array(_('Timestamp'), _('Item')));
         return $this->getOutput($table);
     }
     $items = CMacrosResolverHelper::resolveItemNames(array(get_item_by_itemid($this->screenitem['resourceid'])));
     $item = reset($items);
     switch ($item['value_type']) {
         case ITEM_VALUE_TYPE_TEXT:
         case ITEM_VALUE_TYPE_LOG:
             $orderField = 'id';
             break;
         case ITEM_VALUE_TYPE_FLOAT:
         case ITEM_VALUE_TYPE_UINT64:
         default:
             $orderField = array('itemid', 'clock');
     }
     $host = get_host_by_itemid($this->screenitem['resourceid']);
     $table = new CTableInfo(_('No values found.'));
     $table->setHeader(array(_('Timestamp'), $host['name'] . NAME_DELIMITER . $item['name_expanded']));
     $stime = zbxDateToTime($this->timeline['stime']);
     $histories = API::History()->get(array('history' => $item['value_type'], 'itemids' => $this->screenitem['resourceid'], 'output' => API_OUTPUT_EXTEND, 'sortorder' => ZBX_SORT_DOWN, 'sortfield' => $orderField, 'limit' => $this->screenitem['elements'], 'time_from' => $stime, 'time_till' => $stime + $this->timeline['period']));
     foreach ($histories as $history) {
         switch ($item['value_type']) {
             case ITEM_VALUE_TYPE_FLOAT:
                 sscanf($history['value'], '%f', $value);
                 break;
             case ITEM_VALUE_TYPE_TEXT:
             case ITEM_VALUE_TYPE_STR:
             case ITEM_VALUE_TYPE_LOG:
                 $value = $this->screenitem['style'] ? new CJsScript($history['value']) : $history['value'];
                 break;
             default:
                 $value = $history['value'];
                 break;
         }
         if ($item['valuemapid'] > 0) {
             $value = applyValueMap($value, $item['valuemapid']);
         }
         $class = $this->screenitem['style'] ? null : 'pre';
         $table->addRow(array(zbx_date2str(DATE_TIME_FORMAT_SECONDS, $history['clock']), new CCol($value, $class)));
     }
     return $this->getOutput($table);
 }
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:59,代码来源:CScreenPlainText.php

示例5: makeAckTab

/**
 * Generate acknowledgement table
 *
 * @param array $event
 * @param array $event['acknowledges']
 * @param array $event['acknowledges']['clock']
 * @param array $event['acknowledges']['alias']
 * @param array $event['acknowledges']['message']
 *
 * @return CTableInfo
 */
function makeAckTab($event)
{
    $table = new CTableInfo(_('No acknowledges defined.'));
    $table->setHeader(array(_('Time'), _('User'), _('Comments')));
    if (!empty($event['acknowledges']) && is_array($event['acknowledges'])) {
        foreach ($event['acknowledges'] as $ack) {
            $table->addRow(array(zbx_date2str(_('d M Y H:i:s'), $ack['clock']), $ack['alias'], new CCol(zbx_nl2br($ack['message']), 'wraptext')));
        }
    }
    return $table;
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:22,代码来源:acknow.inc.php

示例6: get

 /**
  * Process screen.
  *
  * @return CDiv (screen inside container)
  */
 public function get()
 {
     $options = array('monitored' => true, 'value' => array(TRIGGER_VALUE_TRUE, TRIGGER_VALUE_FALSE), 'triggerLimit' => $this->screenitem['elements'], 'eventLimit' => $this->screenitem['elements']);
     $item = new CTableInfo(_('No events found.'));
     $item->setHeader(array(_('Time'), is_show_all_nodes() ? _('Node') : null, _('Host'), _('Description'), _('Value'), _('Severity')));
     $events = getLastEvents($options);
     foreach ($events as $event) {
         $trigger = $event['trigger'];
         $host = $event['host'];
         $statusSpan = new CSpan(trigger_value2str($event['value']));
         // add colors and blinking to span depending on configuration and trigger parameters
         addTriggerValueStyle($statusSpan, $event['value'], $event['clock'], $event['acknowledged']);
         $item->addRow(array(zbx_date2str(_('d M Y H:i:s'), $event['clock']), get_node_name_by_elid($event['objectid']), $host['name'], new CLink($trigger['description'], 'tr_events.php?triggerid=' . $event['objectid'] . '&eventid=' . $event['eventid']), $statusSpan, getSeverityCell($trigger['priority'])));
     }
     return $this->getOutput($item);
 }
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:21,代码来源:CScreenEvents.php

示例7: _getContent

 public function _getContent($refresh = false)
 {
     $table = new CTableInfo(_('No Login data found'));
     $table->setHeader(array(_('User'), _('System')));
     $data = array();
     $db = mysql_connect($this->config['server'], $this->config['user'], $this->config['password']);
     $sql = 'SELECT DISTINCT  username, GROUP_CONCAT(DISTINCT address SEPARATOR "\\n") as connected_to FROM logs.auth_log WHERE address <> "-" AND NOT username IN ("ANONYMOUS LOGON") AND (current_timestamp-ts_last)<900 GROUP BY username ORDER BY username;';
     $result = mysql_query($sql, $db);
     if (mysql_num_rows($result) == 0) {
         return $table;
     }
     while ($row = mysql_fetch_assoc($result)) {
         $table->addRow(array($row['username'], new CObject(str_replace("\n", "<br/>", $row['connected_to']))));
     }
     return $table;
 }
开发者ID:OneOaaS,项目名称:zabbix-dashboard-extension,代码行数:16,代码来源:dblogins.inc.php

示例8: _getContent

 public function _getContent($refresh = false)
 {
     $table = new CTableInfo(_('No eventlog data found'));
     $table->setHeader(array(_('System'), _('Notifications')));
     $data = array();
     $db = mysql_connect($this->config['server'], $this->config['user'], $this->config['password']);
     $sql = 'SELECT host, priority, COUNT(priority) as eventCount FROM logs.logs GROUP BY host, priority;';
     $result = mysql_query($sql, $db);
     if (mysql_num_rows($result) == 0) {
         return $table;
     }
     $table = new CTableInfo(_('No eventlog data found'));
     $systems = array();
     $headers = array();
     $pMerge = array('info' => 'Notice', 'notice' => 'Notice', 'warn' => 'Warning', 'warning' => 'Warning', 'err' => 'Error', 'error' => 'Error', 'crit' => 'Critical', 'critical' => 'Critical');
     foreach ($pMerge as $key => $value) {
         $headers[$value] = $value;
     }
     while ($row = mysql_fetch_assoc($result)) {
         if (!isset($systems[$row['host']])) {
             $systems[$row['host']] = array();
         }
         if (isset($pMerge[$row['priority']])) {
             $row['priority'] = $pMerge[$row['priority']];
         }
         $systems[$row['host']][$row['priority']] = $row['eventCount'];
         $headers[$row['priority']] = $row['priority'];
     }
     $headersCompile = array(_("Host"));
     foreach ($headers as $value) {
         $headersCompile[] = _($value);
     }
     $table->setHeader($headersCompile);
     foreach ($systems as $systemName => $eventData) {
         $systemData = array(new CLink($systemName, '/zabbix/eventlog.php?server=' . $systemName));
         foreach ($headers as $value) {
             if (isset($eventData[$value])) {
                 $systemData[] = _($eventData[$value]);
             } else {
                 $systemData[] = _("");
             }
         }
         $table->addRow($systemData);
     }
     return $table;
 }
开发者ID:OneOaaS,项目名称:zabbix-dashboard-extension,代码行数:46,代码来源:dbeventlog.inc.php

示例9: _getContent

 public function _getContent($refresh = false)
 {
     if (!isset($this->config['sql'])) {
         return "SQL not set";
     }
     $table = new CTableInfo($this->emptyText);
     $resultSet = DBselect($this->config['sql']);
     $result = DbFetchArray($resultSet);
     if (!empty($this->columns)) {
         $headers = array();
         foreach ($this->columns as $column) {
             $headers[] = !empty($column['name']) ? $column['name'] : $column['field'];
         }
     } else {
         if (isset($result[0])) {
             foreach ($result[0] as $key => $value) {
                 $headers[] = $key;
                 $column = array('eval' => false, 'evalClass' => false, 'class' => null, 'width' => null, 'name' => $key, 'value' => $key);
                 $this->columns[] = $column;
             }
         } else {
             $headers[] = "Empty Table";
         }
     }
     if ($this->headers) {
         $table->setHeader($headers);
     }
     $index = 0;
     foreach ($result as $row) {
         $row['index'] = $index++;
         $crow = new CRow(null, $this->getRowClass($row));
         foreach ($this->columns as $column) {
             $cell = new CCol($this->getValue($column, $row), $this->getClass($column, $row));
             $crow->addItem($cell);
         }
         $table->addRow($crow);
     }
     return $table;
 }
开发者ID:OneOaaS,项目名称:zabbix-dashboard-extension,代码行数:39,代码来源:dbgenericsql.inc.php

示例10: makeTriggersPopup

/**
 * Generate table for dashboard triggers popup.
 *
 * @see make_system_status
 *
 * @param array $triggers
 * @param array $ackParams
 * @param array $actions
 *
 * @return CTableInfo
 */
function makeTriggersPopup(array $triggers, array $ackParams, array $actions)
{
    $config = select_config();
    $popupTable = new CTableInfo();
    $popupTable->setAttribute('style', 'width: 400px;');
    $popupTable->setHeader(array(is_show_all_nodes() ? _('Node') : null, _('Host'), _('Issue'), _('Age'), _('Info'), $config['event_ack_enable'] ? _('Ack') : null, _('Actions')));
    CArrayHelper::sort($triggers, array(array('field' => 'lastchange', 'order' => ZBX_SORT_DOWN)));
    foreach ($triggers as $trigger) {
        // unknown triggers
        $unknown = SPACE;
        if ($trigger['state'] == TRIGGER_STATE_UNKNOWN) {
            $unknown = new CDiv(SPACE, 'status_icon iconunknown');
            $unknown->setHint($trigger['error'], '', 'on');
        }
        // ack
        if ($config['event_ack_enable']) {
            $ack = isset($trigger['event']['eventid']) ? getEventAckState($trigger['event'], true, true, $ackParams) : _('No events');
        } else {
            $ack = null;
        }
        // action
        $action = isset($trigger['event']['eventid']) && isset($actions[$trigger['event']['eventid']]) ? $actions[$trigger['event']['eventid']] : _('-');
        $popupTable->addRow(array(get_node_name_by_elid($trigger['triggerid']), $trigger['hosts'][0]['name'], getSeverityCell($trigger['priority'], $trigger['description']), zbx_date2age($trigger['lastchange']), $unknown, $ack, $action));
    }
    return $popupTable;
}
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:37,代码来源:blocks.inc.php

示例11: CForm

// append form header to widget
$userGroupListForm = new CForm('get');
$userGroupComboBox = new CComboBox('filter_usrgrpid', $_REQUEST['filter_usrgrpid'], 'submit()');
$userGroupComboBox->addItem(0, _('All'));
foreach ($this->data['userGroups'] as $userGroup) {
    $userGroupComboBox->addItem($userGroup['usrgrpid'], $userGroup['name']);
}
$userGroupListForm->addItem(array(_('User group') . SPACE, $userGroupComboBox));
$usersWidget->addHeader(_('Users'), $userGroupListForm);
$usersWidget->addHeaderRowNumber();
// create form
$usersForm = new CForm();
$usersForm->setName('userForm');
// create users table
$usersTable = new CTableInfo(_('No users found.'));
$usersTable->setHeader(array(new CCheckBox('all_users', null, "checkAll('" . $usersForm->getName() . "', 'all_users', 'group_userid');"), make_sorting_header(_('Alias'), 'alias', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_x('Name', 'user first name'), 'name', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Surname'), 'surname', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('User type'), 'type', $this->data['sort'], $this->data['sortorder']), _('Groups'), _('Is online?'), _('Login'), _('Frontend access'), _('Debug mode'), _('Status')));
foreach ($this->data['users'] as $user) {
    $userId = $user['userid'];
    $session = $this->data['usersSessions'][$userId];
    // online time
    if ($session['lastaccess']) {
        $onlineTime = $user['autologout'] == 0 || ZBX_USER_ONLINE_TIME < $user['autologout'] ? ZBX_USER_ONLINE_TIME : $user['autologout'];
        $online = $session['lastaccess'] + $onlineTime >= time() ? new CCol(_('Yes') . ' (' . zbx_date2str(DATE_TIME_FORMAT_SECONDS, $session['lastaccess']) . ')', 'enabled') : new CCol(_('No') . ' (' . zbx_date2str(DATE_TIME_FORMAT_SECONDS, $session['lastaccess']) . ')', 'disabled');
    } else {
        $online = new CCol(_('No'), 'disabled');
    }
    // blocked
    $blocked = $user['attempt_failed'] >= ZBX_LOGIN_ATTEMPTS ? new CLink(_('Blocked'), 'users.php?action=user.massunblock&group_userid[]=' . $userId, 'on') : new CSpan(_('Ok'), 'green');
    // user groups
    order_result($user['usrgrps'], 'name');
    $usersGroups = array();
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:administration.users.list.php

示例12: CForm

    }
}
$form = new CForm();
$form->SetMethod('get');
$form->AddItem(new CButton("form", S_CREATE_MEDIA_TYPE));
$row_count = 0;
$numrows = new CSpan(null, 'info');
$numrows->addOption('name', 'numrows');
$header = get_table_header(array(S_CONFIGURATION_OF_MEDIA_TYPES_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
show_table_header($header, $form);
if (isset($_REQUEST["form"])) {
    echo SBR;
    insert_media_type_form();
} else {
    $table = new CTableInfo(S_NO_MEDIA_TYPES_DEFINED);
    $table->setHeader(array(make_sorting_link(S_TYPE, 'mt.type'), make_sorting_link(S_DESCRIPTION, 'mt.description'), S_DETAILS));
    $result = DBselect('SELECT mt.* ' . ' FROM media_type mt' . ' WHERE ' . DBin_node('mt.mediatypeid') . order_by('mt.type,mt.description'));
    while ($row = DBfetch($result)) {
        switch ($row['type']) {
            case MEDIA_TYPE_EMAIL:
                $details = S_SMTP_SERVER . ": '" . $row['smtp_server'] . "', " . S_SMTP_HELO . ": '" . $row['smtp_helo'] . "', " . S_SMTP_EMAIL . ": '" . $row['smtp_email'] . "'";
                break;
            case MEDIA_TYPE_EXEC:
                $details = S_SCRIPT_NAME . ": '" . $row['exec_path'] . "'";
                break;
            case MEDIA_TYPE_SMS:
                $details = S_GSM_MODEM . ": '" . $row['gsm_modem'] . "'";
                break;
            case MEDIA_TYPE_JABBER:
                $details = S_JABBER_IDENTIFIER . ": '" . $row['username'] . "'";
                break;
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:media_types.php

示例13: strtotime

                $wd = $wd == 0 ? 6 : $wd - 1;
                $beg = $time - $wd * SEC_PER_DAY;
            }
            return strtotime("+{$w} week", $beg);
        }
        function format_time($t)
        {
            return zbx_date2str(DATE_TIME_FORMAT, $t);
        }
        function format_time2($t)
        {
            return format_time($t);
        }
        break;
}
$table->setHeader($header);
$intervals = array();
for ($t = $from; $t <= $to; $t++) {
    if (($start = get_time($t)) > time()) {
        break;
    }
    if (($end = get_time($t + 1)) > time()) {
        $end = time();
    }
    $intervals[] = array('from' => $start, 'to' => $end);
}
$sla = API::Service()->getSla(array('serviceids' => $service['serviceid'], 'intervals' => $intervals));
$sla = reset($sla);
foreach ($sla['sla'] as $intervalSla) {
    $ok = new CSpan(sprintf('%dd %dh %dm', $intervalSla['okTime'] / SEC_PER_DAY, $intervalSla['okTime'] % SEC_PER_DAY / SEC_PER_HOUR, $intervalSla['okTime'] % SEC_PER_HOUR / SEC_PER_MIN), 'off');
    $problems = new CSpan(sprintf('%dd %dh %dm', $intervalSla['problemTime'] / SEC_PER_DAY, $intervalSla['problemTime'] % SEC_PER_DAY / SEC_PER_HOUR, $intervalSla['problemTime'] % SEC_PER_HOUR / SEC_PER_MIN), 'on');
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:report3.php

示例14: CWidget

check_fields($fields);
$rprt_wdgt = new CWidget();
$_REQUEST['period'] = getRequest('period', 'day');
$admin_links = CWebUser::$data['type'] == USER_TYPE_ZABBIX_ADMIN || CWebUser::$data['type'] == USER_TYPE_SUPER_ADMIN;
$form = new CForm('get');
$cmbPeriod = new CComboBox('period', $_REQUEST['period'], 'submit()');
$cmbPeriod->addItem('day', _('Day'));
$cmbPeriod->addItem('week', _('Week'));
$cmbPeriod->addItem('month', _('Month'));
$cmbPeriod->addItem('year', _('Year'));
$form->addItem($cmbPeriod);
$rprt_wdgt->addPageHeader(_('MOST BUSY TRIGGERS TOP 100'));
$rprt_wdgt->addHeader(_('Report'), $form);
$rprt_wdgt->addItem(BR());
$table = new CTableInfo(_('No triggers found.'));
$table->setHeader(array(_('Host'), _('Trigger'), _('Severity'), _('Number of status changes')));
switch ($_REQUEST['period']) {
    case 'week':
        $time_dif = SEC_PER_WEEK;
        break;
    case 'month':
        $time_dif = SEC_PER_MONTH;
        break;
    case 'year':
        $time_dif = SEC_PER_YEAR;
        break;
    case 'day':
    default:
        $time_dif = SEC_PER_DAY;
        break;
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:report5.php

示例15: CWidget

** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
$discoveryWidget = new CWidget();
// create new discovery rule button
$createForm = new CForm('get');
$createForm->cleanItems();
$createForm->addItem(new CSubmit('form', _('Create discovery rule')));
$discoveryWidget->addPageHeader(_('CONFIGURATION OF DISCOVERY RULES'), $createForm);
$discoveryWidget->addHeader(_('Discovery rules'));
$discoveryWidget->addHeaderRowNumber();
// create form
$discoveryForm = new CForm();
$discoveryForm->setName('druleForm');
// create table
$discoveryTable = new CTableInfo(_('No discovery rules found.'));
$discoveryTable->setHeader(array(new CCheckBox('all_drules', null, "checkAll('" . $discoveryForm->getName() . "', 'all_drules', 'g_druleid');"), make_sorting_header(_('Name'), 'name', $this->data['sort'], $this->data['sortorder']), _('IP range'), _('Delay'), _('Checks'), _('Status')));
foreach ($data['drules'] as $drule) {
    array_push($drule['description'], new CLink($drule['name'], '?form=update&druleid=' . $drule['druleid']));
    $status = new CCol(new CLink(discovery_status2str($drule['status']), '?g_druleid[]=' . $drule['druleid'] . '&action=' . ($drule['status'] == DRULE_STATUS_ACTIVE ? 'drule.massdisable' : 'drule.massenable'), discovery_status2style($drule['status'])));
    $discoveryTable->addRow(array(new CCheckBox('g_druleid[' . $drule['druleid'] . ']', null, null, $drule['druleid']), $drule['description'], $drule['iprange'], $drule['delay'], !empty($drule['checks']) ? implode(', ', $drule['checks']) : '', $status));
}
// create go buttons
$goComboBox = new CComboBox('action');
$goOption = new CComboItem('drule.massenable', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected discovery rules?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('drule.massdisable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable selected discovery rules?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('drule.massdelete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected discovery rules?'));
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:configuration.discovery.list.php


注:本文中的CTableInfo::setHeader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。