<?php
session_start();
if($_SESSION["username"]=="")
{
 	echo "You are not Logged in Please <a href='index.html'>Sign in </a> First ";
}
else
{
$term=$_POST["term"];
$month_name=$_POST["month_name"];
$sess1=$_POST["sess1"];
$class_name=$_POST["class_name"];
$cls_sec=$_POST["cls_sec"];
$userid=$_SESSION["userid"];

?>
<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->

<head>
   <?php include("includes/header.php") ?>
</head>

<body>


    <!-- Left Panel -->

   <!-- /#left-panel -->

    <!-- Left Panel -->

    <!-- Right Panel -->

    <div id="right-panel" class="right-panel">

        <!-- Header-->
        <header id="header" class="header">

            

        </header><!-- /header -->
        <!-- Header-->


        <div class="content mt-3">

           


          
<div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                              <strong class="card-title"> <center> <img src="logo1.jpg" align="middle" /></center></strong>
                                <strong class="card-title"> <center> <h1><? echo "" . $_SESSION["userid"]; ?></h1></center></strong>
								 <strong class="card-title"><center>Consolidated Student Test Report</center></strong>
								  <strong class="card-title"><center><? echo $class_name .":" . $cls_sec; ?></center></strong>
								   <strong class="card-title"><center><? echo $sess1; ?></center></strong>
                            </div>
                            <div class="card-body">
							<?php

include 'dbc.php';



$sql3 = "SELECT * FROM admission where class_name='$class_name' and cls_sec='$cls_sec' and status='Active' and user_id='$userid' order by adm_no";
$result3=$conn->query($sql3);
while($row3 = $result3->fetch_assoc())
 
  {
$std_rollno=$row3['adm_no'] ;
$std_name=$row3['std_name'] ;
$fname=$row3['fname'] ;

$sql = "SELECT * FROM mtest where sess1='$sess1' and std_rollno='$std_rollno' and class_name='$class_name' and cls_sec='$cls_sec' and user_id='$userid' order by std_rollno";
$result=$conn->query($sql);


?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
								
                                       echo "<tr>";
echo "<th bgcolor=#0099FF><center> $std_rollno </center> </th>";
echo "<th colspan=4 bgcolor=#0099FF><center> $std_name</center> </th>";
echo "<th colspan=3 bgcolor=#0099FF><center> $fname</center> </th>";
echo "</tr>";
echo "<tr>";
echo "<th bgcolor=#000066><font face=arial size=3 color=white> Test Date </font></th>";
echo "<th bgcolor=#000066><font face=arial size=3 color=white> Term Name </font></th>";

echo "<th bgcolor=#000066><font face=arial size=3 color=white> Total Mark</font></th>";
echo "<th bgcolor=#000066><font face=arial size=3 color=white> Obt Mark</font></th>";
echo "<th bgcolor=#000066><font face=arial size=3 color=white> Per%</font></th>";
echo "<th bgcolor=#000066><font face=arial size=3 color=white> Status</font></th>";
echo "<th bgcolor=#000066><font face=arial size=3 color=white> Grade</font></th>";
echo "<th bgcolor=#000066><font face=arial size=3 color=white> Remarks</font></th>";
echo "</tr>";


echo "</tr>";
?>
                                    </thead>
									
                                    <tbody>
									<?php
                                       while($row = $result->fetch_assoc())
 
  {
  $std_rollno = $row['std_rollno'];
  $std_name = $row['std_name'];
  $father_name = $row['father_name'];
  $sess1 = $row['sess1'];	
  $class_name = $row['class_name'];	
  
  
   echo "<tr>";
   echo "<td>" .$row['date'] . "</td>";
    echo "<td>" .$row['term'] . "</td>";


echo "<td>" .$row['totalmark'] . "</td>";
echo "<td>" .$row['obtmark'] . "</td>";
echo "<td>" .$row['per'] . "</td>";
echo "<td>" .$row['status'] . "</td>";
echo "<td>" .$row['grade'] . "</td>";
echo "<td>" .$row['remarks'] . "</td>";
		 
		  
	
  echo "</tr>";

  }
 
echo "<tr>";
 echo"<th> <a href ='Print_Test_Card_Consol_Save_Ind.php?std_rollno=$std_rollno&sess1=$sess1&std_name=$std_name&father_name=$father_name&class_name=$class_name' target=_blank>"?><button type="button" class="btn btn-success">  Open Test </button><?php "</a>";
 
echo "</tr>";
   
  }
  
  ?>
                                       
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
            


        </div> <!-- .content -->
    </div><!-- /#right-panel -->

    <!-- Right Panel -->

   <?php include("includes/footermenu.php") ?>

</body>

</html>
<?php
}
?>