
<?php	
$data = mysqli_query ($koneksi, " select  *
										  
										  from 
										  siswa
										  where
										  id_siswa = $_GET[idsiswa]");
$row = mysqli_fetch_array ($data);
?>
 <div class='row'>
        <div class='col-md-12'>
            <div class="card">
             <div class="card-header">
                 
                    <div class='right'>
				     <button class='btn btn-md btn-flat btn-success' onclick="frames['frameresult'].print()"><i class='fa fa-print'></i> Cetak</button>
		  </div>
		     <h5 class='box-title'><i class="fas fa-credit-card fa-fw"></i> Detail Tabungan</h5>
         </div>
          
				 <div class='card-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>
			<br>
			 <div class='table-responsive'>
                        <table style="font-size: 11px" id='example1' class='table table-bordered table-hover'>
                            <thead>
                            <tr>
                               
						<th width="5px">
							No
						</th>
						<th>
							Tanggal
						</th>
						<th>
							No Resi
						</th>
						<th>
							Debet
						</th>
						<th>
							Kredit
						</th>
						<th>
							Saldo
						</th>
						<th width="5%">
							Struk
						</th>
						
					</tr>
					</thead>
                        <tbody>
					<?php 
					include"fungsi.php";
						$no = 1;
							$data = mysqli_query ($koneksi, " select  *
																	  from 
																	  tabungan
																	  where
																	  idsiswa = $_GET[idsiswa]
																	  order by id desc");
							while ($rw = mysqli_fetch_array ($data))
							
						{
							$siswa=fetch($koneksi,'penabung',['idsiswa'=>$rw['idsiswa']]);
					?>
					<tr>
						<td>
							<?php echo $no ; ?>
						</td>
						<td>
							<?= $rw['tanggal'] ?>
						</td>
						<td>
							<?= $rw['bukti'] ?>
						</td>
						<td>
							<?php if ($rw['setoran'] == '') {} else { echo format_rupiah($rw['setoran']) ;} ?>
						</td>
						<td>
							<?php if ($rw['penarikan'] == '') {} else { echo format_rupiah($rw['penarikan']) ;} ?>
						</td>
						<td>
							<?php if ($rw['saldo'] == '') {} else { echo format_rupiah($rw['saldo']) ;} ?>
						</td>
						<td>
						 <a href="?pg=cetaktabungan&id=<?= $rw['id'] ?>" class='btn btn-sm btn-flat btn-outline-danger'><i class='fa fa-print'></i> </button>
                  </a>
					</td>
					
					</tr>
					<?php
					$no++;
						}
					?>
					 </tbody>
				</table>
				</div>
				</div>
				</div>
				<iframe id='loadframe' name='frameresult' src="sandik_tabungan/cetakdetail.php?idsiswa=<?= $_GET['idsiswa'] ?>" style='display:none'></iframe>
 