<?php
$set =  $this->db->get("setting")->row();

?>

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

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Laporan Detail Biaya Tes</title>
	<style>
		@page {
			size: landscape;
		}

		body {
			text-align: center;
		}

		table {
			width: 100%;
			border-collapse: collapse;
			margin-bottom: 20px;
		}

		table th,
		table td {
			padding: 8px;
			text-align: left;
			border-bottom: 1px solid #ddd;
           

		}

		table th {
			background-color: #f2f2f2;
            font-size : 12px;
		}

		tbody tr:nth-child(even) {
			background-color: #f2f2f2;
		}

		tfoot {
			font-weight: bold;
		}

		tfoot:last-child {
			display: table-footer-group;
		}

		.additional-info {
			text-align: right;
			margin-top: 50px;
		}

	</style>
</head>

<body onload="window.print()">
	<table width="100%" border="0">
		<tr>
			<td width="15%" align="right"></td>
			<td>
				<div style="text-align:center"><b>LAPORAN TRANSAKSI BIAYA TES PER PERIODE</b></div>
				<div style="text-align:center"><b>PENERIMAAN PESERTA DIDIK BARU (PPDB) TP.
						<?php echo $tp ?> </b></div>
				<div style="text-align:center"><b><?= $set->sekolah ?></b></div>
				<div style="text-align:center"><small><?= $set->alamat ?>, Tlp./WA : <?= $set->tlp ?></small></div>
			</td>
			<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
			<!--<td width="15%"><canvas id="qr"></canvas></td>-->
		</tr>
	</table>
	<table>
		<thead>
			<tr>
				<th>NO.</th>
				<th>TANGGAL</th>
				<th>FAKTUR</th>
				<th>NO.PEND</th>
				<th>NAMA</th>
				<th>SEKOLAH ASAL</th>
				<th>KOMP. YG DIMINATI</th>
				<th>@ BIAYA</th>
				<th>DISKON</th>
				<th>BAYAR</th>
				<th>PETUGAS</th>
			</tr>
		</thead>
        <tbody>
            <?php 
            $no = 0;
            $totalBayar = 0;
            $totalSisa = 0;
            foreach ($data->result() as  $value) {
            $no++;
            $totalBayar += $value->bayar;
            $totalSisa += ($value->biaya - $value->bayar);
            ?>
                <tr style=" font-size : 10px;">
                    <td   ><?= $no ?></td>
                    <td ><?= date('d-M-Y', strtotime($value->tgl_trans)) ?></td>
                    <td ><?= $value->no_trans ?></td>
                    <td><?= $value->no_pendaftaran ?></td>
                    <td><?= $value->nama_lengkap ?></td>
                    <td><?= $value->sekolah_asal ?></td>
                    <td ><?= $value->kompetensi ?></td>
                    <td>Rp. <?= number_format($value->biaya) ?>,-</td>
                    <td>Rp. <?=number_format($value->diskon) ?>,-</td>
                    <td>Rp. <?= number_format($value->bayar) ?>,-</td>
                    <td><?= $value->operator ?></td>
                </tr>
            <?php 
             }
             $totalSaldo = $totalBayar ;
            ?>

        <tr>
            <th style=" text-align: right; border-bottom:0px;" colspan="8"><br></th>
            <th style=" border-bottom:0px;">TOTAL :<br></th>
            <th style=" border-bottom:0px; font-size: 9px;">Rp. <?= number_format($totalBayar) ?>,-<br></th>
            <th style=" border-bottom:0px; font-size: 9px;"><br></th>
        </tr>
        <!-- <tr>
            <th style="width: 73.2092%; text-align: right; border-bottom:0px;" colspan="7"><br></th>
            <th style="null">SALDO :<br></th>
            <th style="font-size: 9px;">Rp.<br></th>
            <th style=" font-size: 9px;"><?= number_format($totalSaldo) ?><br></th>
        </tr> -->


        </tbody>
		


	</table>
	<table>
		<tfoot>

		</tfoot>
	</table>
    <table style="width: 100%;">
    <?php 
    $setting = $this->db->get("setting")->row();
    ?>
    <tbody style="font-size : 12px;">
        <tr style="border-bottom:0px;">
            <td style="width: 25.0000%; border-bottom:0px;"><br></td>
            <td style="width: 25.0000%;  border-bottom:0px;"><br></td>
            <td style="width: 25.0000%; border-bottom:0px;"><br></td>
            <td style="width: 25.0000%; border-bottom:0px;">Depok, <?php echo date('d-M-Y') ?></td>
        </tr>
        <tr style="null">
            <td style="width: 25.0000%; border-bottom:0px;">Ketua YPI Al Muhtadin,<br></td>
            <td style="width: 25.0000%; border-bottom:0px;">Kepala Sekolah,<br></td>
            <td style="width: 25.0000%; border-bottom:0px;">Ketua PPDB,<br></td>
            <td style="width: 25.0000%; border-bottom:0px;">Bendahara,</td>
        </tr>
        <tr>
            <td style="width: 25.0000%; border-bottom:0px;"><br><br><br></td>
            <td style="width: 25.0000%; border-bottom:0px;"><br></td>
            <td style="width: 25.0000%; border-bottom:0px;"><br></td>
            <td style="width: 25.0000%; border-bottom:0px;"><br></td>
        </tr>
        <tr>
            <td style="width: 25.0000%; border-bottom:0px;"><?= $setting->ketua_yayasan ?></td>
            <td style="width: 25.0000%; border-bottom:0px;"><?= $setting->kepsek ?></td>
            <td style="width: 25.0000%; border-bottom:0px;"><?= $setting->ketua_ppdb ?></td>
            <td style="width: 25.0000%; border-bottom:0px;"><?= $setting->bendahara ?></td>
        </tr>
    </tbody>
</table>


	
</body>

</html>
