Ejemplo n.º 1
0
    // Get name to be used in PLACEHOLDER-part of filename
    $name = $hosts[0]['name'];
    $reportname = str_replace(" ", "_", $name);
    CreatePDF($hosts);
} elseif ($reporttype == 'hostgroup') {
    if (!is_numeric($groupid)) {
        echo "ERROR: Need groupid for group report!</br>\n";
        exit;
    }
    $hosts = ZabbixAPI::fetch_array('host', 'get', array('output' => array('hostid', 'name'), 'with_graphs' => 'true', 'groupids' => $groupid)) or die('Unable to get hosts: ' . print_r(ZabbixAPI::getLastError(), true));
    //var_dump($hosts);
    $hostgroupname = ZabbixAPI::fetch_array('hostgroup', 'get', array('output' => array('name'), 'groupids' => $groupid)) or die('Unable to get hostgroup: ' . print_r(ZabbixAPI::getLastError(), true));
    //var_dump($hostgroupname);
    $name = $hostgroupname[0]['name'];
    $reportname = str_replace(" ", "_", $name);
    CreatePDF($hosts);
} else {
    echo "Report type not selected!\n";
    exit;
}
//
// Create PDF
//
if (!file_exists($tmp_pdf_data)) {
    echo "Report {$tmp_pdf_data} not found! Cannot continue to create PDF.";
    exit;
}
$pdf_filename = "{$reportname}.pdf";
//$pdf = new Cezpdf('a4','portrait');
$pdf = new Creport("{$paper_format}", "{$paper_orientation}");
$pdf->ezSetMargins(20, 20, 50, 50);
Ejemplo n.º 2
0
             if ($_POST['DeleteUser']) {
                 DeleteUser($mysqli);
                 $_SESSION["list"] = $tmpl['mainAdmin'];
             } else {
                 if ($_POST['ChangeUser']) {
                     ChangeUser($mysqli, $_POST['group_user'], $_POST['block']);
                     $_SESSION["list"] = $tmpl['mainAdmin'];
                 } else {
                     if ($_POST["selectoption"] == "Отчеты") {
                         //
                         //CreatePDF($mysqli);
                         $_SESSION['list'] = $tmpl['pdf_otchet'];
                     } else {
                         if ($_POST["selectedOtchet"]) {
                             //
                             CreatePDF($mysqli, $_POST["selectot"]);
                             //$_SESSION['list']=$tmpl['pdf_otchet'];
                         } else {
                             if ($_POST["selectoption"] == "Статистика") {
                                 $_SESSION['list'] = statistica($mysqli, $tmpl['tab_stat_admin'], $tmpl['row_stat_admin'], $tmpl['row_cat_admin']);
                                 // $_SESSION['list'] = $tmpl['diag'];
                             } else {
                                 $_SESSION["list"] = $tmpl['mainAdmin'];
                             }
                         }
                     }
                 }
             }
         }
     }
 }