예제 #1
0
     $pdf->_finReport = true;
     $width = $pdf->w - $pdf->lMargin - $pdf->rMargin;
     $height = 12;
     $pdf->AddPage();
     $pdf->SetFillColor(255, 255, 255);
     # Content
     $pdf->SetFont('Arial', '', 9);
     foreach ($dataShow as $key => $row) {
         $i = 0;
         foreach ($row as $head => $cont) {
             if ($head != 'data') {
                 $pdf->Cell($length[$i] / 100 * $width, $height * count($row['data']), $cont, 'LBR', 0, $align[$i], 1);
             } else {
                 $tmpX = $pdf->GetX();
                 foreach ($row['data'] as $k => $r) {
                     $pdf->SetX($tmpX);
                     $pdf->Cell(15 / 100 * $width, $height, $k, 'LBR', 0, 'L');
                     $pdf->Cell(25 / 100 * $width, $height, $r['old'] . ' => ' . $r['new'], 'LBR', 0, 'L');
                     $pdf->Ln();
                 }
             }
             $i++;
         }
     }
     $pdf->Output();
     break;
 default:
     # Redefine Align
     $alignPrev = array();
     foreach ($align as $key => $row) {
         switch ($row) {
예제 #2
0
 $align = explode(",", "L,L,L,R,R,L");
 $length = explode(",", "7,25,38,8,8,13");
 $pdf = new zPdfMaster('L', 'pt', 'A4');
 $pdf->SetFont('Arial', '', 8);
 $pdf->setAttr1($title, $align, $length, $colPdf);
 $width = $pdf->w - $pdf->lMargin - $pdf->rMargin;
 $height = 12;
 $pdf->AddPage();
 $pdf->SetFillColor(255, 255, 255);
 foreach ($data as $row) {
     $i = 0;
     $awalY = $pdf->GetY();
     $awalX = $pdf->GetX();
     $currentX = $pdf->GetX();
     $pdf->SetY($awalY);
     $pdf->SetX($currentX);
     $pdf->MultiCell($length[0] / 100 * $width, $height, $row['noakun'], '0', $align[0]);
     $pdf->SetY($awalY);
     $pdf->SetX($currentX + $length[0] / 100 * $width);
     $currentX = $pdf->GetX();
     $pdf->MultiCell($length[1] / 100 * $width, $height, $kamusakun[$row['noakun']], '0', $align[1]);
     $akhirYNoAkun = $pdf->GetY();
     $pdf->SetY($awalY);
     $pdf->SetX($currentX + $length[1] / 100 * $width);
     $currentX = $pdf->GetX();
     $pdf->MultiCell($length[2] / 100 * $width, $height, $row['keterangan'], '0', $align[2]);
     $akhirYKeterangan = $pdf->GetY();
     $pdf->SetY($awalY);
     $pdf->SetX($currentX + $length[2] / 100 * $width);
     $currentX = $pdf->GetX();
     if ($row['jumlah'] < 0) {
 $pdf->MultiCell(170, $height, $dataH['keterangan'], 0, 'L');
 $pdf->Cell(85, $height, $_SESSION['lang']['jatuhtempo'], 0, 0, 'L');
 $pdf->Cell(10, $height, ':', 0, 0, 'L');
 $pdf->Cell(25, $height, tanggalnormal($dataH['jatuhtempo']), 0, 1, 'L');
 $pdf->Cell(85, $height, $_SESSION['lang']['nofp'], 0, 0, 'L');
 $pdf->Cell(10, $height, ':', 0, 0, 'L');
 $pdf->Cell(25, $height, $dataH['nofp'], 0, 1, 'L');
 $pdf->Cell(85, $height, $_SESSION['lang']['nilaiinvoice'], 0, 0, 'L');
 $pdf->Cell(10, $height, ':', 0, 0, 'L');
 $pdf->Cell(25, $height, number_format($dataH['nilaiinvoice'], 2), 0, 1, 'L');
 //sisi kanan
 $pdf->SetXY(290, $startY);
 $awalx = $pdf->GetX();
 $setpanjang = 275;
 $pdf->Cell($setpanjang, $height, $_SESSION['lang']['po'], 1, 1, 'L');
 $pdf->SetX(290);
 $pdf->Cell(85, $height, $_SESSION['lang']['nopo'], 0, 0, 'L');
 $pdf->Cell(10, $height, ':', 0, 0, 'L');
 $pdf->Cell(25, $height, $dataH['nopo'], 0, 1, 'L');
 $pdf->SetX(290);
 $pdf->Cell(85, $height, $_SESSION['lang']['noinvoice'] . ' Supplier', 0, 0, 'L');
 $pdf->Cell(10, $height, ':', 0, 0, 'L');
 $pdf->Cell(25, $height, $dataH['noinvoicesupplier'], 0, 1, 'L');
 $pdf->SetX(290);
 $pdf->Cell(85, $height, $_SESSION['lang']['supplier'], 0, 0, 'L');
 $pdf->Cell(10, $height, ':', 0, 0, 'L');
 //$pdf->Cell(25,$height,$resSupp[0]['namasupplier'],0,1,'L');
 $pdf->MultiCell(190, $height, $resSupp[0]['namasupplier'], 0, 'L');
 $pdf->SetX(290);
 $pdf->Cell(85, $height, $_SESSION['lang']['matauang'], 0, 0, 'L');
 $pdf->Cell(10, $height, ':', 0, 0, 'L');