 <?php 
 include_once "../library/inc.sesadmin.php";
 include_once "../library/inc.library.php";
 include_once "../library/inc.connection.php";
 ?>

 <!-- additional content area start -->
 <div class="col-lg-12 mt-5">
 	<div class="card">
 		<div class="card-body">
 			<h4 class="header-title">Dashboard</h4>
 			<div class="additional-content">
 				<div class="alert alert-primary" role="alert">
 					<h4 class="alert-heading">Selamat Datang [<?php echo " ".$_SESSION['nama']." "; ?>]</h4>
 					<hr>
 					<p class="mb-0">di Sistem Informasi Pembayaran Administrasi Komite MAN 4 Bogor</p>
 				</div>
 			</div>
 		</div>
 	</div>
 </div>
 <!-- additional content area end -->

 <!-- table primary start -->
 <div class="col-lg-12 mt-3">
 	<div class="card">
 		<div class="card-body">
 			<h4 class="header-title">10 Transaksi Terakhir</h4>
 			<div class="single-table">
 				<div class="table-responsive">
 					<table class="table text-center">
 						<thead class="text-uppercase bg-primary">
 							<tr class="text-white">
 								<th scope="col">No</th>
 								<th scope="col">Tanggal Transaksi</th>
 								<th scope="col">NIS</th>
 								<th scope="col">Nama Siswa</th>
 								<th scope="col">Kelas</th>
 								<th scope="col">Jumlah</th>
 								<th scope="col">Keterangan</th>
 							</tr>
 						</thead>
 						<tbody>
 							<?php
 							$query = "SELECT transaksi.tgl_transaksi, transaksi_item.nis, siswa.nama_siswa, kelas.namakelas, transaksi_item.banyak, bulan.keterangan FROM transaksi INNER JOIN transaksi_item ON transaksi.no_transaksi=transaksi_item.no_transaksi INNER JOIN kelas_siswa ON transaksi_item.nis=kelas_siswa.nis INNER JOIN kelas ON kelas_siswa.kdkelas=kelas.kdkelas INNER JOIN siswa ON kelas_siswa.nis=siswa.nis INNER JOIN bulan ON transaksi_item.kode_bayar=bulan.kode ORDER BY transaksi.tgl_transaksi DESC LIMIT 10";
 							$hasil = mysql_query($query);
  // echo mysql_num_rows($hasil);
 							$nomor = 0;
 							$total = 0;
 							while ($qtabel = mysql_fetch_array($hasil))
 							{ 
 								$nomor++;
 								$total = $total + intval($qtabel['banyak']);
 								?>
 								<tr>
 									<th scope="row"><?php echo $nomor; ?></th>
 									<td><?php echo IndonesiaTgl($qtabel['tgl_transaksi']); ?></td>
 									<td><?php echo $qtabel['nis']; ?></td>
 									<td><?php echo $qtabel['nama_siswa']; ?></td>
 									<td><?php echo $qtabel['namakelas']; ?></td>
 									<td><?php echo format_angka($qtabel['banyak']); ?></td>
 									<td><?php echo $qtabel['keterangan']; ?></td>
 								</tr>
 								<?php } ?>
 							</tbody>
 						</table>
 					</div>
 				</div>
 			</div>
 		</div>
 	</div>
 	<!-- table primary end -->