Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php ob_start();
- error_reporting(true);
- include("../config/koneksi.php");
- include("../config/library.php");
- $id=$_POST['id_status'];
- if(isset($_GET['page']))
- {
- $noPage = $_GET['page'];
- }
- else $noPage = 1;
- $status = mysqli_query($koneksi,"select * from tb_status where id_status='$id'");
- $ii = mysqli_fetch_array($status);
- ?>
- <html>
- <head>
- <title>Cetak PDF</title>
- <style type="text/css" style="font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;">
- .contoh1 {
- font-size: 16px;
- }
- .contoh2 {
- font-size: 16px;
- line-height: 25px;
- font: Arial;
- }
- .contoh3 {
- font-size: 16px;
- line-height: 1.5em;
- }
- .contoh4 {
- font-size: 16px;
- line-height: 2;
- }
- </style>
- </head>
- <body>
- <div style="text-align: center">
- <h3><strong>laporan transaksi <?php echo"$ii[nm_status]" ?> </strong> </h3>
- <br> Butik Meds Banjarmasin
- </div>
- <br>
- <hr>
- <table width="100%" border="1" cellspacing="0" class="border-style: groove;">
- <tr bgcolor="#FF0000">
- <td>NO</td>
- <td>Nama Lengkap</td>
- <td>Tgl Sewa</td>
- <td>Tgl Kembali</td>
- <td>Detail</td>
- <td>Total</td>
- </tr>
- <?php
- $x = mysqli_query($koneksi,"select * from tb_sewa a join tb_konsumen b on a.id_konsumen=b.id_konsumen
- where a.id_status='$id' order by a.id_sewa desc");
- $no = 1;
- while ($i = mysqli_fetch_array($x)){
- echo"
- <tr>
- <td>$no</td>
- <td>$i[nama_lengkap]</td>
- <td>".tanggal_indo($i[tgl_sewa])."</td>
- <td>".tanggal_indo($i[tgl_kembali])."</td>
- <td>
- ";
- $detail = mysqli_query($koneksi,"select * from tb_detail_sewa a join tb_baju b on a.id_baju=b.id_baju
- where a.id_sewa='$i[id_sewa]'");
- while ($xdetail = mysqli_fetch_array($detail)){
- echo"$xdetail[nm_baju]<br>";
- }
- echo"</td>
- <td>".format_angka2($i[total])."</td>
- </tr>";
- $no++;
- $total_harga += $i[total];
- }
- echo"<tr>
- <td colspan='5'></td>
- <td>".format_angka2($total_harga)."</td>
- </tr>";
- ?>
- </table>
- </body>
- </html>
- <?php
- $html = ob_get_contents();
- ob_end_clean();
- require_once('html2pdf/html2pdf.class.php');
- $pdf = new HTML2PDF('P','latter','en');
- $pdf->WriteHTML($html);
- $pdf->Output("lap.pdf", '');
- $pdf->SetFooter(''.'|{PAGENO}|'.'');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement