$cols = 'nosj,kodept,tanggal,tanggalkirim,tanggaltiba';
$colArr = explode(',', $cols);
$query = selectQuery($dbname, 'log_suratjalanht', $cols, $where, 'nosj desc');
$data = fetchData($query);
$title = "Delivery Order";
$align = explode(",", "L,L,L,L,L");
$length = explode(",", "20,20,20,20,20");
/** Output Format **/
switch ($proses) {
    case 'pdf':
        $pdf = new zPdfMaster('P', 'pt', 'A4');
        $pdf->setAttr1($title, $align, $length, $colArr);
        $width = $pdf->w - $pdf->lMargin - $pdf->rMargin;
        $height = 12;
        $pdf->AddPage();
        $pdf->SetFillColor(255, 255, 255);
        $pdf->SetFont('Arial', '', 9);
        foreach ($data as $key => $row) {
            $i = 0;
            foreach ($row as $cont) {
                $pdf->Cell($length[$i] / 100 * $width, $height, $cont, 1, 0, $align[$i], 1);
                $i++;
            }
            $pdf->Ln();
        }
        $pdf->Output();
        break;
    case 'excel':
        break;
    default:
        break;
예제 #2
0
    return sprintf("%d:%02.0f", $hours, $minutes);
}
switch ($mode) {
    case 'pdf':
        /** Report Prep **/
        $colPdf = explode(',', $cols2e);
        $title = $_SESSION['lang']['pabrik'] . " " . $kodeorg;
        $length = explode(",", "10,10,10,10,10,10,10,10");
        $colPdf[6] = "CPO (Kg)";
        $colPdf[7] = "Kernel (Kg)";
        $pdf = new zPdfMaster('L', 'pt', 'A4');
        $pdf->setAttr1($title, $align, $length, $colPdf);
        $width = $pdf->w - $pdf->lMargin - $pdf->rMargin;
        $height = 12;
        $pdf->AddPage();
        $pdf->SetFillColor(255, 255, 255);
        $pdf->SetFont('Arial', '', 9);
        # Content
        $pdf->SetFont('Arial', '', 9);
        $j = 0;
        foreach ($data as $key => $row) {
            $i = 0;
            $j += 1;
            // nomor baris
            $pdf->Cell($length[$i] / 100 * $width, $height, $j, 1, 0, $align[$i], 1);
            foreach ($row as $head => $cont) {
                if ($i == 0) {
                    // tanggal
                    $tanggal = $cont;
                    $qwe = date('D', strtotime($tanggal));
                    if ($qwe == 'Sun') {
foreach ($dataShow as $key => $row) {
    $dataShow[$key]['kodeblok'] = isset($optOrg[$row['kodeblok']]) ? $optOrg[$row['kodeblok']] : $optProject[$row['kodeblok']];
    $dataShow[$key]['kodekegiatan'] = isset($optKeg[$row['kodekegiatan']]) ? $optKeg[$row['kodekegiatan']] : $optProjectDt[$row['kodekegiatan']];
}
$title = $_SESSION['lang']['spk'];
$titleDetail = array('Detail');
/** Output Format **/
switch ($proses) {
    case 'pdf':
        $pdf = new zPdfMaster('L', 'pt', 'A4');
        $pdf->_noThead = true;
        $pdf->setAttr1($title, $align, $length, array());
        $width = $pdf->w - $pdf->lMargin - $pdf->rMargin;
        $height = 12;
        $pdf->AddPage();
        $pdf->SetFillColor(255, 255, 255);
        $pdf->SetFont('Arial', 'B', 9);
        $pdf->Cell($width, $height, $_SESSION['lang']['notransaksi'] . " : " . $param['notransaksi'], 0, 1, 'L', 1);
        $pdf->Cell($width, $height, $_SESSION['lang']['kodeorg'] . " : " . $optOrg[$param['kodeorg']], 0, 1, 'L', 1);
        $pdf->Cell($width, $height, $_SESSION['lang']['koderekanan'] . " : " . $optSupp[$param['koderekanan']], 0, 1, 'L', 1);
        $pdf->Ln();
        # Header
        $pdf->SetFont('Arial', 'B', 9);
        $pdf->Cell($width, $height, $titleDetail[0], 0, 1, 'L', 1);
        $pdf->SetFillColor(220, 220, 220);
        $i = 0;
        foreach ($cols as $column) {
            $pdf->Cell($length[$i] / 100 * $width, $height, $_SESSION['lang'][$column], 1, 0, 'C', 1);
            $i++;
        }
        $pdf->Ln();