  <?php
  $kelas    = str_replace("'","`",(isset($_GET['kelas'])) ? $_GET['kelas'] : "");
  $qkelas=mysqli_query($connect,"select * from tb_kelas where id_kelas='".$kelas."'");
  $rkelas=mysqli_fetch_array($qkelas);
  ?>
  <div id="loader" class="loader" style="display:none;"></div>


    <br>
    <!--
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-12">
            <h5>Data Kategori Sentra</h5>
          </div>
        </div>
      </div>
    </div>
    -->
    

    <section class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-md-12">
            <div class="card card-info">
              <div class="card-header" style="background:#eb5d99;color:white;">
                <form action="">
                <input type="hidden" name="prefix" value="pengayaan">
                <h3 class="card-title">Uji Konsep - Kelas 
                    
                    <select name="kelas" style="cursor:pointer;padding:3px;" onchange="this.form.submit()">
                        <?php 
                        $qk=mysqli_query($connect,"select * from tb_kelas order by nama_kelas asc");
                        while($rk=mysqli_fetch_array($qk)){
                        ?>
                        <option value="<?php echo $rk['id_kelas'];?>" <?php if($kelas==$rk['id_kelas']){echo"Selected";}?>><?php echo $rk['nama_kelas'];?></option>
                        <?php }?>
                      </select>
                    

                </h3>
                </form>
           

              </div>
              <!-- /.card-header -->
              <div class="card-body table-responsive p-0">
                
              

                <table class="table table-striped table projects">
                  <thead>                  
                    <tr>
                      <th width="5%" style="text-align:center;">No</th>
                      <th width="5%">Foto</th>
                      <th width="45%">Nama Siswa</th>
                     
                      <th width="10%" style="text-align:center;">Umpan Balik</th>
                    </tr>
                  </thead>
                  <tbody>
                  <?php
                  $bilangan=1;
                  $q=mysqli_query($connect,"select * from tb_siswa where id_kelas='".$kelas."'")or die(mysqli_error($connect));
                  while($r=mysqli_fetch_array($q)){

                  ?>
                    
                    <tr>
                      <td align="center"><?php echo $bilangan++;?></td>
                      <td>
                        <img onerror="this.src='assets/img/ava.png'" alt="Foto" class="table-avatar" src="../assets/foto/<?php echo md5($r['id_siswa']);?>.jpg?p=<?php echo date('s');?>">
                      </td>
                      <td>
                        <?php echo $r['nama_lengkap'];?>
                      </td>

                     
                      <td align="center">

                            <?php
                            $qcek=mysqli_query($connect,"select * from tb_jawaban_umpanbalik where id_siswa='".$r['id_siswa']."'");
                            $jumjawaban=mysqli_num_rows($qcek);
                            if($jumjawaban>0){
                            ?>
                            <a href="index.php?prefix=jawabanumpanbalik&kelas=<?php echo $kelas;?>&id=<?php echo $r['id_siswa'];?>"><span class="badge bg-success"><i class="fa fa-check"></i></span></a>
                            <?php }else{?>
                            <span class="badge bg-danger"><i class="fa fa-times-circle"></i></span>
                            <?php }?>


                      </td>
                      

                    </tr>

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


              </div>


            </div>
            <!-- /.card -->
            <!-- /.card -->
          </div>
          <!-- /.col -->
        </div>
      </div><!-- /.container-fluid -->
    </section>







          <style>
          .loader {
          position: fixed;
          left: 0px;
          top: 0px;
          width: 100%;
          height: 100%;
          z-index: 9999;
          background: url('assets/img/loading.gif') 50% 50%   no-repeat;    
          }
          </style>

         