Advertisement
Roy_Iwan_Pasaribu

inner join

Nov 22nd, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.91 KB | None | 0 0
  1. <?php
  2.  
  3.         include ('fpdf181/fpdf.php');
  4. include ('konek.php');
  5. $nonota=$_POST["nonota"];
  6.  
  7.  
  8.                            
  9.         $pdf = new FPDF('L','cm','Legal');
  10.         $pdf->AddPage();
  11.         $pdf->SetFont('Helvetica','',14);
  12.         $pdf->SetFontSize(10);
  13.         $pdf->SetFont('Helvetica','B',12);
  14.         $pdf->cell(33.5,2, '',1,0,'C');
  15.         $pdf->Ln();
  16.        
  17.         $pdf->cell(33.5,1,  '',1,0,'C');
  18.        
  19.        
  20.         $pdf->Ln();
  21.         $nonota=$_GET['nonota'];
  22.                         $query=mysql_query("select detailpenjualan.nonota, penjualan.nama_pelanggan, penjualan.alamat, penjualan.npwp, penjualan.nonota,detailpenjualan.kode,tblbarang.nama,detailpenjualan.diskon,
  23.                                           detailpenjualan.harga,detailpenjualan.jumlah,detailpenjualan.subtotal
  24.                                           from detailpenjualan,penjualan,tblbarang
  25.                                           where penjualan.nonota=detailpenjualan.nonota and tblbarang.kode=detailpenjualan.kode
  26.                                           and detailpenjualan.nonota='$nota'");
  27.                         $nomor=mysql_fetch_array(mysql_query("select * from penjualan where nonota='$nota'"));
  28.                        
  29.                         while($data=mysql_fetch_array($query)){ $no++;
  30.                             $pdf->cell(1,1,  $no.'.',1,0,'C');
  31.                             $pdf->cell(4.5,1,  $data['nonota'],1, 'C');
  32.                             $pdf->cell(4.5,1,  $data['kode'],1, 'C');
  33.                             $pdf->cell(5,1,  $data['nama'],1, 'C');
  34.                             $pdf->cell(6,1,  $data['harga'],1, 'C');
  35.                             $pdf->cell(5,1, $data['jumlah'],1, 'C');
  36.                             $pdf->cell(6,1, $data['diskon'],1, 'C');
  37.                            
  38.                             $pdf->Ln();
  39.                         }
  40.        
  41.         $pdf->Ln();$no=0;
  42.         $pdf->Ln();
  43.         $pdf->SetFont('Helvetica','',12);
  44.         $pdf->cell(0.5,0.5, 'Pimpinan');$pdf->cell(7);
  45.         $pdf->cell(0.5,0.5, '');$pdf->cell(7);
  46.         $pdf->cell(0.5,0.5, '');$pdf->cell(4);$pdf->Ln(1.5);$pdf->Ln(1.5);
  47.         $pdf->cell(0.5,0.5, nama_pimpinan);$pdf->cell(7);
  48.         $pdf->SetFont('Helvetica','BU',12);
  49.         $pdf->Output();
  50.         exit;
  51.  
  52. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement