<?php
include "../include/config.php";
session_start();
$userlogin=$_SESSION['fullname'];
$school=$_SESSION['school'];
if (isset($_SESSION['studentid'])){?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
      <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300&family=Source+Sans+Pro:wght@300&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
   <link rel="icon" href="favicon.png" type="image/png">
    <meta name="theme-color" content="">
      <script src='https://kit.fontawesome.com/a076d05399.js' crossorigin='anonymous'></script>
      <script src='https://kit.fontawesome.com/a076d05399.js' crossorigin='anonymous'></script>
      <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">

</head>
<style>
    body{
        padding: 0px;
        margin:0px;
        
  
  width:100%;
  background:#556DCF45;
    }
    .iterm{
        justify-content: center;
        display: flex;
        flex-wrap: wrap;
        margin-top:10px;
        margin-top: 230px;
        color: white;
        overflow: scroll;
        height:100%;
    }
    .iterm_box{
        width:40%;
        height :25%;
        box-shadow:rgba(99, 99, 99, 0.4) 0px 2px 8px 0px;
        padding: 5px;
        text-align: center;
        border-radius: 5px;
        margin: 5px;
        background: white;
    }
    
    .header{
        background:#556DCF url(images/1.png);
        background-size:cover;
        background-blend-mode: darken;
        height: 220px;
        margin-top: 10px;
        border-radius: 0px 0px 30px 30px;
        
        color: white;
        padding: px;
        text-align: center ;
    
      
        
    }

    .header{
      position: fixed;
      width:100%;
    }
    part{
      margin-top: -50px;
      position: absolute;
      background: white;
      width:93%;
      height:210px;
      top: 60px;
      left: 50%;
      transform: translate(-50%);
      color: gray;
      display: block;
      border-radius: 6px;
    }
.header img{
  width:80px;
  height: 80px;
  border-radius: 50%;
  border: 5px solid white;
  
}
    
    .iterm_box img{
      
    }
    nav i{
      float :;
      color: white;
    }
    .iterm i{
      font-size: 30px;
      background: #556DCF;
      padding: 9px;
      border-radius: 5px;
    }
    .iterm_box p{
      font-size: 13px;
      margin-top: 5px;
      color: #3F4044;
      margin-bottom: 10px;
    }
    .btn{
      background: #556DCF;
      border:none;
      border-radius:2px;
      padding: 15px;
      margin: 10px;
      color: white;
    }
    .dash{
      color: white;
      font-weight: 900px;
      text-align : center ;
    }
    .bnn{
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%,-50%);
      display: block;
      text-align: center ;
    }
    
</style>
<body>
<?php include "../include/nav.php";?>

<div class="bnn">
<?php

if (isset($_GET['error'])) {?>
<div class="alert alert-warning" style="text-align:center;">
<p><i class="fa fa-warning">  </i> <?php echo $_GET['error'];?></p>
</div>
<?php
}
?>
    <?php

if (isset($_GET['success'])) {?>
<div class="alert alert-success" style="text-align:center;">
<p><i class="fa fa-check">  </i> <?php echo $_GET['success'];?></p>
</div>
<?php
}
?>
  <a class="btn" data-toggle="modal" data-target="#exampleModalCenter"><i class="fa fa-database"></i> Synchronize</a>
  <a class="btn" data-toggle="modal" data-target="#exampleModalCenter2"><i class="fa fa-edit"></i> Enter Results</a>
</div>


</body>
</html>



<!-- sycn -->
<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLongTitle">Synchronize</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
         <form style="background:white; border:none;padding:15px; margin-top:5px; margin-bottom:5px; border-radius:4px;" class=" bg" action="bulkview.php" method="post">
  <h6> <I class="fa fa-edit"> </I> Fill in all required field</h6>
  <hr>
 <div class="row">
 <div class="col-6" style="background:; color:; margin-top:10px">  
 <span style="margin-bottom:-5px">course <span style="color:red;">*</span></span>
<select style="margin-top:-5px; color: #7c828c; " name="course" id="" class="form-control">
 <option value="1">course</option>
<?php
$subject=mysqli_query($conn,"select *from course order by id desc");
while($row=mysqli_fetch_array($subject)){
?>
<option value="<?php echo $row['course'];?>"><?php echo $row['course'];?> </option>
<?php
}
?>

</select>
 </div>


<div class="col-6"  style="background:; color:; margin-top:10px"> 
<span style="margin-bottom:-5px">Year <span style="color:red;">*</span> </span>
<select style="margin-top:-5px;color: #7c828c;"  name="year" id="" class="form-control">
 <option value="1">Year</option>
  <?php
  $query=mysqli_query($conn,"select *from year order by id desc");
  while($row=mysqli_fetch_array($query)){?>
  
 

<option value="<?php echo $row['year'];?>"><?php echo $row['year'];?></option>
<?php
  }
?>
</select> 
 </div>

<div class="col-6" style="background:; color:; margin-top:10px"> 
<span style="margin-bottom:-5px">Intake <span style="color:red;">*</span> </span>
<select style="margin-top:-5px; color: #7c828c;"  name="intake" id="" class="form-control">
 <option value="1">Intake</option>
  <?php
  $query=mysqli_query($conn,"select *from intake order by id desc");
  while($row=mysqli_fetch_array($query)){?>
  
 

<option value="<?php echo $row['intake'];?>"><?php echo $row['intake'];?></option>
<?php
  }
?>
</select> 
</div>


<div class="col-6"  style="background:; color:; margin-top:10px"> 
<span style="margin-bottom:-5px">Semester<span style="color:red;">*</span> </span>
<select   style="margin-top:-5px;color: #7c828c;" name="term" id="" class="form-control">
  <option value="">--Semester-- </option>
<option value="1">1</option>
<option value="2">2</option>
</select> 
</div>

<div class="col-12" style="background:; color:; margin-top:10px"> 

<span style="margin-bottom:-5px">Program<span style="color:red;">*</span> </span>

<select style="margin-top:-5px; color: #7c828c;"  name="program" id="" class="form-control">
 <option value="1">Program</option>
  <?php
  $query=mysqli_query($conn,"select *from programs order by id desc");
  while($row=mysqli_fetch_array($query)){?>
  
 

<option value="<?php echo $row['program'];?>"><?php echo $row['program'];?></option>
<?php
  }
?>
</select> 
</div>




 <div class="col-6" style="background:; color:; margin-top:10px">
<input style="border:none;background:#556dcf4;padding:10px; color:white;" type="submit" name="score" value="Sync Now" class="btn "> 
</div>
  
</div>
 
 </form>
      </div>

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



<!-- filter class -->

<div class="modal fade" id="exampleModalCenter2" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">

  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLongTitle">Filter Students</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
       <form style="background:white; border:none;padding:15px; margin-top:5px; margin-bottom:5px; border-radius:4px;" class=" bg" action="results.php" method="post">
  <h6> <I class="fa fa-edit"> </I> Fill in all required field</h6>
  <hr>
 <div class="row">
 <div class="col-6" style="background:; color:; margin-top:10px">  
 <span style="margin-bottom:-5px">course <span style="color:red;">*</span></span>
<select style="margin-top:-5px; color: #7c828c; " name="course" id="" class="form-control">
 <option value="1">course</option>
<?php
$subject=mysqli_query($conn,"select *from course order by id desc");
while($row=mysqli_fetch_array($subject)){
?>
<option value="<?php echo $row['course'];?>"><?php echo $row['course'];?> </option>
<?php
}
?>

</select>
 </div>


<div class="col-6"  style="background:; color:; margin-top:10px"> 
<span style="margin-bottom:-5px">Year <span style="color:red;">*</span> </span>
<select style="margin-top:-5px;color: #7c828c;"  name="year" id="" class="form-control">
 <option value="1">Year</option>
  <?php
  $query=mysqli_query($conn,"select *from year order by id desc");
  while($row=mysqli_fetch_array($query)){?>
  
 

<option value="<?php echo $row['year'];?>"><?php echo $row['year'];?></option>
<?php
  }
?>
</select> 
 </div>

<div class="col-6" style="background:; color:; margin-top:10px"> 
<span style="margin-bottom:-5px">Intake <span style="color:red;">*</span> </span>
<select style="margin-top:-5px; color: #7c828c;"  name="intake" id="" class="form-control">
 <option value="1">Intake</option>
  <?php
  $query=mysqli_query($conn,"select *from intake order by id desc");
  while($row=mysqli_fetch_array($query)){?>
  
 

<option value="<?php echo $row['intake'];?>"><?php echo $row['intake'];?></option>
<?php
  }
?>
</select> 
</div>


<div class="col-6"  style="background:; color:; margin-top:10px"> 
<span style="margin-bottom:-5px">Semester <span style="color:red;">*</span> </span>
<select   style="margin-top:-5px;color: #7c828c;" name="term" id="" class="form-control">
  <option value="">--Semester-- </option>
<option value="1">1</option>
<option value="2">2</option>
</select> 
</div>

<div class="col-12" style="background:; color:; margin-top:10px"> 

<span style="margin-bottom:-5px">Program<span style="color:red;">*</span> </span>

<select style="margin-top:-5px; color: #7c828c;"  name="program" id="" class="form-control">
 <option value="1">Program</option>
  <?php
  $query=mysqli_query($conn,"select *from programs order by id desc");
  while($row=mysqli_fetch_array($query)){?>
  
 

<option value="<?php echo $row['program'];?>"><?php echo $row['program'];?></option>
<?php
  }
?>
</select> 
</div>




 
</div>
 
 
      </div>
      <div class="modal-footer">

        <button type="submit" name="marks" type="button" class="btn btn-primary">       <i class="fa fa-search"></i> Filter Students</button>
        </form>
      </div>
    </div>
  </div>
</div>
<?php

}else {

  header("location:../index.php");
}
?>