<div class="content-wrapper">
   <!-- Content Header (Page header) -->
   <div class="content-header">
      <div class="container-fluid">
         <div class="row mb-2">
            <div class="col-sm-6">
               <h4 class="m-0">Exams Results</h4>
            </div>
            <!-- /.col -->
            <div class="col-sm-6">
               <ol class="breadcrumb float-sm-right">
                  <li class="breadcrumb-item">Dashboard</li>
                  <li class="breadcrumb-item">Exams Management</li>
                  <li class="breadcrumb-item active">Exams Results</li>
               </ol>
            </div>
            <!-- /.col -->
         </div>
         <!-- /.row -->
      </div>
      <!-- /.container-fluid -->
   </div>
   <section class="content">
      <div class="container-fluid">
         <div class="row">
            <div class="col-md-3 col-sm-6 col-12">
               <div class="info-box-content">
                  <a class="btn btn-info btn-success" href="Exams.php?page=Home"> <i class="fa fa-arrow-left"></i> Exams Management
                  </a>
               </div>
               <!-- /.info-box-content -->
               <!-- /.info-box -->
            </div>
         </div>
      </div>
   </section>
   <section class="content">
      <div class="row">
         <div class="col-md-12">
            <div class="card ">
               <div class="card-header">
                  <h3 class="card-title">Filter Results Per Class</h3>
                  <div class="card-tools">
                     <button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
                     <i class="fas fa-minus"></i>
                     </button>
                  </div>
                  <div class="card-body">
                     <div class="table-responsive" id='divstaffss'>
                        <form method="POST" action="" id="" enctype="multipart/form-data" novalidate onsubmit="return false">
                           <table class="table" style="font-size:12px">
                              <tbody>
                                 <tr>
                                    <td style="width:500px">
                                       <div class="form-group">
                                          <label for="inputStatus">Select Exam <span class="requireds">*</span></label>
                                          <select id="examu" class="form-control custom-select" required>
                                             <option selected value="">---</option>
                                             <?php                  
                                                $query=mysqli_query($con,"select * FROM Exam ORDER BY id DESC");
                                                while($row=mysqli_fetch_array($query))
                                                {
                                                ?>
                                             <option value="<?php echo $row['id']; ?>"> <?php echo $row['Title'].' '.'('.$row['Month'].' '.$row['Year'].')';  ?></option>
                                             <?php
                                                }
                                                ?>
                                          </select>
                                       </div>
                                    </td>
                                    <td>
                                       <div class="form-group">
                                          <label for="inputStatus">Grade <span class="requireds">*</span></label>
                                          <select id="klas" class="form-control custom-select" required>
                                             <option selected disabled value="">Select ---</option>
                                             <option value="GRADE 1">GRADE 1</option>
                                             <option value="GRADE 2">GRADE 2</option>
                                             <option value="GRADE 3">GRADE 3</option>
                                             <option value="GRADE 4">GRADE 4</option>
                                             <option value="GRADE 5">GRADE 5</option>
                                             <option value="GRADE 6">GRADE 6</option>
                                             <option value="GRADE 7">GRADE 7</option>
                                             <option value="GRADE 8">GRADE 8</option>
                                             <option value="GRADE 9">GRADE 9</option>
                                          
                                          </select>
                                       </div>
                                    </td>
                                    <td>
                                       <div class="form-group">
                                          <label for="inputStatus">.</label>
                                          <button class="btn btn-success btn-sm form-control" id="filterclass"> <i class="fa fa-funnel"></i> Filter
                                          </button>
                                       </div>
                                    </td>
                                 </tr>
                              </tbody>
                           </table>
                        </form>
                     </div>
                     <div class="row">
                        <div class="col-md-10">
                           <div class="divexamresult table-responsive">
                              <?php
                                 $ex=$_SESSION['exa'];
                                 $kla=$_SESSION['kla']; 
                                 
                                 $query=mysqli_query($con,"select * from Exam where id='$ex'");
                                 while($row=mysqli_fetch_array($query))
                                 {
                                 $ename=$row["Title"];
                                 $sd=$row["StartDate"];
                                 $ed=$row["EndDate"];
                                 }
                                 ?> 
                              <input type="hidden" value="<?php echo $ename.' '.$kla ?>" id="txtexamname" />
                              <label>Results for: <strong>Exam -> <span class="badge bg-primary"><?php echo $ename; ?></span>| Class -> <?php  echo $kla; ?> | <span class="badge bg-warning"><?php echo $sd.' - '.$ed; ?></span></strong></label>
                              <?php
                                 if($kla=='GRADE 1' || $kla=='GRADE 2' || $kla=='GRADE 3')
                                  {
                                    include("GR13.php");   
                                  }else if($kla=='GRADE 4' || $kla=='GRADE 5' || $kla=='GRADE 6')
                                  {
                                    include("GR46.php");
                                  }else if($kla=='GRADE 7' || $kla=='GRADE 8' || $kla=='GRADE 9')
                                  {
                                     include("GR79.php"); 
                                  }
                                  else
                                  {
                                   echo 'No results to display';
                                  }
                                  ?>
                           </div>
                        </div>
                        <div class="col-md-2">
                           <table class="table">
                              <tr>
                                 <td><strong class="text-danger">Rubrics</strong></td>
                                 <td><strong class="text-danger">Points</strong></td>
                              </tr>
                              <tr>
                                 <td>Exceeding expectations (E.E)</td>
                                 <td><span class="badge bg-primary">4</span></td>
                              </tr>
                              <tr>
                                 <td>
                                    Meeting Expectations (M.E) 
                                 </td>
                                 <td> <span class="badge bg-success">3</span></td>
                              </tr>
                              <tr>
                                 <td>Approaching Expectations (A.E) </td>
                                 <td> <span class="badge bg-warning">2</span></td>
                              </tr>
                              <tr>
                                 <td>Below Expectations (B.E)  </td>
                                 <td>  <span class="badge bg-danger">1</span></td>
                              </tr>
                           </table>
                        </div>
                       
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </section>
</div>