<?php include ("kfunctions.php");
//include ("seredirect.php");
?>
<html>
<head>
<?php kheader(); ?>
<?php 
require_once("connect.php");
$result=$dbh->query("select * from scrap");

?>
<link href="css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">

<script src="js/sorttable.js"></script>
</head>
<body>

    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <!-- Brand and toggle get grouped for better mobile display -->
            <?php ktopbar(); ?>
            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
            <?php kleftbar(); ?>
            <!-- /.navbar-collapse -->
        </nav>

        <div id="page-wrapper">

            <div class="container-fluid">

                <!-- Page Heading -->
                <div class="row">
                    <div class="col-lg-12">
                        <h1 class="page-header">
                           Mark entry summary
                        </h1>
                        
                    </div>
                </div>
                <!-- /.row -->

                <div class="row">
<form method='post'>
<div class='col-lg-2'>
<select class='form-control' name='schoolclass'>
<option value=''>Class</option>
<?php 
include("connect.php");
$result_scrap=$dbh->prepare("select * from scrap where type='secclas' and item>24");
$result_scrap->execute();
$row_scrap=$result_scrap->fetchObject();
$count_scrap=$result_scrap->rowCount();

if($count_scrap>0){
do{
echo "<option value='".$row_scrap->item."'>".$row_scrap->item2."</option>";
}while($row_scrap=$result_scrap->fetchObject());
}else{
    echo "<option value=''>Please contact your IT department. </option>";
}
?>
</select>
</div>
<div class='col-lg-2'>
<select class='form-control' name='stream'>
<option value=''>Stream</option>
<?php 
include("connect.php");
$result_scrap=$dbh->prepare("select * from scrap where type='astream'");
$result_scrap->execute();
$row_scrap=$result_scrap->fetchObject();
$count_scrap=$result_scrap->rowCount();

if($count_scrap>0){
do{
echo "<option value='".$row_scrap->item."'>".$row_scrap->item2."</option>";
}while($row_scrap=$result_scrap->fetchObject());
}else{
    echo "<option value=''>Please contact your IT department. </option>";
}
?>
</select>
</div>
<div class='col-lg-2'>
<select class='form-control' name='examset'>
<option value=''>Set</option>
<?php 
include("connect.php");
$result_exam=$dbh->prepare("select * from examsets where setid!=''");
$result_exam->execute();
$row_exam=$result_exam->fetchObject();
$count_exam=$result_exam->rowCount();

if($count_exam>0){
do{
echo "<option value='".$row_exam->setid."'>".$row_exam->setname."</option>";
}while($row_exam=$result_exam->fetchObject());
}else{
    echo "<option value=''>So far, there is NO set. </option>";
}
?>
</select>
</div>   
<input type='submit' class='btn btn-sm btn-primary' name='filterz' value='Filter'>
</form>
<div class='col-lg-12'><br></div>
<div class='col-lg-12'>                         
<div class="panel panel-primary"><!--Initiative-->
<div class="panel-heading"><h3 class="panel-title">Summary for mark entry - A level</h3></div>
<div class="panel-body">
<?php
if(isset($_POST["filterz"])){
$schoolclass=$_POST["schoolclass"];
$stream=$_POST["stream"];
$examset=$_POST["examset"];


include("marksummary_a.php");

// $count_rivex." - ".$count_rivenx."<br>";



}

 ?>


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

            </div>
            <!-- /.container-fluid -->

       
    <!-- jQuery -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>
</body>

</html>
