<?php include ("kfunctions.php");
//role("dos,hmp");
?>
<html>
<head>
<?php kheader(); ?>
<?php 
require_once("connect.php");

?>
<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">
<div class='panel panel-primary'><!--Initiative-->
<div class='panel-heading'><h3 class='panel-title'>List of class and their subjects</h3></div>
<div class='panel-body'>
<table class='table table-bordered table-hover table-striped sortable'>
<tr>
    <th width='2%'>No</th>
    <th width='30%'>Student name</th>
    <th>Subjects</th>
</tr>
<?php
include("connect.php");
$result_comp=$dbh->query("select * from compulsory where schoolclass>=21 && schoolclass<25 ");
$row_comp=$result_comp->fetchObject();
$count_comp=$result_comp->rowCount();

if($count_comp){
$x=1;
    do{
$schoolclass=$row_comp->schoolclass;
include("class.php");
echo "
<tr>
<td>".$x++."</td>
<td title='Click to edit student subjects'><a href='editsubjectso.php?schoolclass=".$row_comp->schoolclass."'>".$daclass."</a></td>
<td>";
$result_scrap=$dbh->query("select * from scrap where type='prisubps' or type='secsub' or type='prisubp'");
               $row_scrap=$result_scrap->fetchObject();
               $count_scrap=$result_scrap->rowCount();                               

if($count_scrap>0){
  do{
$fsub=$row_scrap->item."marks";
$result_class=$dbh->query("select * from compulsory where $fsub='0' and schoolclass='$row_comp->schoolclass'");
$count_class=$result_class->rowCount();

if($count_class>0){echo $row_scrap->item2.", ";}

}while($row_scrap=$result_scrap->fetchObject());
}else{
echo "
<tr> 
<td align='center' colspan='3'><b><i>There is NO match</i></b></td>
</tr>";
}
echo "
</td>
</tr>";
}while($row_comp=$result_comp->fetchObject());
}else{
echo "<tr>
<td align='center' colspan='3'><b><i>There is NO match. </i></b></td>
</tr>";
}   
?>
</table>
</div></div>

</div>

</div>

</form>

                            </div> 

                <!-- /.row -->

               

            </div>
            <!-- /.container-fluid -->
<?php useractivity("on page", "56"); ?>
        </div>
        <!-- /#page-wrapper -->

    </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>
