예제 #1
0
 $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') {
                 $pdf->SetFillColor(255, 192, 192);
             }
             $pdf->Cell($length[$i] / 100 * $width, $height, $cont, 1, 0, $align[$i], 1);
         } else {
             if ($i == 1) {
                 // jam stagnasi
                 $pdf->SetFillColor(255, 255, 255);
                 $jamstag = fixHours($cont);
                 if ($jamstag == "0:00") {
    $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();
        # Content
        $pdf->SetFillColor(255, 255, 255);
$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;
}
        $nop_ = "Summary_JMemorial " . $unit . " " . $tahun . "-" . $bulan;
        $gztralala = gzopen("tempExcel/" . $nop_ . ".xls.gz", "w9");
        gzwrite($gztralala, $table);
        gzclose($gztralala);
        echo "<script language=javascript1.2>\r\n                                     window.location='tempExcel/" . $nop_ . ".xls.gz';\r\n                                     </script>";
        break;
    case 'pdf':
        $pdf = new zPdfMaster('L', 'pt', 'A4');
        $pdf->setAttr1($title, $align, $length, $colArr);
        $pdf->_finReport = true;
        $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->Cell(77 / 100 * $width, $height, 'TOTAL', 1, 0, 'C', 1);
        $pdf->Cell(10 / 100 * $width, $height, number_format($totalDebet, 0), 1, 0, 'R', 1);
        $pdf->Cell(10 / 100 * $width, $height, number_format($totalKredit, 0), 1, 0, 'R', 1);
        $pdf->Output();
        break;
    default:
        break;
}
예제 #5
0
     $pdf->MultiCell($length[3] / 100 * $width, $height, number_format($row['jumlah']), '0', $align[3]);
     $pdf->SetY($awalY);
     $pdf->SetX($currentX + $length[3] / 100 * $width);
     $currentX = $pdf->GetX();
     $pdf->MultiCell($length[4] / 100 * $width, $height, 0, '0', $align[4]);
     $pdf->SetY($awalY);
     $pdf->SetX($currentX + $length[4] / 100 * $width);
     $currentX = $pdf->GetX();
 }
 $pdf->MultiCell($length[3] / 100 * $width, $height, substr($row['nodok'], 0, 32), '0', $align[5]);
 $akhirYNoDokumen = $pdf->GetY();
 $akhirY = max($akhirYNoAkun, $akhirYKeterangan, $akhirYNoDokumen);
 $height2 = $akhirY - $awalY;
 // $pdf->SetY($awalY);
 $pdf->SetY($awalY);
 $pdf->Cell($length[0] / 100 * $width, $height2, "", 1, 0, $align[0]);
 $pdf->Cell($length[1] / 100 * $width, $height2, "", 1, 0, $align[1]);
 $pdf->Cell($length[2] / 100 * $width, $height2, "", 1, 0, $align[2]);
 if ($row['jumlah'] < 0) {
     $pdf->Cell($length[3] / 100 * $width, $height2, "", 1, 0, $align[3]);
     $pdf->Cell($length[4] / 100 * $width, $height2, "", 1, 0, $align[4]);
 } else {
     $pdf->Cell($length[3] / 100 * $width, $height2, "", 1, 0, $align[3]);
     $pdf->Cell($length[4] / 100 * $width, $height2, "", 1, 0, $align[4]);
 }
 $pdf->Cell($length[5] / 100 * $width, $height2, "", 1, 0, $align[5]);
 //	    foreach($row as $head=>$cont) {
 //		if($head=='jumlah') {
 //		    if($cont<0) {
 //			$pdf->Cell($length[$i]/100*$width,$height,0,1,0,$align[$i]);
 //			$i++;
    }
}
$title = $_SESSION['lang']['operasipabrik'];
$titleDetail = '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']['nopengolahan'] . " : " . $param['nopengolahan'], 0, 1, 'L', 1);
        $iData = "select * from " . $dbname . ".pabrik_pengolahan where nopengolahan='" . $param['nopengolahan'] . "' ";
        $nData = mysql_query($iData) or die(mysql_error($conn));
        $dData = mysql_fetch_assoc($nData);
        $pdf->Cell($width, $height, $_SESSION['lang']['jammulai'] . " : " . $dData['jammulai'], 0, 1, 'L', 1);
        $pdf->Cell($width, $height, $_SESSION['lang']['jamselesai'] . " : " . $dData['jamselesai'], 0, 1, 'L', 1);
        $pdf->Ln();
        # Header
        $pdf->SetFont('Arial', 'B', 9);
        $pdf->Cell($width, $height, $titleDetail, 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++;
        }
        break;
}
$titleDetail = array($_SESSION['lang']['prestasi'], $_SESSION['lang']['absensi'], $_SESSION['lang']['material']);
/** Output Format **/
switch ($proses) {
    case 'pdf':
        $pdf = new zPdfMaster('P', '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->Ln();
        $pdf->Cell($width, $height, $_SESSION['lang']['notransaksi'] . " : " . $param['notransaksi'], 0, 1, 'L', 1);
        //'tanggal,kodekegiatan,a.kodeorg,hasilkerja,jumlahhk,upahkerja,upahpremi,umr';
        $sPres = "select distinct sum(a.insentif) as upahpremi, sum(a.umr) as umr,sum(a.jhk) as jumlahhk,kodekegiatan,\r\n                tanggal,b.kodeorg,b.hasilkerja from " . $dbname . ".kebun_kehadiran a left join " . $dbname . ".kebun_prestasi b on a.notransaksi=b.notransaksi\r\n                left join " . $dbname . ".kebun_aktifitas c on a.notransaksi=c.notransaksi where a.notransaksi='" . $param['notransaksi'] . "' group by a.notransaksi";
        $pdf->Ln();
        $pdf->SetFont('Arial', 'B', 8);
        $pdf->Cell($width, $height, $titleDetail[0], 0, 1, 'L', 1);
        $pdf->SetFillColor(220, 220, 220);
        $pdf->SetFont('Arial', 'B', 8);
        $pdf->Cell(10 / 100 * $width, $height, $_SESSION['lang']['tanggal'], 1, 0, 'C', 1);
        $pdf->Cell(25 / 100 * $width, $height, $_SESSION['lang']['kodekegiatan'], 1, 0, 'C', 1);
        $pdf->Cell(13 / 100 * $width, $height, $_SESSION['lang']['kodeorg'], 1, 0, 'C', 1);
        $pdf->Cell(10 / 100 * $width, $height, $_SESSION['lang']['hasilkerjad'], 1, 0, 'C', 1);
        $pdf->Cell(6 / 100 * $width, $height, $_SESSION['lang']['satuan'], 1, 0, 'C', 1);
        $pdf->Cell(15 / 100 * $width, $height, $_SESSION['lang']['upahpremi'], 1, 0, 'C', 1);
        $pdf->Cell(15 / 100 * $width, $height, $_SESSION['lang']['umr'], 1, 1, 'C', 1);
        $qPres = mysql_query($sPres) or die(mysql_error($conn));
예제 #8
0
# Print
$pdf = new zPdfMaster('P', '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->Ln();
$pdf->SetFont('Arial', 'B', 9);
#$pdf->Cell($width,$height,$titleDetail[0],0,1,'L',1);
$pdf->SetFillColor(220, 220, 220);
$i = 0;
foreach ($colArr as $column) {
    $pdf->Cell($length[$i] / 100 * $width, $height, $_SESSION['lang'][$column], 1, 0, 'C', 1);
    $i++;
}
$pdf->Ln();
# Content
$pdf->SetFillColor(255, 255, 255);
$pdf->SetFont('Arial', '', 9);
foreach ($dataShow 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->Ln();
예제 #9
0
 /** Report Prep **/
 # Options
 $optJab = makeOption($dbname, 'sdm_5jabatan', 'kodejabatan,namajabatan', "kodejabatan='" . $_SESSION['empl']['kodejabatan'] . "'");
 $colPdf = array('nourut', 'tanggal', 'keterangan', 'kasmasuk', 'penerimaan', 'kaskeluar', 'pengeluaran');
 $title = $_SESSION['lang']['kasharian'];
 $length = explode(",", "5,12,35,10,14,10,14");
 $pdf = new zPdfMaster('P', 'pt', 'A4');
 $pdf->setAttr1($title, $align, $length, $colPdf);
 $pdf->_finReport = true;
 $width = $pdf->w - $pdf->lMargin - $pdf->rMargin;
 $height = 12;
 $pdf->AddPage();
 $pdf->SetFillColor(255, 255, 255);
 # Saldo Awal
 $pdf->SetFont('Arial', 'B', 9);
 $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();
예제 #10
0
     $title = $_SESSION['lang']['histkaryawan'];
     $length = explode(",", "20,20,20,40");
     $pdf = new zPdfMaster('P', 'pt', 'A4');
     $pdf->setAttr1($title, $align, $length, $theCols);
     $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:
 $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');
 $pdf->Cell(85, $height, $_SESSION['lang']['nofp'], 0, 0, 'L');
// Init Total
$totJanjang = $totUpahKerja = $totUpahKerjapenalty = $totUpahPremi = 0;
$totUpahPremibasis = $totUpahDenda = $totLuas = $totSisa = 0;
/** Output Format **/
switch ($proses) {
    case 'pdf':
        $pdf = new zPdfMaster('P', 'pt', 'A4');
        $pdf->_noThead = true;
        $pdf->setAttr1($title, $align, $length, array());
        $width = $pdf->w - $pdf->lMargin - $pdf->rMargin;
        $height = 12;
        $pdf->AddPage();
        $pdf->Ln();
        $pdf->SetFillColor(255, 255, 255);
        $pdf->SetFont('Arial', 'B', 9);
        $pdf->Cell($width, $height, $_SESSION['lang']['notransaksi'] . " : " . $param['notransaksi'], 0, 1, 'L', 1);
        $pdf->SetFillColor(220, 220, 220);
        $pdf->SetFont('Arial', 'B', 8);
        $pdf->Cell(10 / 100 * $width, $height, $_SESSION['lang']['tanggal'], 1, 0, 'C', 1);
        $pdf->Cell(15 / 100 * $width, $height, $_SESSION['lang']['nik'], 1, 0, 'C', 1);
        $pdf->Cell(13 / 100 * $width, $height, $_SESSION['lang']['kodeorg'], 1, 0, 'C', 1);
        $pdf->Cell(5 / 100 * $width, $height, $_SESSION['lang']['jjg'], 1, 0, 'C', 1);
        $pdf->Cell(6 / 100 * $width, $height, $_SESSION['lang']['luas'], 1, 0, 'C', 1);
        $pdf->Cell(8 / 100 * $width, $height, $_SESSION['lang']['upahkerja'], 1, 0, 'C', 1);
        $pdf->Cell(8 / 100 * $width, $height, $_SESSION['lang']['upahpenalty'], 1, 0, 'C', 1);
        $pdf->Cell(8 / 100 * $width, $height, $_SESSION['lang']['premibasis'], 1, 0, 'C', 1);
        $pdf->Cell(8 / 100 * $width, $height, $_SESSION['lang']['upahpremi'], 1, 0, 'C', 1);
        $pdf->Cell(8 / 100 * $width, $height, $_SESSION['lang']['rupiahpenalty'], 1, 0, 'C', 1);
        $pdf->Cell(8 / 100 * $width, $height, $_SESSION['lang']['total'], 1, 1, 'C', 1);
        $pdf->SetFillColor(255, 255, 255);
        $pdf->SetFont('Arial', '', 8);