Example #1
0
 $pdf->Cell($length[0] / 100 * $width, $height, '', 'TLR', 0, 'C', 1);
 $pdf->Cell($length[1] / 100 * $width, $height, '', 'TLR', 0, 'C', 1);
 $pdf->Cell($length[2] / 100 * $width, $height, 'Saldo Awal ' . $periode1, 'TLR', 0, 'C', 1);
 $pdf->Cell($length[3] / 100 * $width, $height, '', 'TLR', 0, 'R', 1);
 $pdf->Cell($length[4] / 100 * $width, $height, $saldoAwal, 'TLR', 0, 'R', 1);
 $pdf->Cell($length[5] / 100 * $width, $height, '', 'TLR', 0, 'R', 1);
 $pdf->Cell($length[6] / 100 * $width, $height, '', 'TLR', 0, 'R', 1);
 $pdf->Ln();
 # Content
 $pdf->SetFont('Arial', '', 9);
 // foreach($dataShow as $key=>$row) {
 // $i=0;
 foreach ($dataShow as $head => $cont) {
     $nourut += 1;
     $height = 12;
     $awalY = $pdf->GetY();
     $pdf->SetY($awalY);
     $pdf->SetX(1000);
     $pdf->MultiCell($length[2] / 100 * $width, $height, $cont['keterangan'], 0, 'L');
     $akhirYKeterangan = $pdf->GetY();
     $pdf->SetY($awalY);
     $pdf->SetX(1000);
     $pdf->MultiCell($length[3] / 100 * $width, $height, $cont['km'], 0, 'C');
     $akhirYKm = $pdf->GetY();
     $pdf->SetY($awalY);
     $pdf->SetX(1000);
     $pdf->MultiCell($length[5] / 100 * $width, $height, $cont['kk'], 0, 'C');
     $akhirYKk = $pdf->GetY();
     $akhirY = max($akhirYKeterangan, $akhirYKm, $akhirYKk);
     $height2 = $akhirY - $awalY;
     $pdf->SetY($awalY);
 $colsNew = 'noakun,namaakun,keterangan,debet,kredit,nodok';
 $colPdf = explode(',', $colsNew);
 $title = $_SESSION['lang']['nojurnal'] . ": " . $nojurnal;
 $title .= " " . $_SESSION['lang']['noreferensi'] . ": " . $noref;
 $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();
 $width = $pdf->w - $pdf->lMargin - $pdf->rMargin;
 $height = 12;
 $pdf->AddPage();
 $pdf->SetFillColor(255, 255, 255);
 $pdf->SetFont('Arial', '', 9);
 switch ($dataH['tipeinvoice']) {
     case 'p':
         $tipe = 'PO';
         break;
     case 'k':
         $tipe = 'SPK';
         break;
 }
 $pdf->Ln();
 // Header
 $startY = $pdf->GetY();
 $pdf->Cell(85, $height, $_SESSION['lang']['noinvoice'], 0, 0, 'L');
 $pdf->Cell(10, $height, ':', 0, 0, 'L');
 $pdf->Cell(25, $height, $dataH['noinvoice'], 0, 1, 'L');
 $pdf->Cell(85, $height, $_SESSION['lang']['pt'], 0, 0, 'L');
 $pdf->Cell(10, $height, ':', 0, 0, 'L');
 $pdf->Cell(25, $height, $optPt[$dataH['kodeorg']], 0, 1, 'L');
 $pdf->Cell(85, $height, $_SESSION['lang']['tanggal'], 0, 0, 'L');
 $pdf->Cell(10, $height, ':', 0, 0, 'L');
 $pdf->Cell(25, $height, tanggalnormal($dataH['tanggal']), 0, 1, 'L');
 $pdf->Cell(85, $height, $_SESSION['lang']['keterangan'], 0, 0, 'L');
 $pdf->Cell(10, $height, ':', 0, 0, 'L');
 $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');