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

$no = 1;
$d = mysqli_fetch_array(mysqli_query($conn,"SELECT a.idKelas, b.nmKelas, c.namamatapelajaran, d.nama_guru FROM `rb_jadwal_pelajaran` a JOIN kelas_siswa b ON a.idKelas=b.idKelas JOIN rb_mata_pelajaran c ON a.kode_pelajaran=c.kode_pelajaran JOIN rb_guru d ON a.nip=d.nip where a.kodejdwl='$_GET[id]'"));

$tampil = mysqli_fetch_array(mysqli_query($conn,"SELECT * FROM rb_journal_list where kodejdwl='$_GET[id]' "));
?>
<!DOCTYPE html>
<html>

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

<body>

  <h3 align="center">LAPORAN JOURNAL GURU</h3>
  <hr>
  <h4 class="box-title">KELAS :<?php echo $d['nmKelas']; ?> </h4>
  <h4 class="box-title">NAMA GURU :<?php echo $d['nama_guru']; ?> </h4>
  <table border="1" class="table table-bordered table-striped">
    <thead>
      <tr>
        <th bgcolor="silver" style='width:20px'>No</th>
        <th bgcolor="silver">Hari</th>
        <th bgcolor="silver" style='width:90px'>Tanggal</th>
        <th bgcolor="silver" style='width:70px'>Jam Ke</th>
        <th bgcolor="silver" style='width:230px'>Materi</th>
        <th bgcolor='silver' style='width:240px'>Keterangan</th>
      </tr>
    </thead>
    <tbody>
      <?php
      $no = 0;
      $query = mysqli_query($conn,"SELECT * FROM rb_journal_list where kodejdwl='$_GET[id]' ");
      while ($row = mysqli_fetch_array($query)) {
        $no++;
      ?>
        <tr>
          <td><?php echo $no; ?></td>
          <td><?php echo $row['hari']; ?></td>
          <td><?php echo $row['tanggal']; ?></td>
          <td><?php echo $row['jam_ke']; ?></td>
          <td><?php echo $row['materi']; ?></td>
          <td><?php echo $row['keterangan']; ?></td>



        </tr>
        </tr><?php } ?>
    </tbody>
  </table>
  <br />

  <table width="100%">
    <tr>
      <td align="center"></td>
      <td align="center" width="400px">
        Banyuwangi, <?php echo tgl_raport(date("Y-m-d")); ?>
        <br />Guru Pengampu,<br /><br /><br /><br />
        <b><u><?php echo $d['nama_guru']; ?></u></b>
      </td>
    </tr>
  </table>
</body>
<script>
  window.print()
</script>

</html>