示例#1
0
        } else {
            $time_end = $curr_clock;
        }
    }
}
$curr_clock = $time_end;
//SDI(array($prev_clock, $curr_clock, $next_clock, $time_end));
// end of navigation initialization
// -------------
$last_clock_tmp = null;
$last_clock = null;
$limit = $USER_DETAILS['rows_per_page'];
$col = 0;
if ($source == EVENT_SOURCE_DISCOVERY) {
    $last_clock = null;
    $table = get_history_of_discovery_events($time_end, $limit, $last_clock);
    $col = $table->getNumRows();
} else {
    $config = select_config();
    $sql_from = $sql_cond = '';
    if ($_REQUEST['hostid'] > 0) {
        $sql_cond = ' and h.hostid=' . $_REQUEST['hostid'];
    } else {
        if ($_REQUEST['groupid'] > 0) {
            $sql_from = ', hosts_groups hg ';
            $sql_cond = ' AND h.hostid=hg.hostid and hg.groupid=' . $_REQUEST['groupid'];
        } else {
            $sql_from = '';
            $sql_cond = ' AND ' . DBcondition('h.hostid', $available_hosts);
        }
    }
示例#2
0
文件: events.php 项目: rennhak/zabbix
$text = array(S_HISTORY_OF_EVENTS_BIG, SPACE, date('[H:i:s]', time()));
$url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1');
$fs_icon = new CDiv(SPACE, 'fullscreen');
$fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
$fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
$p_elements[] = get_table_header(S_EVENTS, $r_form);
//-------------
// Day View Calc
$start = $_REQUEST['nav_time'];
$start = mktime(0, 0, 0, date('m', $start), date('d', $start), date('Y', $start));
$end = $start + 86400;
//SDI('Start: '.date('d m Y',$start));
//SDI('End: '.date('d m Y',$end));
// -------------
if ($source == EVENT_SOURCE_DISCOVERY) {
    $table = get_history_of_discovery_events($start, $end);
} else {
    $config = select_config();
    $sql_from = $sql_cond = '';
    if ($_REQUEST['hostid'] > 0) {
        $sql_cond = ' and h.hostid=' . $_REQUEST['hostid'];
    } else {
        if ($_REQUEST['groupid'] > 0) {
            $sql_from = ', hosts_groups hg ';
            $sql_cond = ' AND h.hostid=hg.hostid and hg.groupid=' . $_REQUEST['groupid'];
        } else {
            $sql_from = '';
            $sql_cond = ' AND ' . DBcondition('h.hostid', $available_hosts);
        }
    }
    $sql_cond .= isset($_REQUEST['triggerid']) && $_REQUEST['triggerid'] > 0 ? ' AND t.triggerid=' . $_REQUEST['triggerid'] . ' ' : '';