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

<div class="content-wrapper">

  <section class="content-header">
    <h1>
      Data Siswa
      <!-- <small>Data Siswa</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">Siswa</h3>
            <div class="btn-group pull-right">
              <a href="siswa_tambah.php" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> &nbsp Tambah siswa</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>NAMA</th>
                    <th>NIS</th>
                    <th>KELAS</th>
                    <th>STATUS</th>
                    <th width="18%">OPSI</th>
                  </tr>
                </thead>
                <tbody>
                  <?php 
                  $no=1;
                  $data = mysqli_query($koneksi,"SELECT * FROM siswa, jurusan where siswa_jurusan=jurusan_id order by siswa_id desc");
                  while($d = mysqli_fetch_array($data)){
                    ?>
                    <tr>
                      <td><?php echo $no++; ?></td>
                      <td><?php echo $d['siswa_nama']; ?></td>
                      <td><?php echo $d['siswa_nis']; ?></td>
                      <td><?php echo $d['jurusan_nama']; ?></td>
                      <td><?php echo $d['siswa_status']; ?></td>
                      <td>                        
                        <a class="btn btn-success btn-sm" href="siswa_riwayat.php?id=<?php echo $d['siswa_id'] ?>"><i class="fa fa-list"></i> Riwayat Point</a>
                        <a class="btn btn-warning btn-sm" href="siswa_edit.php?id=<?php echo $d['siswa_id'] ?>"><i class="fa fa-cog"></i></a>
                        <a class="btn btn-danger btn-sm" href="siswa_hapus_konfir.php?id=<?php echo $d['siswa_id'] ?>"><i class="fa fa-trash"></i></a>
                      </td>
                    </tr>
                    <?php 
                  }
                  ?>
                </tbody>
              </table>
            </div>
          </div>

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

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