<!-- Hak Cipta dilindungi Undang-undang. Hak Cipta : Khamdi Rahmani, Reg. Kemenkum HAM No : 000121327. Dilarang merubah isi File tanpa ijin tertulis dari pemegang Hak Cipta.-->

<table width="1150">
    <tr>
        <td width="600" valign="top">
            <div class="card-body pt-0 mt-0">
                <section class="">
                    <!-- title row -->
                    <div class="row">
                        <div class="col-12">
                            <h5 class="page-header">
                                <?php
                                $view = new lembaga;
                                echo $view->viewImage('../../../../asset/dokumen/foto/', 'logo', 'mr-2 position-absolute', '60', '60');
                                echo "<b class='d-block ml-5 pl-3 pt-1'>" . $clssekolah->dataSekolah('sekolah') . "</b>";
                                echo "<i class='footer font ml-5 pl-3 mb-2 pb-3'>" . $clssekolah->dataSekolah('alamat')  . "</i>"; ?>

                                <small class="float-right position-relative"><b class="font">LEMBAR PENERIMA</b> </small><br>
                            </h5>
                        </div>
                        <h5><small class="float-left position-relative ml-2 mt-2"><b><u>BUKTI PEMBAYARAN</u></b> </small></h5><br>
                    </div>
                    <div class="row invoice-info">
                        <div class="col-sm-4 invoice-col">
                            Penerima
                            <address>
                                <?php echo $penerima; ?><br>
                                <?php echo $format->dateToIndo($tanggal); ?><br>
                            </address>
                        </div>
                        <div class="col-sm-6 invoice-col">
                            <address>
                                <strong><?php echo strtoupper($format->entityEncode($pembayar1)); ?></strong><br>
                                <?php echo $pembayar2 . ' <br>' . $pembayar3 . ' <br>' . $pembayar4; ?>

                            </address>
                        </div>

                        <div class="col-sm-2 invoice-col">
                            <p class="float-right position-relative"> <?php
                                                                        QRCode::png($qrcode, '../../../../qrcode/qrcode_' . $id_tr . '.png', 'M', 2, 2);
                                                                        echo "<img src='../../../../qrcode/qrcode_" . $id_tr . ".png' class='position-relative'/>" ?></p>
                        </div>
                        <div class="col-sm-12 invoice-col">
                            <i>ID-TRAN #<?php echo $id_tr; ?></i><br>
                            <i>METODE #<?php echo $metode; ?></i>

                            <b class="float-right">JUMLAH : <?php echo number_format($jmlKuitansi, 0, ",", "."); ?></b>
                        </div>
                    </div>
                    <div class="row font">
                        <div class="col-12 table-responsive">
                            <table class="table table-striped table-sm">
                                <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>Kode : Jenis Pembayaran</th>
                                        <th>Periode</th>
                                        <th>Jumlah</th>
                                        <th>Catatan</th>

                                    </tr>
                                </thead>
                                <tbody>

                                    <?php
                                    error_reporting(0);
                                    clearstatcache();
                                    $class = new transaksi();
                                    $showList = $class->showTransaksiID($tb_transaksi, $id_tr);
                                    while ($dataTr = $showList->fetch(PDO::FETCH_OBJ)) {
                                        if ($dataTr->jumlah == "" || $dataTr->jumlah == 0) {
                                            $jumlah = number_format(0, 0, ",", ".");
                                        } else {
                                            $jumlah = number_format($dataTr->jumlah, 0, ",", ".");
                                        };

                                        $tahap = $dataTr->tahap;

                                        //startAt
                                        $startAt = $class->startAt($tb_siswa, $nis);
                                        $cekbulan = $class->cekPeriode($startAt, $tahap, $tahun1, $tahun2);

                                        //nama Bayar
                                        $classNB = new namaBayar();
                                        $ceknamaBayar = $classNB->ceknamaBayar($tahun, $dataTr->jenis, $dataTr->jenjang);

                                        $showJenis = $classNB->shownamaBayar($tahun, $dataTr->jenis, $dataTr->jenjang);
                                        $datajenis = $showJenis->fetch(PDO::FETCH_OBJ);
                                        $field_tang = 'tang_' . $datajenis->kode;
                                        $setbulanan = $datajenis->bulanan; //Cek Apakah Bulanan

                                        if ($setbulanan == "Tidak") {
                                            $periode = "Tahap " . $tahap;
                                        } else {
                                            $periode = $cekbulan;
                                        };

                                        echo "
                                            <tr>
                                                <td width='5px'>#</td>
                                                <td align=left>$dataTr->jenis : $ceknamaBayar</td>
                                                <td align=left>$periode</td>
                                                <td align=left>" . $jumlah . "</td>
                                                <td align=left><i style='font-size:8px'>$dataTr->catatan</i></td>
                                            </tr>";
                                    }
                                    ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="row col-12 font">
                        <div class="col-7">
                            <div class="callout callout-default pt-1 pl-1">
                                <b>Informasi</b>
                                <p><?php echo  $clssekolah->dataSekolah('notice');; ?></p>
                            </div>
                        </div>
                        <?php
                        $infoTanggungan = $clssekolah->dataSekolah('info_kuitansi');

                        if ($infoTanggungan == "ya") {
                            echo " <div class='col-5'>
                            <div class=''>
                                <div class='row invoice-info'>
                                    <div class='col-sm-5 invoice-col'>
                                        <address>
                                            Tanggungan<br>
                                            Terbayar<br>
                                            Kurang<br>
                                        </address>
                                    </div>
                                    <div class='col-sm-1 invoice-col'>
                                        :<br>
                                        :<br>
                                        :<br>
                                    </div>
                                    <div class='col-sm-6 invoice-col float-right'>
                                       $total_tang<br>
                                       $terbayarTotal<br>
                                       $kurangTotal<br>
                                    </div>

                                </div>
                            </div>
                        </div>";
                        } else {
                            echo "";
                        };


                        ?>
                    </div>
                </section>
            </div>
        </td>
        <td width="50" align="left" valign="top"> <?php echo $view->viewImage('../../../../asset/dokumen/foto/', 'potong', 'ml-2 position-absolute', '12', '300'); ?></td>
        <td width="600" valign="top">
            <div class="card-body pt-0 mt-0">
                <section class="">
                    <!-- title row -->
                    <div class="row">
                        <div class="col-12">
                            <h5 class="page-header">
                                <?php
                                $view = new lembaga;
                                echo $view->viewImage('../../../../asset/dokumen/foto/', 'logo', 'mr-2 position-absolute', '60', '60');
                                echo "<b class='d-block ml-5 pl-3 pt-1'>"  . $clssekolah->dataSekolah('sekolah') .  "</b>";
                                echo "<i class='footer font ml-5 pl-3 mb-2 pb-3'>" .  $clssekolah->dataSekolah('alamat')  . "</i>"; ?>

                                <small class="float-right position-relative"><b class="font">LEMBAR PENYETOR</b> </small><br>
                            </h5>
                        </div>
                        <h5><small class="float-left position-relative ml-2 mt-2"><b><u>BUKTI PEMBAYARAN</u></b> </small></h5><br>
                    </div>
                    <div class="row invoice-info">
                        <div class="col-sm-4 invoice-col">
                            Penerima
                            <address>
                                <?php echo $penerima; ?><br>
                                <?php echo $format->dateToIndo($tanggal); ?><br>
                            </address>
                        </div>
                        <div class="col-sm-6 invoice-col">
                            <address>
                                <strong><?php echo $pembayar1; ?></strong><br>
                                <?php echo $pembayar2 . ' <br>' . $pembayar3 . ' <br>' . $pembayar4; ?>

                            </address>
                        </div>

                        <div class="col-sm-2 invoice-col">
                            <p class="float-right position-relative"> <?php
                                                                        QRCode::png($qrcode, '../../../../qrcode/qrcode_' . $id_tr . '.png', 'M', 2, 2);
                                                                        echo "<img src='../../../../qrcode/qrcode_" . $id_tr . ".png' class='position-relative'/>"; ?></p>
                        </div>
                        <div class="col-sm-12 invoice-col">
                            <i>ID-TRAN #<?php echo $id_tr; ?></i><br>
                            <i>METODE #<?php echo $metode; ?></i>

                            <b class="float-right">JUMLAH : <?php echo number_format($jmlKuitansi, 0, ",", "."); ?></b>
                        </div>
                    </div>
                    <div class="row font">
                        <div class="col-12 table-responsive">
                            <table class="table table-striped table-sm">
                                <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>Kode : Jenis Pembayaran</th>
                                        <th>Periode</th>
                                        <th>Jumlah</th>
                                        <th>Catatan</th>

                                    </tr>
                                </thead>
                                <tbody>

                                    <?php
                                    $class = new transaksi();
                                    $showList = $class->showTransaksiID($tb_transaksi, $id_tr);
                                    while ($dataTr = $showList->fetch(PDO::FETCH_OBJ)) {
                                        if ($dataTr->jumlah == "" || $dataTr->jumlah == 0) {
                                            $jumlah = number_format(0, 0, ",", ".");
                                        } else {
                                            $jumlah = number_format($dataTr->jumlah, 0, ",", ".");
                                        };

                                        $tahap = $dataTr->tahap;

                                        //startAt
                                        $startAt = $class->startAt($tb_siswa, $nis);
                                        $cekbulan = $class->cekPeriode($startAt, $tahap, $tahun1, $tahun2);

                                        //nama Bayar
                                        $classNB = new namaBayar();
                                        $ceknamaBayar = $classNB->ceknamaBayar($tahun, $dataTr->jenis, $dataTr->jenjang);

                                        $showJenis = $classNB->shownamaBayar($tahun, $dataTr->jenis, $dataTr->jenjang);
                                        $datajenis = $showJenis->fetch(PDO::FETCH_OBJ);
                                        $field_tang = 'tang_' . $datajenis->kode;
                                        $setbulanan = $datajenis->bulanan; //Cek Apakah Bulanan

                                        if ($setbulanan == "Tidak") {
                                            $periode = "Tahap " . $tahap;
                                        } else {
                                            $periode = $cekbulan;
                                        };

                                        echo "
                                            <tr>
                                                <td width='5px'>#</td>
                                                <td align=left>$dataTr->jenis : $ceknamaBayar</td>
                                                <td align=left>$periode</td>
                                                <td align=left>" . $jumlah . "</td>
                                                <td align=left><i style='font-size:8px'>$dataTr->catatan</i></td>
                                            </tr>";
                                    }
                                    ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="row col-12 font">
                        <div class="col-7">
                            <div class="callout callout-default pt-1 pl-1">
                                <b>Informasi</b>
                                <p><?php echo $clssekolah->dataSekolah('notice'); ?></p>
                            </div>
                        </div>
                        <?php
                        $infoTanggungan = $clssekolah->dataSekolah('info_kuitansi');

                        if ($infoTanggungan == "ya") {
                            echo " <div class='col-5'>
                            <div class=''>
                                <div class='row invoice-info'>
                                    <div class='col-sm-5 invoice-col'>
                                        <address>
                                            Tanggungan<br>
                                            Terbayar<br>
                                            Kurang<br>
                                        </address>
                                    </div>
                                    <div class='col-sm-1 invoice-col'>
                                        :<br>
                                        :<br>
                                        :<br>
                                    </div>
                                    <div class='col-sm-6 invoice-col float-right'>
                                       $total_tang<br>
                                       $terbayarTotal<br>
                                       $kurangTotal<br>
                                    </div>

                                </div>
                            </div>
                        </div>";
                        } else {
                            echo "";
                        };


                        ?>
                    </div>
                </section>
            </div>
        </td>
    </tr>
</table>