faizadie

cetak_purchase_request.php

Jan 31st, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.17 KB | None | 0 0
  1. <?php
  2. $kode_ref = $_REQUEST['kode_ref'];
  3. $no = 1;
  4. session_start();
  5. //include koneksi
  6. include "../secure/connect.php";
  7. //include fpdf
  8. include_once '../fpdf/fpdf.php';
  9.  
  10. $pdf = new FPDF('l','mm','A4');
  11.  
  12. $pdf->AddPage();
  13.  
  14. $q = mysqli_query($id_mysql,"SELECT * FROM purchase_request WHERE kode_ref = '$kode_ref'");
  15. while ($row = mysqli_fetch_array($q)) {
  16.     $tgl = $row['7'];
  17.  
  18.     $pdf->SetFont('Arial','B',10);
  19.     $pdf->Image('../images/sky.jpg',25,10,-150);
  20.     $pdf->Image('../images/skyin.png',250,5,-150);
  21.  
  22.     $pdf->SetFont('Arial','B',30);
  23.     $pdf->Cell(273,5,'SKYLIGHT COMMUNICATION',0,1,'C');
  24.     $pdf->SetFont('Arial','B',23);
  25.     $pdf->Cell(273,15,'Reporting Purchase Request',0,1,'C');
  26.     $pdf->cell(10,-5,'',0,1); //end line
  27.  
  28.     $pdf->SetFont('Arial','',12);
  29.     $pdf->cell(270,15,'Top Center, Jl. KH. Hasyim Ashari No.13 A, Petojo Utara, Gambir, Jakarta Pusat.',0,1,'C');
  30.     $pdf->cell(270,-5,'No. Telp: 0815-8792-015',0,1,'C');
  31.     $pdf->cell(100,25,'',0,1);
  32.  
  33.     $pdf->SetLineWidth(0.8);
  34.  
  35.     // $pdf->PDF_setdash(5, 5); //5mm on, 5mm off
  36.     $pdf->Line(10, 50, 285, 50);
  37.     $pdf->SetLineWidth(0.8);
  38.  
  39.     //set line
  40.     $pdf->SetFont('Arial','',14);
  41.     $pdf->cell(40,7,'Ref Code',0,0);
  42.     $pdf->cell(5,7,':',0,0);
  43.     $pdf->cell(40,7,$row['0'],1,1); //end line
  44.     $pdf->cell(0,3,'',0,1);
  45.  
  46.     $pdf->cell(40,7,'Supplier Code',0,0);
  47.     $pdf->cell(5,7,':',0,0);
  48.     $pdf->cell(90,7,$row['1'],0,0);
  49.     $pdf->cell(40,7,'Due At',0,0);
  50.     $pdf->cell(5,7,':',0,0);
  51.     $pdf->cell(90,7,$row['7'],0,1); //end line
  52.     $pdf->cell(0,2,'',0,1);
  53.  
  54.     $pdf->cell(40,7,'Deliver To',0,0);
  55.     $pdf->cell(5,7,':',0,0);
  56.     $pdf->cell(90,7,$row['3'],0,0);
  57.     $pdf->cell(40,7,'Warehouse Code',0,0);
  58.     $pdf->cell(5,7,':',0,0);
  59.     $pdf->cell(90,7,$row['2'],0,1); //end line
  60.     $pdf->cell(0,2,'',0,1);
  61.  
  62.     $pdf->cell(40,7,'Create',0,0);
  63.     $pdf->cell(5,7,':',0,0);
  64.     $pdf->cell(90,7,$row['4'],0,0);
  65.     $pdf->cell(40,7,'Time Create',0,0);
  66.     $pdf->cell(5,7,':',0,0);
  67.     $pdf->cell(90,7,$row['5'],0,1); //end line
  68.     $pdf->cell(0,2,'',0,1);
  69.  
  70.     $pdf->cell(40,7,'Note',0,0);
  71.     $pdf->cell(5,7,':',0,0);
  72.     $pdf->cell(260,7,$row['6'],0,1); //end line
  73.     $pdf->cell(0,10,'',0,1);
  74. }
  75. $query = mysqli_query($id_mysql,"SELECT * FROM item_purchase_request_teguh WHERE kode_ref = '$kode_ref'");
  76. while ($row = mysqli_fetch_array($query)) {
  77.  
  78.     $pdf->SetFont('Arial','',10);
  79.     // $pdf->SetDrawColor(135, 206, 235);
  80.     $pdf->SetFillColor(210,221,242);
  81.     $pdf->cell(10,12,'No',1,0,'C',true);
  82.     $pdf->cell(38,12,'SKU',1,0,'C',true);
  83.     $pdf->cell(38,12,'Product Code',1,0,'C',true);
  84.     $pdf->cell(45,12,'Product Name',1,0,'C',true);
  85.     $pdf->cell(27,12,'Order Qty',1,0,'C',true);
  86.     $pdf->cell(40,12,'Price Without Tax',1,0,'C',true);
  87.     $pdf->cell(35,12,'Tax (10%)',1,0,'C',true);
  88.     $pdf->cell(38,12,'Price Amount',1,1,'C',true); //end line
  89.     $pdf->SetFillColor(0, 191, 255);
  90.     $pdf->cell(10,9,$no++,1,0,'C');
  91.     $pdf->cell(38,9,$row['0'],1,0,'C');
  92.     $pdf->cell(38,9,$row['1'],1,0,'C');
  93.     // $pdf->cell(45,9,$row['11'],1,0,'C');
  94.     // $pdf->cell(27,9,$row['13'],1,0,'C');
  95.     // $pdf->cell(40,9,'Rp '.$row['12'],1,0,'C');
  96.     // $pdf->cell(35,9,'Rp '.$row['27'],1,0,'C');
  97.     // $pdf->cell(38,9,'Rp '.$row['26'],1,1,'C'); //end line
  98.     // $pdf->cell(10,9,$no++,1,0,'C');
  99.     // $pdf->cell(38,9,$row['14'],1,0,'C');
  100.     // $pdf->cell(38,9,$row['15'],1,0,'C');
  101.     // $pdf->cell(45,9,$row['16'],1,0,'C');
  102.     // $pdf->cell(27,9,$row['18'],1,0,'C');
  103.     // $pdf->cell(40,9,'Rp '.$row['17'],1,0,'C');
  104.     // $pdf->cell(35,9,'Rp '.$row['29'],1,0,'C');
  105.     // $pdf->cell(38,9,'Rp '.$row['28'],1,1,'C'); //end line
  106.     // $pdf->cell(10,9,$no++,1,0,'C');
  107.     // $pdf->cell(38,9,$row['19'],1,0,'C');
  108.     // $pdf->cell(38,9,$row['20'],1,0,'C');
  109.     // $pdf->cell(45,9,$row['21'],1,0,'C');
  110.     // $pdf->cell(27,9,$row['23'],1,0,'C');
  111.     // $pdf->cell(40,9,'Rp '.$row['22'],1,0,'C');
  112.     // $pdf->cell(35,9,'Rp '.$row['31'],1,0,'C');
  113.     // $pdf->cell(38,9,'Rp '.$row['30'],1,1,'C'); //end line
  114.     // $pdf->cell(233,9,'SUB TOTAL',1,0,'C');
  115.     // $pdf->cell(38,9,'Rp '.$row['32'],1,1,'C'); //end line
  116. }
  117.  
  118.  
  119. $pdf->Output();
  120.  
  121.  
  122. ?>
Advertisement
Add Comment
Please, Sign In to add comment