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


$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 Tabungan</title>
<link rel="stylesheet" href="../../plugins/bootstrap/dist/css/bootstrap.min.css">


</head>

<body style="font-size: 12px;">

   <center><h4>RINCIAN TABUNGAN SEKOLAH</h4></center>
   <center></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>
			<br>
                      <table  width="100%" border="1">
                       
                          <tr>
						<th style="text-align:center;width:5%;height:40px">No</th>
						<th style="text-align:center;width:15%">Tanggal</th>
						<th>No Resi</th>
						<th style="text-align:center;width:15%">Debet</th>
						<th style="text-align:center;width:15%">Kredit</th>
						<th style="text-align:center;width:15%">Saldo</th>
						</tr>
	                  
					<?php 
					include"fungsi.php";
						$no = 0;
							$data = mysqli_query ($koneksi, " select  * from tabungan where idsiswa = '$idsiswa' ORDER BY id ASC");
							while ($rw = mysqli_fetch_array ($data))
							
						{
							$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:right">Rp <?= format_rupiah($rw['setoran']) ?></td>
						<td style="text-align:right">Rp <?= format_rupiah($rw['penarikan']) ?></td>
						<td style="text-align:right">Rp <?= format_rupiah($rw['saldo']) ?></td>
					</tr>
	   <?php } ?>
	 </tbody>
	</table>
				
</body>
</html>
