Esempio n. 1
0
        }
    }
}
$tenantList = $dev->GetTop10Tenants();
$powerList = $dev->GetTop10Power();
//
//
//	Begin Report Generation
//
//
$pdf = new PDF_Diag();
include_once "loadfonts.php";
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont($config->ParameterArray["PDFfont"], '', 8);
$pdf->SetFillColor(0, 0, 0);
$pdf->SetTextColor(255);
$pdf->SetDrawColor(128, 0, 0);
$pdf->SetLineWidth(0.3);
$pdf->SetfillColor(224, 235, 255);
$pdf->SetTextColor(0);
$pdf->SetFont($config->ParameterArray["PDFfont"], "", 12);
if (function_exists('money_format')) {
    $pdf->Cell(300, 5, __("Annual Cost Per Rack Unit (Year)") . ': ' . money_format("%.2n", $annualCostPerUYear), "", 1, "L", "");
    $pdf->Cell(300, 5, __("Annual Cost Per Watt (Year)") . ': ' . money_format("%.4n", $annualCostPerWattYear), "", 1, "L", "");
} else {
    $pdf->Cell(300, 5, __("Annual Cost Per Rack Unit (Year)") . ': ' . sprintf($annualCostPerUYear, "%.2n"), "", 1, "L", "");
    $pdf->Cell(300, 5, __("Annual Cost Per Watt (Year)") . ': ' . sprintf($annualCostPerWattYear, "%.4n"), "", 1, "L", "");
}
$pdf->Ln();
$pdf->Ln();
Esempio n. 2
0
$colors[3] = array(255, 255, 100);
$colors[4] = array(255, 204, 102);
$colors[5] = array(204, 102, 0);
$colors[6] = array(255, 0, 0);
$colors[7] = array(0, 0, 255);
$pdf->SetFont($config->ParameterArray['PDFfont'], 'B', 16);
$pdf->Cell(0, 18, __("Device Ages by Count"), '', 1, 'C', 0);
$pdf->SetXY(10, 70);
$pdf->PieChart(200, 80, $agingList, '%l : %v devices (%p)', $colors);
//
// cycle through years 1-3 and produce table reports
//
for ($year = 1; $year <= 5; $year++) {
    $start_year = $year - 1;
    $pdf->AddPage();
    $pdf->SetFillColor(224, 235, 255);
    $pdf->SetFont($config->ParameterArray['PDFfont'], 'B', 16);
    $pdf->Cell(0, 15, __("Devices between {$start_year} and {$year} years old"), '', 1, 'C', 0);
    $pdf->SetFont($config->ParameterArray['PDFfont'], '', 10);
    $headerTags = array(__("Label"), __("Age"), __("Owner"), __("Primary Contact"));
    $cellWidths = array(45, 30, 50, 45);
    $maxval = count($headerTags);
    for ($col = 0; $col < $maxval; $col++) {
        $pdf->Cell($cellWidths[$col], 7, $headerTags[$col], 1, 0, 'C', 0);
    }
    $pdf->Ln();
    $fill = 1;
    foreach ($age_list[$year] as $devRow) {
        $dept->DeptID = $devRow->Owner;
        $dept->GetDeptByID();
        $con->PersonID = $devRow->PrimaryContact;