<?php ob_start();
error_reporting(0);
require("../../config/koneksi.php");
require("../../config/function.php");
require("../../config/crud.php");

session_start();
if (!isset($_SESSION['id_user'])) {
    die('Anda tidak diijinkan mengakses langsung');
}
$idsiswa=$_GET['idsiswa'];
$data = mysqli_query ($koneksi, " select  *
										  
										  from 
										  siswa
										  where
										  id_siswa = '$idsiswa' ");
$row = mysqli_fetch_array ($data);
?>

<!DOCTYPE html>
<html>

<head>
    <meta charset='utf-8'>

    <title>Detail Pembayaran</title>
<link rel="stylesheet" href="../../plugins/bootstrap/dist/css/bootstrap.min.css">
</head>
<body style="font-size: 12px;">
   <center><h5>RINCIAN PEMBAYARAN SEKOLAH<br><?= strtoupper($setting['sekolah']) ?></h5></center>
   
   <div style="padding-left:20px;margin-right:50px ;" class="col-md-12">
    <div class='box-body'>
		
			<table class="table">
				<tr>
					<td style="width:10%;">
						NIS 
					</td>
					<td>
						: <?php echo $row['nis']; ?>
					</td>
				</tr>
				<tr>					
					<td>
						Nama
					</td>
					<td>
						: <?php echo $row['nama'] ; ?>
					</td>
				</tr>
				<tr>		
					<td>
						Kelas
					</td>
					<td>
						: <?php echo $row['id_kelas'] ; ?>
					</td>
				</tr>
			</table>
		
			</div>
			</div>
			
                      <table  width="100%" border='1'>
                           <thead>
                          <tr>
						<th width="5%" style="text-align:center">No</th>
						<th width="15%" style="text-align:center">Tanggal</th>
						<th style="text-align:center">No Reff</th>
						<th width="15%" style="text-align:center">Pembayaran</th>
						<th width="15%" style="text-align:center">Bulan</th>
						<th width="15%" style="text-align:center">Nominal</th>
						</tr>
	                   </thead>
					<?php 
					include"fungsi.php";
						$no = 0;
							$data = mysqli_query ($koneksi, " select  * from trx where idsiswa = '$idsiswa' ORDER BY idt ASC");
							while ($rw = mysqli_fetch_array ($data))
							
						{
							$kodes=fetch($koneksi,'m_bayar',['kode'=>$rw['kode']]);
							$bulane=fetch($koneksi,'bulan',['bln'=>$rw['untuk']]);
							$no++;
					?>
                        <tbody>
					<tr>
						<td style="text-align:center"><?php echo $no ; ?></td>
						<td style="text-align:center"><?= $rw['tanggal'] ?></td>
						<td style="text-align:center"><?= $rw['bukti'] ?></td>
						<td style="text-align:center"><?= $kodes['nama_pembayaran'] ?></td>
						<td style="text-align:center"><?= $bulane['ket'] ?></td>
						<td style="text-align:center">Rp <?= format_rupiah($kodes['besar']) ?></td>
					</tr>
	   <?php } ?>
	 </tbody>
	</table>
				
</body>
</html>
