Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $kode_ref = $_REQUEST['kode_ref'];
- $no = 1;
- session_start();
- //include koneksi
- include "../secure/connect.php";
- //include fpdf
- include_once '../fpdf/fpdf.php';
- $pdf = new FPDF('l','mm','A4');
- $pdf->AddPage();
- $q = mysqli_query($id_mysql,"SELECT * FROM purchase_request WHERE kode_ref = '$kode_ref'");
- while ($row = mysqli_fetch_array($q)) {
- $tgl = $row['7'];
- $pdf->SetFont('Arial','B',10);
- $pdf->Image('../images/sky.jpg',25,10,-150);
- $pdf->Image('../images/skyin.png',250,5,-150);
- $pdf->SetFont('Arial','B',30);
- $pdf->Cell(273,5,'SKYLIGHT COMMUNICATION',0,1,'C');
- $pdf->SetFont('Arial','B',23);
- $pdf->Cell(273,15,'Reporting Purchase Request',0,1,'C');
- $pdf->cell(10,-5,'',0,1); //end line
- $pdf->SetFont('Arial','',12);
- $pdf->cell(270,15,'Top Center, Jl. KH. Hasyim Ashari No.13 A, Petojo Utara, Gambir, Jakarta Pusat.',0,1,'C');
- $pdf->cell(270,-5,'No. Telp: 0815-8792-015',0,1,'C');
- $pdf->cell(100,25,'',0,1);
- $pdf->SetLineWidth(0.8);
- // $pdf->PDF_setdash(5, 5); //5mm on, 5mm off
- $pdf->Line(10, 50, 285, 50);
- $pdf->SetLineWidth(0.8);
- //set line
- $pdf->SetFont('Arial','',14);
- $pdf->cell(40,7,'Ref Code',0,0);
- $pdf->cell(5,7,':',0,0);
- $pdf->cell(40,7,$row['0'],1,1); //end line
- $pdf->cell(0,3,'',0,1);
- $pdf->cell(40,7,'Supplier Code',0,0);
- $pdf->cell(5,7,':',0,0);
- $pdf->cell(90,7,$row['1'],0,0);
- $pdf->cell(40,7,'Due At',0,0);
- $pdf->cell(5,7,':',0,0);
- $pdf->cell(90,7,$row['7'],0,1); //end line
- $pdf->cell(0,2,'',0,1);
- $pdf->cell(40,7,'Deliver To',0,0);
- $pdf->cell(5,7,':',0,0);
- $pdf->cell(90,7,$row['3'],0,0);
- $pdf->cell(40,7,'Warehouse Code',0,0);
- $pdf->cell(5,7,':',0,0);
- $pdf->cell(90,7,$row['2'],0,1); //end line
- $pdf->cell(0,2,'',0,1);
- $pdf->cell(40,7,'Create',0,0);
- $pdf->cell(5,7,':',0,0);
- $pdf->cell(90,7,$row['4'],0,0);
- $pdf->cell(40,7,'Time Create',0,0);
- $pdf->cell(5,7,':',0,0);
- $pdf->cell(90,7,$row['5'],0,1); //end line
- $pdf->cell(0,2,'',0,1);
- $pdf->cell(40,7,'Note',0,0);
- $pdf->cell(5,7,':',0,0);
- $pdf->cell(260,7,$row['6'],0,1); //end line
- $pdf->cell(0,10,'',0,1);
- }
- $query = mysqli_query($id_mysql,"SELECT * FROM item_purchase_request_teguh WHERE kode_ref = '$kode_ref'");
- while ($row = mysqli_fetch_array($query)) {
- $pdf->SetFont('Arial','',10);
- // $pdf->SetDrawColor(135, 206, 235);
- $pdf->SetFillColor(210,221,242);
- $pdf->cell(10,12,'No',1,0,'C',true);
- $pdf->cell(38,12,'SKU',1,0,'C',true);
- $pdf->cell(38,12,'Product Code',1,0,'C',true);
- $pdf->cell(45,12,'Product Name',1,0,'C',true);
- $pdf->cell(27,12,'Order Qty',1,0,'C',true);
- $pdf->cell(40,12,'Price Without Tax',1,0,'C',true);
- $pdf->cell(35,12,'Tax (10%)',1,0,'C',true);
- $pdf->cell(38,12,'Price Amount',1,1,'C',true); //end line
- $pdf->SetFillColor(0, 191, 255);
- $pdf->cell(10,9,$no++,1,0,'C');
- $pdf->cell(38,9,$row['0'],1,0,'C');
- $pdf->cell(38,9,$row['1'],1,0,'C');
- // $pdf->cell(45,9,$row['11'],1,0,'C');
- // $pdf->cell(27,9,$row['13'],1,0,'C');
- // $pdf->cell(40,9,'Rp '.$row['12'],1,0,'C');
- // $pdf->cell(35,9,'Rp '.$row['27'],1,0,'C');
- // $pdf->cell(38,9,'Rp '.$row['26'],1,1,'C'); //end line
- // $pdf->cell(10,9,$no++,1,0,'C');
- // $pdf->cell(38,9,$row['14'],1,0,'C');
- // $pdf->cell(38,9,$row['15'],1,0,'C');
- // $pdf->cell(45,9,$row['16'],1,0,'C');
- // $pdf->cell(27,9,$row['18'],1,0,'C');
- // $pdf->cell(40,9,'Rp '.$row['17'],1,0,'C');
- // $pdf->cell(35,9,'Rp '.$row['29'],1,0,'C');
- // $pdf->cell(38,9,'Rp '.$row['28'],1,1,'C'); //end line
- // $pdf->cell(10,9,$no++,1,0,'C');
- // $pdf->cell(38,9,$row['19'],1,0,'C');
- // $pdf->cell(38,9,$row['20'],1,0,'C');
- // $pdf->cell(45,9,$row['21'],1,0,'C');
- // $pdf->cell(27,9,$row['23'],1,0,'C');
- // $pdf->cell(40,9,'Rp '.$row['22'],1,0,'C');
- // $pdf->cell(35,9,'Rp '.$row['31'],1,0,'C');
- // $pdf->cell(38,9,'Rp '.$row['30'],1,1,'C'); //end line
- // $pdf->cell(233,9,'SUB TOTAL',1,0,'C');
- // $pdf->cell(38,9,'Rp '.$row['32'],1,1,'C'); //end line
- }
- $pdf->Output();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment