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

session_start();
if (!isset($_SESSION['id_pengawas'])) {
    die('Anda tidak diijinkan mengakses langsung');
}
 include"fungsi.php";
		   $idsiswa=$_GET['idsiswa'];
		   $tanggal=date('Y-m-d');
		   $tabungan=fetch($koneksi,'tabungan',['idsiswa'=>$idsiswa,'tanggal'=>$tanggal,'ket'=>'Tarik']);
		  $penabung=fetch($koneksi,'penabung',['idsiswa' => $tabungan['idsiswa']]);
          $siswa=fetch($koneksi,'siswa',['id_siswa' =>$tabungan['idsiswa']]);


?>

<!DOCTYPE html>
<html>

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

    <title>Struk Tabungan</title>
<link rel="stylesheet" href="../../plugins/bootstrap/dist/css/bootstrap.min.css">


</head>

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

   <center>STRUK TABUNGAN SEKOLAH</center>
   <center><?= strtoupper($setting['sekolah']) ?> <br> Alamat : <?= $setting['alamat'] ?> Kec. <?= $setting['kecamatan'] ?> Kota/Kab. <?= $setting['kota'] ?></center>
    <img style="z-index: 800;position:absolute;margin-top:-50px;margin-left:25px" class="img" src="../../<?= $setting['logo'] ?>" width="50px">
   <hr>
   <div style="padding-left:20px;margin-right:50px ;" class="col-md-12">
    <table>
	<tbody>
           
                <tr>
                <td width='50px'>ID</td>
                <td width='10px'>:</td>
                <td><?= $penabung['id_tab'] ?></td>
				<td width='200px'></td>
				<td width='50px'>Tanggal</td>
                <td width='10px'>:</td>
                <td><?= $tabungan['tanggal'] ?></td>
				</tr>
				
				<tr>
                <td width='50px'>Nama</td>
                <td width='10px'>:</td>
                <td><?= $siswa['nama'] ?></td>
				<td width='200px'></td>
				<td width='50px'>Reff</td>
                <td width='10px'>:</td>
                <td><?= $tabungan['bukti'] ?></td>
				</tr>
				<tr>
                <td width='50px'>Debet</td>
                <td width='10px'>:</td>
                <td>Rp <?= format_rupiah($tabungan['setoran']) ?></td>
				<td width='200px'></td>
				<td width='50px'>Kredit</td>
                <td width='10px'>:</td>
                <td>Rp <?= format_rupiah($tabungan['penarikan']) ?></td>
				</tr>
				
				<tr>
                <td width='50px'>Saldo</td>
                <td width='10px'>:</td>
                <td><b>Rp <?= format_rupiah($tabungan['saldo']) ?></b></td>
				<td width='200px'></td>
				<td width='50px'>Untuk</td>
                <td width='10px':"</td>
                <td>Siswa</td>
				</tr>
			</tbody>
    </table>
	  <p><center>Struk ini merupaka tanda bukti menabung/penarikan tabungan sekolah yang sah</center></p>
	</div>
  <hr>
   <center>STRUK TABUNGAN SEKOLAH</center>
   <center><?= strtoupper($setting['sekolah']) ?> <br> Alamat : <?= $setting['alamat'] ?> Kec. <?= $setting['kecamatan'] ?> Kota/Kab. <?= $setting['kota'] ?></center>
    <img style="z-index: 800;position:absolute;margin-top:-50px;margin-left:25px" class="img" src="../../<?= $setting['logo'] ?>" width="50px">
   <hr>
   <div style="padding-left:20px;margin-right:50px ;" class="col-md-12">
    <table>
	<tbody>
           
                <tr>
                <td width='50px'>ID</td>
                <td width='10px'>:</td>
                <td><?= $penabung['id_tab'] ?></td>
				<td width='200px'></td>
				<td width='50px'>Tanggal</td>
                <td width='10px'>:</td>
                <td><?= $tabungan['tanggal'] ?></td>
				</tr>
				
				<tr>
                <td width='50px'>Nama</td>
                <td width='10px'>:</td>
                <td><?= $siswa['nama'] ?></td>
				<td width='200px'></td>
				<td width='50px'>Reff</td>
                <td width='10px'>:</td>
                <td><?= $tabungan['bukti'] ?></td>
				</tr>
				<tr>
                <td width='50px'>Debet</td>
                <td width='10px'>:</td>
                <td>Rp <?= format_rupiah($tabungan['setoran']) ?></td>
				<td width='200px'></td>
				<td width='50px'>Kredit</td>
                <td width='10px'>:</td>
                <td>Rp <?= format_rupiah($tabungan['penarikan']) ?></td>
				</tr>
				
				<tr>
                <td width='50px'>Saldo</td>
                <td width='10px'>:</td>
                <td><b>Rp <?= format_rupiah($tabungan['saldo']) ?></b></td>
				<td width='200px'></td>
				<td width='50px'>Untuk</td>
                <td width='10px'>:</td>
                <td>Petugas</td>
				</tr>
			</tbody>
    </table>
	  <p><center>Struk ini merupaka tanda bukti menabung/penarikan tabungan sekolah yang sah</center></p>
	</div>
  <hr>
</body>
</html>
