<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Laporan Arus Kas Operasional Koperasi <?= $bulan . '/' . $tahun ?></title>
    <style>
        hr {
            display: block;
            margin-top: 0.1em;
            margin-bottom: 0.5em;
            margin-left: auto;
            margin-right: auto;
            border-style: double;
            border-width: 2px;
        }

        * {
            box-sizing: border-box;
        }

        .column {
            float: left;
            width: 50%;
            padding: 10px;
        }

        @page {
            size: landscape;
        }

        .row::after {
            content: "";
            clear: both;
            display: table;
        }

        @media print {
            .pagebreak {
                clear: both;
                page-break-after: always;
            }
        }
    </style>
</head>

<body>
    <div class="row">
        <div class="col-lg-12 grid-margin stretch-card">
            <div class="card">
                <div class="row">
                    <div class="col-lg-10 offset-lg-1">
                        <div class="card-body">
                            <!-- <div class="pagebreak"> </div> -->
                            <div class="row">
                                <table>
                                    <tr>
                                        <th><img src="<?= base_url('assets/') ?>img/arisan3.png" width="50%"
                                                alt="avatar">
                                        </th>
                                        <th>
                                            <a style="font-size: 12px;">LAPORAN REALISASI & STORTING</a><br>
                                            <a style="font-size: 24px;">KSP BINA ARTHA PRIMA</a><br>
                                            <a style="font-size: 12px;"><?= $option['alamat_koperasi'] ?></a><br>
                                            <a style="font-size: 12px;">Kode Pos : <?= $option['kd_pos'] ?> || Telepon :
                                                <?= $option['cs_koperasi'] ?> ||
                                                email : <?= $option['email_koperasi'] ?> || website :
                                                <?= $option['web_koperasi'] ?>
                                            </a><br>
                                        </th>
                                    </tr>
                                </table>
                            </div>
                            <hr class="mb-4">
                            <center>
                                <a style="font-size: 20px; font-weight: bold;">LAPORAN PINJAMAN KOPERASI</a><br>
                                <a style="font-size: 20px; font-weight: bold;"><?= $this->mycustom->bulanIndo($bulan)  ?>
                                    <?= $tahun  ?></a>
                            </center>
                            <table style="border: 1px solid black; border-collapse: collapse; width: 100%">
                                <thead>
                                    <tr style="border: 1px solid black; border-collapse: collapse;">
                                        <th rowspan="2" style="border: 1px solid black; border-collapse: collapse;">
                                            <center>No </center>
                                        </th>
                                        <th rowspan="2" style="border: 1px solid black; border-collapse: collapse;">
                                            <center>Marketing </center>
                                        </th>
                                        <th rowspan="2" style="border: 1px solid black; border-collapse: collapse;">
                                            <center>Realisasi</center>
                                        </th>
                                        <th rowspan="2" style="border: 1px solid black; border-collapse: collapse;">
                                            <center>Target Storting</center>
                                        </th>
                                        <th rowspan="2" style="border: 1px solid black; border-collapse: collapse;">
                                            <center>Jumlah Storting</center>
                                        </th>
                                        <td colspan="5" style="border: 1px solid black; border-collapse: collapse;">
                                            <center>Biaya dan Jasa Pinjaman</center>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="border: 1px solid black; border-collapse: collapse;">
                                            <center>Administrasi</center>
                                        </td>
                                        <td style="border: 1px solid black; border-collapse: collapse;">
                                            <center>Resiko Kredit</center>
                                        </td>
                                        <td style="border: 1px solid black; border-collapse: collapse;">
                                            <center>Jasa</center>
                                        </td>
                                        <td style="border: 1px solid black; border-collapse: collapse;">
                                            <center>Simpanan</center>
                                        </td>
                                        <td style="border: 1px solid black; border-collapse: collapse;">
                                            <center>Pokok</center>
                                        </td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $no = 1; ?>
                                    <?php foreach ($marketing as $Data_marketing) : ?>
                                        <tr style="border: 1px solid black; border-collapse: collapse;">
                                            <td style="border: 1px solid black; border-collapse: collapse;">
                                                <center><?= $no ?></center>
                                            </td>
                                            <td style="border: 1px solid black; border-collapse: collapse;"
                                                class="text-left">
                                                <?= $Data_marketing->nm_panggilan ?>
                                            </td>
                                            <td
                                                style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                                <?php
                                                foreach ($realisasi as $Data_realisasi) :
                                                    if ($Data_realisasi->marketing_id == $Data_marketing->marketing_id) :
                                                        echo number_format($Data_realisasi->ttl_realisasi, 0, ',', '.') . ',-';
                                                    endif;
                                                endforeach;
                                                ?>
                                            </td>
                                            <td
                                                style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                                <?php
                                                foreach ($target_storting as $Target_storting) :
                                                    if ($Target_storting->marketing_id == $Data_marketing->marketing_id) :
                                                        echo number_format($Target_storting->ttl_target, 0, ',', '.') . ',-';
                                                    endif;
                                                endforeach;
                                                ?>
                                            </td>
                                            <td
                                                style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                                <?php
                                                foreach ($storting as $Storting) :
                                                    if ($Storting->marketing_id == $Data_marketing->marketing_id) :
                                                        echo number_format($Storting->ttl_bayar, 0, ',', '.') . ',-';
                                                    endif;
                                                endforeach;
                                                ?>
                                            </td>
                                            <td
                                                style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                                <?php
                                                foreach ($realisasi as $Data_realisasi) :
                                                    if ($Data_realisasi->marketing_id == $Data_marketing->marketing_id) :
                                                        echo number_format($Data_realisasi->ttl_admin, 0, ',', '.') . ',-';
                                                    endif;
                                                endforeach;
                                                ?>
                                            </td>
                                            <td
                                                style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                                <?php
                                                foreach ($realisasi as $Data_realisasi) :
                                                    if ($Data_realisasi->marketing_id == $Data_marketing->marketing_id) :
                                                        echo number_format($Data_realisasi->ttl_rk, 0, ',', '.') . ',-';
                                                    endif;
                                                endforeach;
                                                ?>
                                            </td>
                                            <td
                                                style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                                <?php
                                                foreach ($storting as $Storting) :
                                                    if ($Storting->marketing_id == $Data_marketing->marketing_id) :
                                                        echo number_format($Storting->ttl_jasa, 0, ',', '.') . ',-';
                                                    endif;
                                                endforeach;
                                                ?>
                                            </td>
                                            <td
                                                style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                                <?php
                                                foreach ($storting as $Storting) :
                                                    if ($Storting->marketing_id == $Data_marketing->marketing_id) :
                                                        echo number_format($Storting->ttl_simpanan, 0, ',', '.') . ',-';
                                                    endif;
                                                endforeach;
                                                ?>
                                            </td>
                                            <td
                                                style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                                <?php
                                                foreach ($storting as $Storting) :
                                                    if ($Storting->marketing_id == $Data_marketing->marketing_id) :
                                                        echo number_format($Storting->ttl_pokok, 0, ',', '.') . ',-';
                                                    endif;
                                                endforeach;
                                                ?>
                                            </td>
                                        </tr>
                                        <?php $no++; ?>
                                    <?php endforeach; ?>
                                </tbody>
                                <tfoot>
                                    <tr style="border: 1px solid black; border-collapse: collapse;">
                                        <td colspan="2"
                                            style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                            <center>Jumlah</center>
                                        </td>
                                        <td colspan="1"
                                            style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                            <?= number_format($jml_realisasi['ttl_realisasi'], 0, ',', '.') ?>,-
                                        </td>
                                        <td colspan="1"
                                            style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                            <?= number_format($jml_target_storting['ttl_target'], 0, ',', '.') ?>,-
                                        </td>
                                        <td colspan="1"
                                            style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                            <?= number_format($jml_storting['ttl_bayar'], 0, ',', '.') ?>,-
                                        </td>
                                        <td colspan="1"
                                            style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                            <?= number_format($jml_realisasi['ttl_admin'], 0, ',', '.') ?>,-
                                        </td>
                                        <td colspan="1"
                                            style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                            <?= number_format($jml_realisasi['ttl_rk'], 0, ',', '.') ?>,-
                                        </td>
                                        <td colspan="1"
                                            style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                            <?= number_format($jml_storting['ttl_jasa'], 0, ',', '.') ?>,-
                                        </td>
                                        <td colspan="1"
                                            style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                            <?= number_format($jml_storting['ttl_simpanan'], 0, ',', '.') ?>,-
                                        </td>
                                        <td colspan="1"
                                            style="border: 1px solid black; border-collapse: collapse; text-align: right;">
                                            <?= number_format($jml_storting['ttl_pokok'], 0, ',', '.') ?>,-
                                        </td>
                                    </tr>
                                </tfoot>
                            </table><br>
                            <center>
                                <table>
                                    <tr>
                                        <th style="font-weight: normal; text-align: left;">
                                            <a></a><br>
                                            <a>Kudus, <?= $this->mycustom->bulanIndo($bulan)  ?>
                                                <?= $tahun  ?></a><br>
                                            <a></a><br>
                                            <a></a>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td style="text-align: center;">Bagian Kasir,</td>
                                        <td></td>
                                        <td style="text-align: center;">Koperasi,</td>
                                        <td></td>
                                        <td style="text-align: center;">Manager,</td>
                                        <td></td>
                                        <td style="text-align: center;">Keuangan</td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: center;">( Nor Haryanti )</td>
                                        <td></td>
                                        <td style="text-align: center;">( Setiawan Pangestu )</td>
                                        <td></td>
                                        <td style="text-align: center;">( Arief Rahman )</td>
                                        <td></td>
                                        <td style="text-align: center;">( David Candra Kurniawan )</td>
                                    </tr>
                                </table>
                            </center>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>

<script language=javascript>
    function printWindow() {
        bV = parseInt(navigator.appVersion);
        if (bV >= 4) window.print();
    }
    printWindow();
</script>

</html>