protected function printHeader($format)
    {
        if ($format == 'pdf') {
            ob_end_clean();
            $pdf = new PDF('P', 'mm', 'A4', _CHARSET_ == 'UTF-8', _CHARSET_, false);
            $pdf->setTopMargin(20);
            $pdf->headerRight = $GLOBALS['locReportPage'];
            $pdf->printHeaderOnFirstPage = true;
            $pdf->AddPage();
            $pdf->SetAutoPageBreak(TRUE, 15);
            $pdf->setY(10);
            $pdf->SetFont('Helvetica', 'B', 12);
            $pdf->Cell(100, 5, $GLOBALS['locProductStockReport'], 0, 1, 'L');
            $pdf->SetFont('Helvetica', 'B', 8);
            $pdf->Cell(50, 10, date($GLOBALS['locDateFormat']), 0, 1, 'L');
            $pdf->Cell(15, 4, $GLOBALS['locCode'], 0, 0, 'L');
            $pdf->Cell(40, 4, $GLOBALS['locProduct'], 0, 0, 'L');
            $pdf->Cell(25, 4, $GLOBALS['locUnitPrice'], 0, 0, 'R');
            $pdf->Cell(25, 4, $GLOBALS['locPurchasePrice'], 0, 0, 'R');
            $pdf->Cell(25, 4, $GLOBALS['locStockBalance'], 0, 0, 'R');
            $pdf->Cell(25, 4, $GLOBALS['locStockValue'], 0, 1, 'R');
            $this->pdf = $pdf;
            return;
        }
        ?>
<div class="report">
	<table>
		<tr>
			<th class="label">
            <?php 
        echo $GLOBALS['locCode'];
        ?>
        </th>
			<th class="label">
            <?php 
        echo $GLOBALS['locProduct'];
        ?>
        </th>
			<th class="label" style="text-align: right">
            <?php 
        echo $GLOBALS['locUnitPrice'];
        ?>
        </th>
			<th class="label" style="text-align: right">
            <?php 
        echo $GLOBALS['locPurchasePrice'];
        ?>
        </th>
			<th class="label" style="text-align: right">
            <?php 
        echo $GLOBALS['locStockBalance'];
        ?>
        </th>
			<th class="label" style="text-align: right">
            <?php 
        echo $GLOBALS['locStockValue'];
        ?>
        </th>
		</tr>
<?php 
    }
Beispiel #2
0
    private function printHeader($format, $printFields, $startDate, $endDate)
    {
        if ($format == 'pdf' || $format == 'pdfl') {
            ob_end_clean();
            $pdf = new PDF($format == 'pdf' ? 'P' : 'L', 'mm', 'A4', _CHARSET_ == 'UTF-8', _CHARSET_, false);
            $pdf->setTopMargin(20);
            $pdf->headerRight = $GLOBALS['locReportPage'];
            $pdf->printHeaderOnFirstPage = true;
            $pdf->AddPage();
            $pdf->SetAutoPageBreak(TRUE, 15);
            $pdf->setY(10);
            $pdf->SetFont('Helvetica', 'B', 12);
            $pdf->Cell(100, 15, $GLOBALS['locInvoiceReport'], 0, 1, 'L');
            if ($startDate || $endDate) {
                $pdf->SetFont('Helvetica', '', 8);
                $pdf->Cell(25, 15, $GLOBALS['locDateInterval'], 0, 0, 'L');
                $pdf->Cell(50, 15, dateConvDBDate2Date($startDate) . ' - ' . dateConvDBDate2Date($endDate), 0, 1, 'L');
            }
            $pdf->SetFont('Helvetica', 'B', 8);
            if (in_array('invoice_no', $printFields)) {
                $pdf->Cell(18, 4, $GLOBALS['locInvoiceNumber'], 0, 0, 'L');
            }
            if (in_array('invoice_date', $printFields)) {
                $pdf->Cell(20, 4, $GLOBALS['locInvDate'], 0, 0, 'L');
            }
            if (in_array('due_date', $printFields)) {
                $pdf->Cell(20, 4, $GLOBALS['locDueDate'], 0, 0, 'L');
            }
            if (in_array('payment_date', $printFields)) {
                $pdf->Cell(20, 4, $GLOBALS['locPaymentDate'], 0, 0, 'L');
            }
            if (in_array('company_name', $printFields)) {
                $pdf->Cell(45, 4, $GLOBALS['locPayer'], 0, 0, 'L');
            }
            if (in_array('status', $printFields)) {
                $pdf->Cell(20, 4, $GLOBALS['locInvoiceState'], 0, 0, 'L');
            }
            if (in_array('ref_number', $printFields)) {
                $pdf->Cell(25, 4, $GLOBALS['locReferenceNumber'], 0, 0, 'L');
            }
            if (in_array('sums', $printFields)) {
                $pdf->Cell(25, 4, $GLOBALS['locVATLess'], 0, 0, 'R');
                $pdf->Cell(25, 4, $GLOBALS['locVATPart'], 0, 0, 'R');
                $pdf->Cell(25, 4, $GLOBALS['locWithVAT'], 0, 1, 'R');
            }
            $this->pdf = $pdf;
            return;
        }
        ?>
    <div class="report">
    <table>
    <tr>
      <?php 
        if (in_array('invoice_no', $printFields)) {
            ?>
        <th class="label">
            <?php 
            echo $GLOBALS['locInvoiceNumber'];
            ?>
        </th>
      <?php 
        }
        if (in_array('invoice_date', $printFields)) {
            ?>
        <th class="label">
            <?php 
            echo $GLOBALS['locInvDate'];
            ?>
        </th>
      <?php 
        }
        if (in_array('due_date', $printFields)) {
            ?>
        <th class="label">
            <?php 
            echo $GLOBALS['locDueDate'];
            ?>
        </th>
      <?php 
        }
        if (in_array('payment_date', $printFields)) {
            ?>
        <th class="label">
            <?php 
            echo $GLOBALS['locPaymentDate'];
            ?>
        </th>
        <?php 
        }
        if (in_array('company_name', $printFields)) {
            ?>
        <th class="label">
            <?php 
            echo $GLOBALS['locPayer'];
            ?>
        </th>
      <?php 
        }
        if (in_array('status', $printFields)) {
            ?>
        <th class="label">
            <?php 
            echo $GLOBALS['locInvoiceState'];
            ?>
        </th>
      <?php 
        }
        if (in_array('ref_number', $printFields)) {
            ?>
        <th class="label">
            <?php 
            echo $GLOBALS['locReferenceNumber'];
            ?>
        </th>
      <?php 
        }
        if (in_array('sums', $printFields)) {
            ?>
        <th class="label" style="text-align: right">
            <?php 
            echo $GLOBALS['locVATLess'];
            ?>
        </th>
        <th class="label" style="text-align: right">
            <?php 
            echo $GLOBALS['locVATPart'];
            ?>
        </th>
        <th class="label" style="text-align: right">
            <?php 
            echo $GLOBALS['locWithVAT'];
            ?>
        </th>
      <?php 
        }
        ?>
    </tr>
<?php 
    }
Beispiel #3
0
    private function printHeader($format, $startDate, $endDate)
    {
        if ($format == 'pdf') {
            ob_end_clean();
            $pdf = new PDF('P', 'mm', 'A4', _CHARSET_ == 'UTF-8', _CHARSET_, false);
            $pdf->setTopMargin(20);
            $pdf->headerRight = $GLOBALS['locReportPage'];
            $pdf->printHeaderOnFirstPage = true;
            $pdf->AddPage();
            $pdf->SetAutoPageBreak(TRUE, 15);
            $pdf->setY(10);
            $pdf->SetFont('Helvetica', 'B', 12);
            $pdf->Cell(100, 15, $GLOBALS['locProductReport'], 0, 1, 'L');
            if ($startDate || $endDate) {
                $pdf->SetFont('Helvetica', '', 8);
                $pdf->Cell(25, 15, $GLOBALS['locDateInterval'], 0, 0, 'L');
                $pdf->Cell(50, 15, dateConvDBDate2Date($startDate) . ' - ' . dateConvDBDate2Date($endDate), 0, 1, 'L');
            }
            $pdf->SetFont('Helvetica', 'B', 8);
            $pdf->Cell(15, 4, $GLOBALS['locCode'], 0, 0, 'L');
            $pdf->Cell(40, 4, $GLOBALS['locProduct'], 0, 0, 'L');
            $pdf->Cell(25, 4, $GLOBALS['locPCS'], 0, 0, 'R');
            $pdf->Cell(25, 4, $GLOBALS['locUnit'], 0, 0, 'R');
            $pdf->Cell(25, 4, $GLOBALS['locVATLess'], 0, 0, 'R');
            $pdf->Cell(15, 4, $GLOBALS['locVATPercent'], 0, 0, 'R');
            $pdf->Cell(25, 4, $GLOBALS['locVATPart'], 0, 0, 'R');
            $pdf->Cell(25, 4, $GLOBALS['locWithVAT'], 0, 1, 'R');
            $this->pdf = $pdf;
            return;
        }
        ?>
<div class="report">
	<table>
		<tr>
			<th class="label">
            <?php 
        echo $GLOBALS['locCode'];
        ?>
        </th>
			<th class="label">
            <?php 
        echo $GLOBALS['locProduct'];
        ?>
        </th>
			<th class="label" style="text-align: right">
            <?php 
        echo $GLOBALS['locPCS'];
        ?>
        </th>
			<th class="label" style="text-align: right">
            <?php 
        echo $GLOBALS['locUnit'];
        ?>
        </th>
			<th class="label" style="text-align: right">
            <?php 
        echo $GLOBALS['locVATLess'];
        ?>
        </th>
			<th class="label" style="text-align: right">
            <?php 
        echo $GLOBALS['locVATPercent'];
        ?>
        </th>
			<th class="label" style="text-align: right">
            <?php 
        echo $GLOBALS['locVATPart'];
        ?>
        </th>
			<th class="label" style="text-align: right">
            <?php 
        echo $GLOBALS['locWithVAT'];
        ?>
        </th>
		</tr>
<?php 
    }
Beispiel #4
0
 $pdf->SetFont('helvetica', 'B', 13);
 $pdf->SetY(56);
 $pdf->Cell(125, 8, $supp->getName(), 0, 0, 'L');
 $pdf->SetFont('helvetica', 'B', 14);
 $pdf->Cell(100, 8, "DC NO: {$dcno}", 0, 1, 'L');
 $pdf->SetFont('helvetica', '', 13);
 $pdf->Cell(125, 8, $supp->getAddressl1(), 0, 0, 'L');
 $pdf->Cell(100, 8, "Date: {$dcdate}", 0, 1, 'L');
 $pdf->Cell(125, 8, $supp->getAddressl2(), 0, 0, 'L');
 $pdf->Cell(100, 8, "Your Ref: {$cref}", 0, 1, 'L');
 $pdf->Cell(125, 8, "Phone No: " . $supp->getPhoneNo(), 0, 0, 'L');
 $pdf->Cell(100, 8, "Date: {$crefdate}", 0, 1, 'L');
 $pdf->ln();
 $pdf->line(0, 87, 220, 87);
 //line before mode of dispatch
 $pdf->setY(86);
 $pdf->MultiCell(125, 16, "Please receive the following materials and acknowledge the receipt", 0, 'L', 0, 0, '', '', true, 0, false, true, 16, 'M', true);
 $pdf->Cell(100, 8, "Mode Of Dispatch: {$dmode}", 0, 1, 'L');
 $pdf->Cell(125, 8, "", 0, 0, 'L');
 $pdf->Cell(100, 8, "Status: {$dctype}", 0, 1, 'L');
 $pdf->SetFont('helvetica', '', 10);
 $pdf->Cell(150, 8, '', 0, 1, 'L');
 $pdf->line(0, 101, 220, 101);
 //line after mode of dispatch
 $pdf->line(135, 55, 135, 101);
 //vertical line b/w address and dc no
 $pdf->line(135, 72, 220, 72);
 //horizontal line b/w dc no and cust ref
 $pdf->SetFont('helvetica', 'B', 11);
 $pdf->setY(100);
 $pdf->Cell(20, 8, "SL NO", 0, 0, 'L');
    if ($dias < $item[$i]['dias']) {
        $dias = $item[$i]['dias'];
    }
}
$prazo = somar_dias_uteis($pedido->data, $dias);
$financeiroDAO = new FinanceiroDAO();
$recebimentos = $financeiroDAO->listarRecebimentos($id_pedido);
$sinal = 0;
foreach ($recebimentos as $r) {
    $sinal = (double) $sinal + (double) $r->financeiro_valor;
}
$saldo = $valor - $sinal;
if ($pdf->GetY() >= 20) {
    $pdf->AddPage();
}
$pdf->setY(21);
$pdf->Cell(5, 0.7, 'Prazo de Entrega ' . invert($prazo, '/', 'PHP') . ' ', '', 0);
$pdf->setY(22);
$pdf->setX(12.65);
$pdf->Cell(5, 0.7, 'Total: R$', '', 0, 'R');
$pdf->Cell(2.5, 0.5, $valor != 0 ? number_format($valor, 2) : '', 'B', 1, 'R');
$pdf->setX(12.65);
$pdf->Cell(5, 0.7, 'Sinal: R$', '', 0, 'R');
$pdf->Cell(2.5, 0.5, $sinal != 0 ? number_format($sinal, 2) : '', 'B', 1, 'R');
$pdf->setX(12.65);
$pdf->Cell(5, 0.7, 'Saldo: R$', '', 0, 'R');
$pdf->Cell(2.5, 0.5, $saldo != 0 && $sinal != 0 ? number_format($saldo, 2) : '', 'B', 1, 'R');
$pdf->Cell(10, 0.5, 'Assinatura do cliente', 'T', 1);
$pdf->SetY(25.5);
$pdf->Cell(0, 0.5, $responsavel_empresa, 0, 1, 'C');
$pdf->Output();
Beispiel #6
0
        $pdf->Cell(15, $margin, date("d-m-Y", strtotime($outbox->tgl_masuk)), 0, 0);
        $pdf->Cell(15, $margin, date("d-m-Y", strtotime($outbox->tgl_surat)), 0, 0);
        $current_x1 = $pdf->GetX();
        $current_y1 = $pdf->GetY();
        $pdf->Cell(90);
        $current_x2 = $pdf->GetX();
        $current_y2 = $pdf->GetY();
        $pdf->Cell(50);
        $current_x3 = $pdf->GetX();
        $current_y3 = $pdf->GetY();
        $pdf->Cell(35);
        $pdf->Cell(30, $margin, $outbox->nama_jenis, 0, 0);
        $pdf->Cell(0, $margin, $outbox->first_name, 0, 0);
        $pdf->SetXY($current_x3, $current_y3);
        $pdf->MultiCell(35, $margin, $outbox->ptt, 0, 'L');
        $y3 = $pdf->getY();
        $pdf->SetXY($current_x2, $current_y2);
        $pdf->MultiCell(50, $margin, $outbox->tujuan, 0, 'L');
        $y2 = $pdf->getY();
        $pdf->SetXY($current_x1, $current_y1);
        $pdf->MultiCell(90, $margin, $outbox->perihal, 0, 'L');
        $y1 = $pdf->getY();
        $pdf->setY(max($y1, $y2, $y3));
        $pdf->CreateLine($pdf->GetY());
        if ($outbox == end($data_outbox)) {
            $pdf->CountJenis($i);
        }
    }
}
$nama_file = get_user_name() . '_' . date(now());
$pdf->Output($nama_file, 'I');
Beispiel #7
0
// CREAR PDF
$pdf = new PDF('Landscape', 'mm', 'Letter', $header);
$pdf->AliasNbPages();
$pdf->AddPage();
$fs = 8;
$lh = 8;
$pdf->SetFont('Arial', '', $fs);
$pdf->SetFillColor(255, 255, 255);
$pdf->SetDrawColor(0, 0, 0);
$pdf->Ln(2);
$y = $pdf->getY();
$x = $pdf->getX();
$pdf->Celda(256, 160, '', 1, 1, '', true);
$y2 = $pdf->getY();
$pdf->setY($y + 1);
$pdf->setX($x + 1);
$pdf->Celda(20, 5, 'Estado: ', 0, 0, '', true);
$pdf->Celda(100, 5, $pdf->capitalizar($header['estado']), 'B', 0, '', true);
$pdf->Celda(20, 5, 'Municipio: ', 0, 0, '', true);
$pdf->Celda(110, 5, $pdf->capitalizar($header['municipio']), 'B', 1, '', true);
$y = $pdf->getY();
$pdf->setY($y + 1);
$pdf->setX($x + 1);
$pdf->Celda(50, 5, 'Unidad de Trabajo o Dependencia: ', 0, 0, '', true);
$pdf->Celda(200, 5, $pdf->capitalizar($header['dependencia']), 'B', 1, '', true);
$yt = $pdf->getY();
$pdf->setX($yt + 1);
$pdf->setX($x + 1);
$lh2 = 5;
$yt = $pdf->getY();
$pdf->Cell(0, 40, '', 0, 1);
$pdf->Cell(0, 5, utf8_decode('Biothys GmbH | Gewerbestr. 6 | D-77731 Willstätt'), 0, 1, 'L', false);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(0, 5, utf8_decode($company->getName()), 0, 1, 'L', false);
$pdf->Cell(0, 5, utf8_decode($receiving_address->getLine() . ' ' . $receiving_address->getComplement()), 0, 1, 'L', false);
$pdf->Cell(0, 5, utf8_decode($receiving_address->getZip() . ' ' . $receiving_address->getCity() . ' ' . $receiving_address->getCountry()), 0, 1, 'L', false);
//Marge left
$pdf->SetFont('Arial', 'B', 20);
$pdf->Cell(180, 15, utf8_decode('Invoice for samples'), 0, 1, 'R', false);
//Marge top
$pdf->Cell(0, 10, '', 0, 1);
//CellBorder//remplacer le ust-id quand il sera setup
$pdf->SetFont('Arial', 'B', 11);
$pdf->Cell(185, 21, '', 1);
$pdf->setX($pdf->GetX() - 185);
$pdf->setY($pdf->GetY() + 2);
$pdf->FirstTable(array(array(utf8_decode('n° :'), $id_document, date('d.m.y', $order->getDate_entry())), array('UST-ID :', $company->getUst_id(), $order->getEmployee()->getSurname() . ' ' . $order->getEmployee()->getName()), array('Your ID :', $company->getId(), '1/1')));
$pdf->SetFont('Arial', '', 8);
$pdf->setY($pdf->GetY() + 2);
$pdf->MultiCell(100, 3, utf8_decode($text_intro));
$pdf->setY($pdf->GetY() + 2);
$pdf->SecondTable($order);
$pdf->setY($pdf->GetY() + 5);
$pdf->SetFont('Arial', '', 8);
$pdf->SetTextColor(0);
// Delivery Address
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(180, 6, utf8_decode('Delivery Address : '), 0, 1, 'L', false);
$pdf->SetFont('Arial', '', 8);
$delivery_address = new address($order->getId_delivery_address());
$pdf->Cell(0, 5, utf8_decode($delivery_address->getLine() . ' ' . $delivery_address->getComplement()), 0, 1, 'L', false);
     $bmilX = $pdf->GetX();
     $pdf->Cell(15, $height, $no, 1, 0, 'C');
     $pdf->Cell(125, $height, $optNmOrg[$lstKd], 1, 0, 'L');
 }
 //$yTinggi=$pdf->GetY();
 //$pdf->SetY($yTinggi);
 $pdf->setX(168);
 $b = 168;
 $dc = 22;
 // $tnggi=$yxti+10;
 for ($c = 1; $c <= $totalTipe; $c++) {
     $dc += 22;
     if ($c != $totalTipe) {
         $yxti = $yTinggi = $pdf->GetY();
         $xyti = $pdf->GetX();
         $pdf->setY($yxti);
         $pdf->setX($xyti);
         $pdf->Cell(30, $height, $dataKary[$lstKd][$dataTipeKary[$c]], 1, 0, 'R');
         $pdf->Cell(40, $height, $dataTanggugan[$lstKd][$dataTipeKary[$c]], 1, 0, 'R');
         $pdf->Cell(30, $height, $dataKaryIstri[$lstKd][$dataTipeKary[$c]], 1, 0, 'R');
     } else {
         $yxti = $yTinggi = $pdf->GetY();
         $xyti = $pdf->GetX();
         $pdf->setY($yxti);
         $pdf->setX($xyti);
         $pdf->Cell(30, $height, $dataKary[$lstKd][$dataTipeKary[$c]], 1, 0, 'R');
         $pdf->Cell(40, $height, $dataTanggugan[$lstKd][$dataTipeKary[$c]], 1, 0, 'R');
         $pdf->Cell(30, $height, $dataKaryIstri[$lstKd][$dataTipeKary[$c]], 1, 1, 'R');
     }
     $totKary[$dataTipeKary[$c]] += $dataKary[$lstKd][$dataTipeKary[$c]];
     $totAnak[$dataTipeKary[$c]] += $dataTanggugan[$lstKd][$dataTipeKary[$c]];
Beispiel #10
0
     {
         $this->SetY(-15);
         $this->SetFont('Arial', 'B', 8);
         $this->Cell(100, 10, 'Angytours Reporte de Ventas ', 0, 0, 'L');
     }
 }
 // $paciente= $_GET['id'];
 // $con = new DB;
 // $pacientes = $con->conectar();
 // $strConsulta = "SELECT * from Cliente ";
 // $pacientes = mysql_query($conexion,$strConsulta);
 // $fila = mysql_fetch_array($pacientes);
 $pdf = new PDF('L', 'mm', 'Letter');
 $pdf->Open();
 $pdf->AddPage();
 $pdf->setY(10);
 $pdf->setX(100);
 $pdf->Cell(60, 8, "Este reporte de ventas corresponde a las siguentes fechas: ", 0, 1);
 $pdf->setX(120);
 $pdf->Cell(60, 8, "del " . $fecha . "al " . $fechaFinal, 0, 0);
 $pdf->SetMargins(20, 20, 20);
 $pdf->Ln(10);
 //    $pdf->SetFont('Arial','',12);
 //    $pdf->Cell(0,6,'Clave: '.$fila['idViajero'],0,1);
 // $pdf->Cell(0,6,'Nombre: '.$fila['Nombre'].' '.$fila['Direccion'].' '.$fila['Telefono'],0,1);
 // $pdf->Cell(0,6,'Sexo: '.$fila['Correo'],0,1);
 // $pdf->Cell(0,6,'Domicilio: '.$fila['Correo'],0,1);
 // $pdf->Ln(10);
 $pdf->SetWidths(array(15, 55, 60, 40, 35, 35, 18));
 $pdf->SetFont('Arial', 'B', 10);
 $pdf->SetFillColor(85, 107, 47);
     } else {
         $txtAkad = 'non-akad';
     }
 }
 $date1 = $bar->tanggalmasuk;
 $date2 = date('Y-m-d');
 $diff = abs(strtotime($date2) - strtotime($date1));
 $years = floor($diff / (365 * 60 * 60 * 24));
 $months = floor(($diff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24));
 $days = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24));
 $lamaKerja = " " . $years . " Tahun " . $months . " Bulan " . $days . " Hari ";
 //=============pdf
 $pdf = new PDF('P', 'mm', 'A4');
 $pdf->AddPage();
 $pdf->SetFont('Arial', 'B', 10);
 $pdf->setY(32);
 $pdf->Cell(25, 5, '1. ' . strtoupper($_SESSION['lang']['datapribadi']), 0, 1, 'L');
 $pdf->SetFont('Arial', '', 8);
 $pdf->setY(40);
 $pdf->SetX(20);
 $pdf->Image($photo, 15, 40, 35);
 $pdf->SetX(60);
 $pdf->Cell(25, 5, $_SESSION['lang']['datapribadi'], 0, 0, 'L');
 $pdf->Cell(40, 5, ': ' . $karyawanid, 0, 0, 'L');
 $pdf->Cell(25, 5, $_SESSION['lang']['nik'], 0, 0, 'L');
 $pdf->Cell(40, 5, ': ' . $nik, 0, 1, 'L');
 $pdf->SetX(60);
 $pdf->Cell(25, 5, $_SESSION['lang']['nama'], 0, 0, 'L');
 $pdf->Cell(40, 5, ': ' . $nama, 0, 0, 'L');
 $pdf->Cell(25, 5, $_SESSION['lang']['tempatlahir'], 0, 0, 'L');
 $pdf->Cell(40, 5, ': ' . $ttlahir, 0, 1, 'L');
                    $pdf->Cell(17, 5, '', 1, 0, 'C', 1);
                    $pdf->Cell(17, 5, '', 1, 0, 'C', 1);
                }
            }
        }
        $pdf->Cell(59, 5, '', 1, 0, 'L', 1);
        $pdf->Cell(16, 5, '', 1, 1, 'C', 1);
    }
}
$akhirBarang = $pdf->GetY();
if ($akhirYJob > $akhirBarang) {
    $akhirDipakai = $akhirYJob;
} else {
    $akhirDipakai = $akhirBarang;
}
$pdf->setY($akhirDipakai);
$pdf->SetFont('Arial', 'BU', 9);
$pdf->Cell(120, 5, 'Hasil  Pekerjaan  :', 'TRL', 0, 'L', 1);
$pdf->Cell(75, 5, 'Komentar / Saran  -  Mill Head Maintenance', 'TRL', 1, 'L', 1);
$awalYx = $pdf->GetY();
$height = 5;
$pdf->SetY($awalYx);
$pdf->SetX(1000);
$pdf->MultiCell(120, $height, $dHt['hasilkerja'], 0, 'J');
$akhirYHK = $pdf->GetY();
$pdf->SetY($awalYx);
$pdf->SetX(1000);
$pdf->MultiCell(75, $height, $dHt['komentarmainten'], 0, 'J');
$akhirYComment = $pdf->GetY();
$akhirYx = max($akhirYHK, $akhirYComment);
$height2 = $akhirYx - $awalYx;
$filter = whereMaker($filter, 'secretary', $secretary_id);
$SELECT_po = "select * from po_file" . $filter;
$head = array("Date", "Letter", "Mode of Payment", "Company Name", "Engineer", "Secretary", "PO#", "JO#", "Item Description", "Page#", "Pay to", "Total amount", "Particulars");
//,"RM /ANY Time of Text",
// "Time Replied to RM / ANY","Time CR text","Time Reply to CR",
//"Time forward to Boss","Time Approved by Boss"
$result = $conn->query($SELECT_po);
$width = array(32, 14, 30, 30, 25, 25, 14, 14, 40, 15, 25, 23, 45, 45);
$pdf->AddPage();
$y = $pdf->getY();
//echo "<br>".$pdf->getY();
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->setY($y + 22);
//	echo "<br>2".$pdf->getY();
$data2 = array();
$pdf->row($width, $head, 1, $data2, $data2);
while ($row = $result->fetch_assoc()) {
    if (empty($engineer[$row['engineer']])) {
        $engineer[$row['engineer']] = "";
    }
    if (empty($secretary[$row['secretary']])) {
        $secretary[$row['secretary']] = "";
    }
    $data = array(date("F j, Y", strtotime($row['date_created'])), $row['letter_code'], $row['payment_type'], $row['company_name'], $engineer[$row['engineer']], $secretary[$row['secretary']], $row['po'], $row['jo'], $row['item_description'], $row['page'], $row['supplier'], $row['total_amount']);
    $SELECT = "select * from po_item_file where trans_no='" . $row['trans_no'] . "' and item!=''";
    $result1 = $conn->query($SELECT);
    $rows = 1;
    //	echo "<br>Rows".$rows;