<?php include 'header.php'; ?>

<div class="content-wrapper">

  <section class="content-header">
    <h1>
      Input Prestasi
      <small>Input Prestasi</small>
    </h1>
    <ol class="breadcrumb">
      <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
      <li class="active">Dashboard</li>
    </ol>
  </section>

  <section class="content">
    <div class="row">
      <section class="col-lg-12">
        <div class="box box-primary">

          <div class="box-header">
            <h3 class="box-title">Input Kasus Prestasi</h3>
            <div class="btn-group pull-right">
              <a href="input_prestasi_tambah.php" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> &nbsp Input Prestasi</a>              
            </div>
          </div>
          <div class="box-body">


            <div class="table-responsive">
              <table class="table table-bordered table-striped" id="table-datatable">
                <thead>
                  <tr>
                    <th width="1%">NO</th>
                    <th>WAKTU</th>
                    <th>NAMA SISWA</th>
                    <th>KELAS</th>
                    <th>JURUSAN</th>
                    <th>TAHUN AJARAN</th>
                    <th>PRESTASI</th>
                    <th>POINT</th>
                    <th width="10%">OPSI</th>
                  </tr>
                </thead>
                <tbody>
                  <?php 
                  $no=1;
                  $data = mysqli_query($koneksi,"SELECT * FROM siswa, prestasi, jurusan, input_prestasi, kelas, ta where ta_id=kelas_ta and jurusan_id=kelas_jurusan and input_prestasi.kelas=kelas_id and input_prestasi.siswa=siswa_id and input_prestasi.prestasi=prestasi_id order by input_prestasi.id desc");
                  while($d = mysqli_fetch_array($data)){
                    ?>
                    <tr>
                      <td><?php echo $no++; ?></td>
                      <td><?php echo date('d-m-Y H:i:s', strtotime($d['waktu'])); ?></td>
                      <td><?php echo $d['siswa_nama']; ?></td>
                      <td><?php echo $d['kelas_nama']; ?></td>
                      <td><?php echo $d['jurusan_nama']; ?></td>
                      <td><?php echo $d['ta_nama']; ?></td>
                      <td><?php echo $d['prestasi_nama']; ?></td>
                      <td><?php echo $d['prestasi_point']; ?></td>
                      <td>                        
                        <a class="btn btn-warning btn-sm" href="input_prestasi_edit.php?id=<?php echo $d['id'] ?>"><i class="fa fa-cog"></i></a>
                        <a onclick="return confirm('Yakin ingin hapus?')" class="btn btn-danger btn-sm" href="input_prestasi_hapus.php?id=<?php echo $d['id'] ?>"><i class="fa fa-trash"></i></a>
                      </td>
                    </tr>
                    <?php 
                  }
                  ?>
                </tbody>
              </table>
            </div>
          </div>

        </div>
      </section>
    </div>
  </section>

</div>
<?php include 'footer.php'; ?>