$filter_table->addRow($footer_col);
$filter_form->addItem($filter_table);
//    $filter_form->addVar('report_timesince', date('YmdHis', $report_timesince));
//    $filter_form->addVar('report_timetill', date('YmdHis', $report_timetill));
$hostprof_wdgt->addFlicker($filter_form, true);
// FIM Formulario de Filtro =========================================================
insert_js($script);
$numrows = new CDiv();
$numrows->setAttribute('name', 'numrows');
$report = array();
$hostprof_wdgt->addHeader($numrows);
$r_form = new CForm();
// Combo com os formatos de exibição ---------------------------------------
$cmbFormato = new CComboBox('formato', $formato, 'javascript: submit();');
$cmbFormato->additem('html', 'HTML');
$cmbFormato->additem('csv', 'CSV');
// Combo com as opções de relatorios possiveis -----------------------------
$cmbMenus = new CComboBox('submenu', $subMenu, 'javascript: submit();');
//    var_dump (zbxeSubMenus ('submenu_05'));
foreach (zbxeSubMenus('sub_report') as $row) {
    $cmbMenus->additem($row['url'], $row['label']);
}
$r_form->addItem(array(array(bold(_zeT('Formatting')), ': '), array($cmbFormato)));
$r_form->addItem(array(array(bold(_zeT('Report')), ': '), array($cmbMenus)));
$hostprof_wdgt->addPageHeader(_zeT('Zabbix-Extras Reports'));
$hostprof_wdgt->addHeader(_('Report'), $r_form);
//    $hostprof_wdgt->addItem(BR());
$paging = getPagingLine($report);
//$hostprof_wdgt->addItem($table);
$hostprof_wdgt->show();
include_once 'include/page_footer.php';
Exemple #2
0
$pageFilter = new CPageFilter($options);
$filter_table = new CTable('', 'filter_config');
$filter_table->setAttribute('border', 0);
$filter_table->setAttribute('width', '100%');
$cmbGroups = $pageFilter->getGroupsCB(true);
$cmbHosts = $pageFilter->getHostsCB(true);
$filter_table->addRow(array(array(bold(_('Group')), ': ', $cmbGroups), array(bold(_('Host')), ': ', $cmbHosts), array()));
$groupids = checkAccessGroup('groupid');
$hostids = checkAccessHost('hostid');
// --------------------------- Fim Filtro ---------------------------------------------------------------------
$options = array();
$options['templated_hosts'] = 1;
$hosts = API::Host()->get($options);
$filtroSegHosts = " hos.status <> 1 AND " . dbConditionInt('hos.hostid', zbx_objectValues($hosts, 'hostid'));
$rep2_wdgt = new CWidget();
$rep2_wdgt->addPageHeader(_zeT('Not Supported Items Report'));
$filter_form = new CForm();
$filter_form->setMethod('get');
$filter_form->setAttribute('name', 'zbx_filter');
$filter_form->setAttribute('id', 'zbx_filter');
$filter = new CButton('filter', _("Filter"));
$filter->onClick("javascript: submit();");
$reset = new CButton('reset', _('Reset'));
$reset->onClick("javascript: clearAllForm('zbx_filter');");
$footer_col = new CCol(array($filter, SPACE, $reset), 'center');
$footer_col->setColSpan(4);
$filter_table->addRow($footer_col);
$filter_form->addItem($filter_table);
//		$filterForm = get_report2_filter($config, $PAGE_GROUPS, $PAGE_HOSTS);
$rep2_wdgt->addFlicker($filter_form, true);
if (isset($hostid)) {
function zbxeShowPreferences($id)
{
    //global $ZBXE_VAR;
    global $_SERVER;
    if (strpos($_SERVER["REQUEST_URI"], "users.php?form=update&userid=") > 0) {
        $userid = get_request('userid', 0);
    } else {
        $userid = $id != "" ? 0 : CWebUser::$data['userid'];
    }
    $userFormExtra = new CFormList('userFormExtra' . $id);
    // Interface Web
    $companyTable = new CTable();
    $companyTable->setAttribute('id', 'extrasTab' . $id);
    $companyTable->addRow(array(SPACE, SPACE, _('Name'), _zeT('Color'), SPACE, SPACE));
    //var_dump ('map_company'.$id . " - [$userid]" . zbxeConfigValue('map_company',$userid) . "<br>");
    $mapCompany = new CTextBox('map_company' . $id, zbxeConfigValue('map_company', $userid), ZBX_TEXTBOX_STANDARD_SIZE);
    $mapCompany->attr('autofocus', 'autofocus');
    $mapDateColor = new CColor('map_date_color' . $id, zbxeConfigValue('map_date_color', $userid));
    $companyTable->addRow(array(SPACE, SPACE, $mapCompany, $mapDateColor, SPACE, SPACE));
    $userFormExtra->addRow(_zeT('Company'), new CDiv($companyTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
    $mapBackColor = new CColor('map_background_color' . $id, zbxeConfigValue('map_background_color', $userid));
    $mapTable = new CTable();
    $mapTable->setAttribute('id', 'borderTable');
    $mapTable->addRow(array(SPACE, SPACE, _('Background'), SPACE, _zeT('Border'), SPACE, _('Title'), SPACE, SPACE));
    $mapTable->addRow(array(SPACE, SPACE, $mapBackColor, SPACE, array(new CColor('map_border_color' . $id, zbxeConfigValue('map_border_color', $userid)), $userid == 0 ? new CCheckBox('map_border_show' . $id, zbxeConfigValue('map_border_show', $userid), null, 1) : ""), SPACE, array(new CColor('map_title_color' . $id, zbxeConfigValue('map_title_color', $userid)), $userid == 0 ? new CCheckBox('map_title_show' . $id, zbxeConfigValue('map_title_show', $userid), null, 1) : ""), SPACE, SPACE));
    $userFormExtra->addRow(_zeT('Maps'), new CDiv($mapTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
    if (CWebUser::$data['userid'] > 0) {
        $userFormExtra->addRow(_zeT('Delete User Personalization'), new CCheckBox('xbxe_clean'));
    }
    return $userFormExtra;
}
Exemple #4
0
         $proximoDia = date($intervalMask2[$timeShiftProjection], $dataAtual);
         $dataAtual = strtotime($intervalFactor2[$timeShiftProjection], $dataAtual);
         $report[$cont]['momento'] = $proximoDia;
         $report[$cont]['valor'] = round(floatval($ultimo) + $tendencia * $intervalFactor[$timeShiftProjection], $casasDecimais);
         $ultimo = $report[$cont]['valor'];
         $report[$cont]['tipo'] = _zeT('Trend');
         $cont++;
     }
 }
 $table = new CTableInfo();
 switch ($formato) {
     case 'csv':
         $table->setHeader(array(_zeT("Data")));
         break;
     case 'html':
         $table->setHeader(array(_zeT('Instant'), _zeT('Value'), _zeT('Type')));
         break;
 }
 $points = "";
 $descUnidade = "";
 for ($i = 0; $i < $cont; $i++) {
     switch ($formato) {
         case 'csv':
             $table->addRow(array(quotestr($report[$i]['momento']) . ";" . quotestr($report[$i]['valor']) . ";" . quotestr($report[$i]['tipo']) . ";"));
             break;
         case 'html':
             $momento = new CCol($report[$i]['momento'], 1);
             $valor = convert_units(array('value' => $report[$i]['valor'], 'units' => $unidade));
             $valor = new CCol($valor, 1);
             $tipo = new CCol($report[$i]['tipo'], 1);
             $table->addRow(array($momento, $valor, $tipo));
Exemple #5
0
                }
                $table->addRow(array($linhaCSV));
                break;
            case 'html':
                for ($x = 0; $x < $cont2; $x++) {
                    $linha[$x] = new CCol($report[$i][$x] . ($x == 7 || $x == 8 ? $linhasDesc : " "), 1);
                }
                $table->addRow($linha);
                break;
        }
    }
    $descricao = new CCol('');
    $descricao->setAttribute('colspan', '6');
    $descricao->setAttribute('align', 'right');
    if ($formato !== 'csv') {
        if ($view == "G") {
            $table->addRow(array('Total', $historyTotal . $linhasDesc, $trendTotal . $linhasDesc, convert_units(array('value' => $storageTotal, 'units' => 'B')), $vpsTotal . ' vps'));
        } else {
            $table->addRow(array($descricao, 'Total', $historyTotal . $linhasDesc, $trendTotal . $linhasDesc, convert_units(array('value' => $storageTotal, 'units' => 'B')), $vpsTotal . ' vps'));
        }
    }
    $numrows = new CDiv();
    $numrows->setAttribute('name', 'numrows');
    $hostprof_wdgt->addHeader($numrows);
    $paging = getPagingLine($report);
    $hostprof_wdgt->addItem($table);
} else {
    $hostprof_wdgt->addItem(_zeT('Enter the parameters for research!'));
}
$hostprof_wdgt->show();
include_once 'include/page_footer.php';
Exemple #6
0
 function imagem($tipo, $hint, $qtd)
 {
     if ($qtd > 0) {
         if ($tipo === "down") {
             $msg = "Possible cause.";
             $dep_type = "DEP_DOWN";
         } else {
             $msg = "Possible consequence.";
             $dep_type = "DEP_UP";
         }
         $img = new Cimg('images/general/arrow_' . $tipo . '2.png', $dep_type);
         $img->setAttribute('style', 'vertical-align: top; border: 0px;');
         $img->setHint(_zeT($msg) . "\n" . _zeT('Related incidents') . ": " . $qtd . "\n" . $hint);
         return $img;
     } else {
         return "";
     }
 }
function zbxeSubMenus($menu)
{
    $query = 'select tx_value from zbxe_preferences where tx_option = ' . quotestr($menu);
    $res = DBselect($query);
    $retorno = array();
    $i = 0;
    while ($row = DBfetch($res)) {
        $tmp = explode("|", $row['tx_value']);
        $retorno[$i] = array('url' => $tmp[0], 'label' => _zeT($tmp[1]));
        $i += 1;
    }
    return $retorno;
}