DOMPDF ketika di Download tidak tampil data nya

selamat siang suhu mohon bantuan nya ini kenapa ya ketika saya download file nya kok gk tampil data nya padahal sudah saya load untuk view nya

 public function pdf($id)
    {
        $this->load->library('dompdf_gen');
        $data['transaksi'] = $this->db->query("SELECT * FROM transaksi tr, mobil mb, customer cs WHERE tr.id_mobil=mb.id_mobil AND tr.id_customer=cs.id_customer AND tr.id_rental='$id' ORDER BY id_rental DESC")->result();

        $this->load->view('customer/laporan_pdf',$data, true);

        $paper_size = 'A5';
        $orientation = 'potrait';
        $html = $this->output->get_output();
        $this->dompdf->set_paper($paper_size, $orientation);

        $this->dompdf->load_html('<?xml encoding="UTF-8">' . $html);
        $this->dompdf->render();
        $this->dompdf->stream("Invoice_Pembayaran.pdf", array('Attachment' =>0));
    }

Controller Function PDF

<html><head>
    <title></title>
    </head><body>
<table class="table table-bordered table-stripped" style="width: 60%">
    <h3 style="text-align: center">INVOICE PEMBAYARAN RENTAL MOBIL KELOMPOK 2</h3>

        <?php foreach($transaksi as $tr): ?>
            <tr style="font-weight: bold; color:green;">
                <td>ID Customer</td>
                <td>:</td>
                <td><?php echo $tr->id_customer ?></td>
            </tr>
            <tr style="font-weight: bold; color:green;">
                <td>ID Rental</td>
                <td>:</td>
                <td><?php echo $tr->id_rental ?></td>
            </tr>
            <tr style="font-weight: bold; color:green;">
                <td>Nama Customer</td>
                <td>:</td>
                <td><?php echo $tr->nama ?></td>
            </tr>
        <tr style="font-weight: bold; color:green;">
            <td>Nama Mobil</td>
            <td>:</td>
            <td><?php echo $tr->merk ?></td>
        </tr>

        <tr style="font-weight: bold; color:green;">
            <td>Tanggal Rental</td>
            <td>:</td>
            <td><?php echo $tr->tanggal_rental ?></td>
        </tr>

        <tr style="font-weight: bold; color:green;">
            <td>Tanggal Kembali</td>
            <td>:</td>
            <td><?php echo $tr->tanggal_kembali ?></td>
        </tr>

        <tr style="font-weight: bold; color:green;">
            <td>Harga Sewa / Hari</td>
            <td>:</td>
            <td>Rp.<?php echo number_format( $tr->harga,0,',','.') ?></td>
        </tr>

        <tr style="font-weight: bold; color:green;">
            <td>Status Pembayaran</td>
            <td>:</td>
            <td><?php if($tr->status_pembayaran == '0') {
                echo "Pembayaran Belum Lunas";
            }else{
                echo "Pembayaran Lunas";
                }
                ?>
                </td>
            </tr>

        <tr style="font-weight: bold; color:green;">
            <?php
                $x = strtotime($tr->tanggal_kembali);
                $y = strtotime($tr->tanggal_rental);
                $jmlhari = abs(($x - $y)/(60*60*24));
            ?>
            <td>Total Hari</td>
            <td>:</td>
            <td><?php echo $jmlhari ?> Hari</td>
        </tr>
            <tr></tr>
            <tr></tr>
            <tr></tr>
        <tr style="font-weight: bold; color:red;">
            <td>TOTAL PEMBAYARAN</td>
            <td>:</td>
            <td>Rp.<?php echo number_format($tr->harga * $jmlhari,0,',','.') ?></td>
        </tr>

        <tr>
                    <td>Rekening Pembayaran</td>
                    <td>:</td>
                    <td>
                        <ul>
                                <li>Bank BCA : 25371368147348 a/n Rental Mobil kelompok 2
                                <li>Bank BRI : 36542736472647 a/n Rental Mobil kelompok 2</li>
                                <li>Bank MANDIRI : 31233463274678 a/n Rental Mobil kelompok 2</li>
                            </li>
                        </ul>
                    </td>
                </tr>

            <?php endforeach; ?>

        </table>

        </body> </html>

View laporan_pdf

avatar yusufbachtiar_google_6375
@yusufbachtiar_google_6375

4 Kontribusi 0 Poin

Dipost 2 tahun yang lalu

Belum ada Jawaban. Jadi yang pertama Jawaban

Login untuk ikut Jawaban