<?php
ob_start();
$page = "instansi"; ?>
<?php
      require '../../config/Config.php';
  $config = new Config();
  include "hak-akses.php";

  if(!empty($_SESSION['student_id'])) {   
  include "../../layout/header.php";
  
?> 
<?php
    

    $query = "SELECT * FROM entity__student WHERE student_id='$student_id'  
    ";

    $result = $config->getDatum($query);



 ?>
 <!-- SIDEBAR END -->


  <!-- CONTENT START -->

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Nilai Raport
        <small></small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li><a href="#">Nilai</a></li>
        <li class="active">Raport</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="row">

       
        <div class="col-xs-12">
          <?= @$_SESSION['status']; 
                    unset($_SESSION['status']);
                ?>
          
          <div class="box">
            <div class="box-header">
              <h3 class="box-title"><?= $student_name;?></h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">


              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th><center>No.</center></th>
                  <th><center>Mata Pelajaran</center></th>
                  <th><center>Nilai Pengetahuan</center></th>
                  <th><center>Predikat Pengetahuan</center></th>
                  <th><center>Nilai Keterampilan</center></th>
                  <th><center>Predikat Keterampilan</center></th>
                

                 
                </tr>
                </thead>

                <tbody>
                    <?php
                      $subjects_value = $config->getData("SELECT * FROM entity__subjects_value WHERE school_id='$school_id' ")
                      foreach ($subjects_value as $subv){

                      $i=1;
                     $nilai=$config->getData("SELECT * FROM entity__student_subjects_value WHERE student_id='$student_id' ");
                     foreach ($nilai as $res){
                      ?>
                <tr>
                  <td><center> <?=$i ;?></center></td>                  
                  <td><center><?=$res['subjects_value_id'] ;?></center></td>
                  <td><center><?=$res['student_subjects_value_knowledge_total'] ;?></center></td>
                  <td><center><?=$res['student_subjects_value_knowledge_predicate'] ;?></center></td>
                  <td><center><?=$res['student_subjects_value_skill_total'] ;?></center></td>
                  <td><center><?=$res['student_subjects_value_skill_predicate'] ;?></center></td>
                  
                  
                </tr>
                  <?php
                   $i++;
                                                        }
                                                  }?>
                </tbody>
              </table>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>

<!-- CONTENT END -->
<?php
    include "../../layout/footer.php";
} else {
    header("Location:../../login/logout.php");
}
?>