<?php
session_start();
error_reporting(0);
include "config/koneksi.php";
include "config/fungsi_indotgl.php";

$idt = mysqli_fetch_array(mysqli_query($conn,"SELECT * FROM identitas "));

?>
<!DOCTYPE html>
<html>

<head>
	<title>Cetak - Laporan Barang Perkelas </title>
	<link rel="stylesheet" href="bootstrap/css/printer.css">
</head>

<body>
	<table width="100%">
		<tr>
			<td width="100px" align="left"><img src="./gambar/logo/<?php echo $idt['logo_kiri']; ?>" height="60px"></td>
			<td valign="top">
				<h3 align="center" style="margin-bottom:8px ">
					<?php echo $idt['nmSekolah']; ?>
				</h3>
				<center><?php echo $idt['alamat']; ?></center>
			</td>
			<td width="100px" align="right"><img src="./gambar/logo/<?php echo $idt['logo_kanan']; ?>" height="60px"></td>
		</tr>
	</table>
	<hr>
	<h3 align="center">LAPORAN DATA INVENTARIS KELAS</h3>
	
	<table border="1" class="table table-bordered table-striped">
		<thead>
		<tr>
              <th>No</th>
              <th>Nama Kelas</th>
              <th>Nama Inventaris</th>
              <th>Jumlah Inventaris</th>
             
            </tr>
		</thead>
		<tbody>
			<?php
			$kls = mysqli_query($conn, "SELECT rb_inventaris.*, kelas_siswa.nmKelas 
			FROM
			rb_inventaris 
			INNER JOIN kelas_siswa ON rb_inventaris.idKelas=kelas_siswa.idKelas
			 where rb_inventaris.idKelas='$_GET[kelas]'");
			$no = 1;
			while ($r = mysqli_fetch_array($kls)) {
				echo "<tr>
				<td>$no</td>
                              <td>$r[nmKelas]</td>
                              <td>$r[nmBarang]</td>
                              <td>$r[jumlahBarang]</td>
			</tr>";
				$no++;
			}
			?>
		</tbody>
	</table>
	<br />
	<table width="100%">
		<tr>
			<td align="center"></td>
			<td align="center" width="400px">
				<?php echo $idt['kabupaten']; ?>, <?php echo tgl_raport(date("Y-m-d")); ?>
				<br />Kepala Sekolah,<br /><br /><br /><br />
				<b><u><?php echo $idt['nmKepsek']; ?></u></b>
			</td>
		</tr>
	</table>
	
</body>
<script>
	window.print()
</script>

</html>
