Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. <?php ob_start();
  2. error_reporting(true);
  3.  
  4. include("../config/koneksi.php");
  5. include("../config/library.php");
  6.  
  7. $id=$_POST['id_status'];
  8. if(isset($_GET['page']))
  9. {
  10. $noPage = $_GET['page'];
  11. }
  12. else $noPage = 1;
  13.  
  14. $status = mysqli_query($koneksi,"select * from tb_status where id_status='$id'");
  15. $ii = mysqli_fetch_array($status);
  16. ?>
  17.  
  18. <html>
  19.  
  20. <head>
  21.  
  22. <title>Cetak PDF</title>
  23.  
  24. <style type="text/css" style="font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;">
  25. .contoh1 {
  26. font-size: 16px;
  27. }
  28.  
  29. .contoh2 {
  30. font-size: 16px;
  31. line-height: 25px;
  32. font: Arial;
  33. }
  34.  
  35. .contoh3 {
  36. font-size: 16px;
  37. line-height: 1.5em;
  38. }
  39.  
  40. .contoh4 {
  41. font-size: 16px;
  42. line-height: 2;
  43. }
  44. </style>
  45.  
  46. </head>
  47.  
  48. <body>
  49. <div style="text-align: center">
  50. <h3><strong>laporan transaksi <?php echo"$ii[nm_status]" ?> </strong> </h3>
  51. <br> Butik Meds Banjarmasin
  52.  
  53. </div>
  54. <br>
  55. <hr>
  56. <table width="100%" border="1" cellspacing="0" class="border-style: groove;">
  57. <tr bgcolor="#FF0000">
  58. <td>NO</td>
  59. <td>Nama Lengkap</td>
  60. <td>Tgl Sewa</td>
  61. <td>Tgl Kembali</td>
  62. <td>Detail</td>
  63. <td>Total</td>
  64.  
  65. </tr>
  66.  
  67. <?php
  68. $x = mysqli_query($koneksi,"select * from tb_sewa a join tb_konsumen b on a.id_konsumen=b.id_konsumen
  69. where a.id_status='$id' order by a.id_sewa desc");
  70. $no = 1;
  71. while ($i = mysqli_fetch_array($x)){
  72. echo"
  73. <tr>
  74. <td>$no</td>
  75. <td>$i[nama_lengkap]</td>
  76. <td>".tanggal_indo($i[tgl_sewa])."</td>
  77. <td>".tanggal_indo($i[tgl_kembali])."</td>
  78. <td>
  79. ";
  80. $detail = mysqli_query($koneksi,"select * from tb_detail_sewa a join tb_baju b on a.id_baju=b.id_baju
  81. where a.id_sewa='$i[id_sewa]'");
  82.  
  83. while ($xdetail = mysqli_fetch_array($detail)){
  84. echo"$xdetail[nm_baju]<br>";
  85. }
  86. echo"</td>
  87. <td>".format_angka2($i[total])."</td>
  88. </tr>";
  89. $no++;
  90. $total_harga += $i[total];
  91. }
  92. echo"<tr>
  93. <td colspan='5'></td>
  94. <td>".format_angka2($total_harga)."</td>
  95. </tr>";
  96. ?>
  97. </table>
  98.  
  99. </body>
  100.  
  101. </html>
  102.  
  103. <?php
  104. $html = ob_get_contents();
  105. ob_end_clean();
  106. require_once('html2pdf/html2pdf.class.php');
  107.  
  108. $pdf = new HTML2PDF('P','latter','en');
  109.  
  110. $pdf->WriteHTML($html);
  111.  
  112. $pdf->Output("lap.pdf", '');
  113. $pdf->SetFooter(''.'|{PAGENO}|'.'');
  114.  
  115. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement