Beispiel #1
0
require_once 'ossim_conf.inc';
$client = new JasperClient($conf);
$report_unit = "/OSSIM_Complete_Report_p";
$report_format = "PDF";
$report_params = array();
$result = $client->requestReport($report_unit, $report_format, $report_params, 'list');
$tempJS = '';
$reportOrd = array();
foreach ($result as $key => $report) {
    $i++;
    $reportOrd[$report['name']] = '<tr class="CLASS_KEY">
                                          <td colspan="2" class="reportName" style="text-align: left; padding-left: 30px">
                                                  <h3>' . _($report['label']) . '</h3>';
    $uriStyle = $report['uriString'] . '_files/Style.jrtx';
    $client = new JasperClient($conf);
    $result = $client->getResource($uriStyle, 'jrtx');
    $backgroundTitle = $result[0]['backcolor'];
    $colorTitle = $result[1]['forecolor'];
    $backgroundSubtitle = $result[2]['backcolor'];
    $colorSubtitle = $result[3]['forecolor'];
    $colorContent = $result[4]['forecolor'];
    $reportOrd[$report['name']] .= '
                                          </td>
                                  </tr>
						  <tr class="CLASS_KEY">
                             <td class="reportName" style="text-align: left; padding-left: 30px;">
                                <form method="POST" action="jasper_config_modify.php" id="' . $report['name'] . '_3" enctype="multipart/form-data">
									<table cellspacing="0" cellpadding="0" border="0" width="100%" class="noborder tableColorSelector" style="min-width:300px;">
                                    <tr>
										<td></td>
										<td>' . _("Background Color") . '</td>
if ($_FILES[$file_name_param]['size'] > 0 || $POSTAction == 'RestoreOriginal' || $POSTAction == 'changeColors') {
    require_once 'ossim_conf.inc';
    $client = new JasperClient($conf);
}
if ($_FILES[$file_name_param]['size'] > 0) {
    if ($_FILES[$file_name_param]['type'] != 'image/gif') {
        echo "<strong>" . _("Error: please only .gif") . "</strong>\n";
        die;
    } else {
        $file = file_get_contents($_FILES[$file_name_param]['tmp_name']);
        $result = $client->putResource($file_name, $POSTReportUnit, 'img', $file);
    }
} else {
    if ($POSTAction == 'RestoreOriginal') {
        $file_name_original = '/' . $POSTReportUnit . '_files/bk_head.gif';
        $file_original = $client->getResource($file_name_original, 'img');
        $result = $client->putResource($file_name, $POSTReportUnit, 'img', $file_original);
        //$result = $client->copyResource($file_name,$POSTReportUnit,'img',$file_name_original);
    } else {
        if ($POSTAction == 'changeColors') {
            $uriStyle = $POSTReportUnit . '_files/Style.jrtx';
            $POSTBackgroundTitle = POST('backgroundTitle');
            $POSTColorTitle = POST('colorTitle');
            $POSTBackgroundSubtitle = POST('backgroundSubtitle');
            $POSTColorSubtitle = POST('colorSubtitle');
            $POSTColorContent = POST('colorContent');
            $parameters = array('backgroundTitle' => $POSTBackgroundTitle, 'colorTitle' => $POSTColorTitle, 'backgroundSubtitle' => $POSTBackgroundSubtitle, 'colorSubtitle' => $POSTColorSubtitle, 'colorContent' => $POSTColorContent);
            $uriParent = $POSTReportUnit;
            $result = $client->setJrtx($uriStyle, $uriParent, $parameters);
        }
    }
Beispiel #3
0
<?php

require_once 'classes/Session.inc';
require_once 'classes/JasperReport.inc';
Session::logcheck("MenuReports", "ReportsReportServer");
$GETReportUnit = GET('report_unit');
if (!is_null($GETReportUnit)) {
    require_once 'ossim_conf.inc';
    $client = new JasperClient($conf);
    $result = $client->getResource($GETReportUnit, 'img');
    header("Content-type: image/gif");
    echo $result;
} else {
    ?>
    <html>
        <head>
            <title>&nbsp;</title>
            <link rel="stylesheet" type="text/css" href="../style/style.css"/>
            <link rel="stylesheet" type="text/css" href="../style/style.css"/>
        </head>
        <body>
            <p><?php 
    echo _("Report no exist");
    ?>
</p>
            <form method="POST" action="#">
                <p><input class="btn center" type="button" value="<?php 
    echo _('Close');
    ?>
" onclick="javascript:window.close();" /></p>
            </form>