Exemple #1
0
        $pdf->Cell($cellWidths[0], 6, $devRow->Label, "LBRT", 0, "L", $fill);
        $pdf->Cell($cellWidths[1], 6, $devRow->SerialNo, "LBRT", 0, "L", $fill);
        $pdf->Cell($cellWidths[2], 6, $devRow->AssetTag, "LBRT", 0, "L", $fill);
        $pdf->Cell($cellWidths[3], 6, $dc->Name, "LBRT", 0, "L", $fill);
        $pdf->Cell($cellWidths[4], 6, $cab->Location, "LBRT", 0, "L", $fill);
        $pdf->Cell($cellWidths[5], 6, $devRow->Position, "LBRT", 0, "L", $fill);
        $pdf->Cell($cellWidths[6], 6, $devRow->Height, "LBRT", 0, "L", $fill);
        $pdf->Cell($cellWidths[7], 6, $devRow->NominalWatts, "LBRT", 0, "L", $fill);
        if (function_exists('money_format')) {
            $pdf->Cell($cellWidths[8], 6, money_format("%.2n", $hostingCost), "LBRT", 1, "L", $fill);
        } else {
            $pdf->Cell($cellWidths[8], 6, sprintf($hostingCost, "%.2n"), "LBRT", 1, "L", $fill);
        }
        $TotalRU += $devRow->Height;
        $TotalBTU += $devRow->NominalWatts * 3.412;
        $DCRU += $devRow->Height;
        $DCBTU += $devRow->NominalWatts * 3.412;
        $fill = !$fill;
    }
    $pdf->Cell(0, 5, __("Total Rack Units for All Data Centers") . ': ' . $TotalRU, "", 1, "L", "");
    $pdf->Cell(0, 5, __("Total BTU Output for All Data Centers") . ': ' . sprintf("%d (%.2f Tons)", $TotalBTU, $TotalBTU / 12000), "", 1, "L", "");
    if (function_exists('money_format')) {
        $pdf->Cell(0, 5, __("Annual Electrical Cost for Department") . ': ' . money_format("%.2n", $totalElectricalCost), "", 1, "L", "");
        $pdf->Cell(0, 5, __("Annual Infrastructure Cost for Department") . ': ' . money_format("%.2n", $totalHostingCost), "", 1, "L", "");
    } else {
        $pdf->Cell(0, 5, __("Annual Electrical Cost for Department") . ': ' . sprintf($totalElectricalCost, "%.2n"), "", 1, "L", "");
        $pdf->Cell(0, 5, __("Annual Infrastructure Cost for Department") . ': ' . sprintf($totalHostingCost, "%.2n"), "", 1, "L", "");
    }
}
$pdf->Output();