<?php 
include ("kfunctions.php");
adminall("overadmin","priaccount","secaccount");
?>
<html>
<head>
<?php kheader(); ?>

<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 -->
                
                <!-- /.row -->

                <div class="row">
                    <div class="col-lg-12">
                        <div class="panel panel-default">
                            <div class="panel-body">
                            
                            
<div class="panel panel-green"><!--Initiative-->
<div class="panel-heading"><h3 class="panel-title">Enter the fields below to filter those below amount</h3></div>
<div class="panel-body">

    <form action='owing.php' method='post'>
        <div class='col-lg-2'>
<select  class="form-control" name="level" required>
<option value=">">More than</option>
<option value="<">Less than</option>
</select>
        </div>
  <div class='col-lg-2'>      
<input type='text' name='amount' class='form-control' placeholder='Set amount' required>
</div>

<div class='col-lg-2'>
<select name="feetype" class="form-control" required>
<option value="ownfee">Fees</option>
<?php
include ("connect.php");

$result = $dbh->query("select * from scrap where type='requirement'");
$row = $result->fetchObject();

do{
echo "
<option value='".$row->item."'>".$row->item2."</option>";
}while($row = $result->fetchObject());
?>
</select>  
</div>
<div class='col-lg-2'>
<select name="schoolyear" class="form-control" required>
<?php
$result2 = $dbh->query("select * from scrap where type='ya'");
$row2 = $result2->fetchObject();

do{
echo "<option value='".$row2->item."'>".$row2->item2."</option>";
}while($row2 = $result2->fetchObject());
?>

                  </select>
    </div>

<div class='col-lg-2'>
<select class="form-control" name="term" required>
<option value="">Term</option>
<option value="t1">Term 1 </option>
<option value="t2">Term 2 </option>
<option value="t3">Term 3 </option>
<option value="t4">All Term</option>
</select>
</div>

                  <div class='col-lg-2'>
<select class="form-control" name="schoolclass" required>
<option value="">Class</option> 
<?php
$role = $_SESSION["role"];

if($role=="priaccount"){
    $clas2 = "type='clas' or type='clasall'";

}elseif($role=="secaccount"){

$clas2 = "type='secclas' or type='secclasall'";

}elseif($role=="overadmin"){

$clas2 = "type='clas' or type='secclas'";
}

$result3 = $dbh->query("select * from scrap where $clas2");
$row3 = $result3->fetchObject();

do{
echo "<option value='".$row3->item."'>".$row3->item2."</option>";
}while($row3 = $result3->fetchObject());
?></select>
                  </div>
<div class='col-lg-2'>
<input type='submit' class='btn btn-sm btn-primary' value='Filter'>
</div>
</form>

</div></div>

                            </div> </div>
                    </div>
                </div>
                <!-- /.row -->

               

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

        </div>
        <!-- /#page-wrapper -->
<?php useractivity("on page","3"); ?>
    </div>
    <!-- /#wrapper -->

    <!-- 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>
    <script type="text/javascript" src="js/jquery-1.8.3.min.js" charset="UTF-8"></script>
</body>

</html>