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


?>
<!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-->

        

        <div class="content mt-3">

           


          
<div class="col-md-12">
                        <div class="card">
                            
                            <div class="card-body">
							<?php

include 'dbc.php';

$term=$_POST["term"];
$month_name=$_POST["month_name"];
$sess1=$_POST["sess1"];
$class_name=$_POST["class_name"];
$userid=$_SESSION["userid"];

$sql1 = "SELECT * FROM admission where  class_name='$class_name' and status='Active' and user_id='$userid' order by adm_no";
$result1=$conn->query($sql1);
while($row1 = $result1->fetch_assoc())


  {
  $std_rollno=$row1['adm_no'] ;
$father_name=$row1['fname'] ;
$std_name=$row1['std_name'] ;

$sql = "SELECT * FROM datesheet where  term='$term' and sess1='$sess1' and class_name='$class_name' and month_name='$month_name' and user_id='$userid'";
$result=$conn->query($sql);
$row = $result->fetch_assoc();
$sub1=$row["sub1"];
$sub2=$row["sub2"];
$sub3=$row["sub3"];
$sub4=$row["sub4"];
$sub5=$row["sub5"];
$sub6=$row["sub6"];
$sub7=$row["sub7"];
$sub8=$row["sub8"];
$sub9=$row["sub9"];
$sub10=$row["sub10"];
$ddate1=$row['ddate1'] ;
$ddate2=$row['ddate2'] ;
$ddate3=$row['ddate3'] ;
$ddate4=$row['ddate4'] ;
$ddate5=$row['ddate5'] ;
$ddate6=$row['ddate6'] ;
$ddate7=$row['ddate7'] ;
$ddate8=$row['ddate8'] ;
$ddate9=$row['ddate9'] ;
$ddate10=$row['ddate10'] ;
$dday1=$row["dday1"];
$dday2=$row["dday2"];
$dday3=$row["dday3"];
$dday4=$row["dday4"];
$dday5=$row["dday5"];
$dday6=$row["dday6"];
$dday7=$row["dday7"];
$dday8=$row["dday8"];
$dday9=$row["dday9"];
$dday10=$row["dday10"];
$dtime1=$row["dtime1"];
$dtime2=$row["dtime2"];
$dtime3=$row["dtime3"];
$dtime4=$row["dtime4"];
$dtime5=$row["dtime5"];
$dtime6=$row["dtime6"];
$dtime7=$row["dtime7"];
$dtime8=$row["dtime8"];
$dtime9=$row["dtime9"];
$dtime10=$row["dtime10"];



   ?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
								<div class="card-header">
								<div class="page-title">
								<strong class="card-title"> <center> <img src="logo1.jpg" align="middle" /></center></strong>
                        <h2><center><? echo "" . $_SESSION["userid"]; ?></center></h2>
                    </div>
                                <strong class="card-title"> <center>Student Rollno Slip</center></strong>
                            </div>
                                    <thead>
									<?php
									echo "<tr>";
echo "<th colspan=2>Adm No </th>";
echo "<th colspan=2>$std_rollno </th>";
echo "</tr>";
echo "<tr>";
echo "<th colspan=2>Student Name </th>";
echo "<th colspan=2>$std_name </th>";
echo "</tr>";
echo "<tr>";
echo "<th colspan=2>Father Name </th>";
echo "<th colspan=2>$father_name </th>";
echo "</tr>";
 echo "<tr>";
 echo "<th colspan=2>Exam Term </th>";
echo "<th colspan=2>$term </th>";
echo "</tr>";
echo "<tr>";
echo "<th colspan=2>Month </th>";
echo "<th colspan=2>$month_name </th>";
echo "</tr>";
echo "<tr>";
echo "<th colspan=2>Session </th>";
echo "<th colspan=2>$sess1 </th>";
echo "</tr>";
echo "<tr>";
echo "<th colspan=2>Class </th>";
echo "<th colspan=2>$class_name </th>";
echo "</tr>";


 echo "<tr>";
   echo "<th colspan=4 align=center bgcolor=#0099FF><center>Datesheet Details</center> </th>";
   
echo "</tr>";
echo "<tr>";
echo "<th>Subjects Name </th>";
echo "<th>Date </th>";
echo "<th>Day </th>";
echo "<th>Time</th>";
echo "</tr>";
   echo "<tr>";
   echo "<th>" . $sub1 . "</th>";
echo "<td>" .$ddate1 . "</td>";
echo "<td>" .$dday1 . "</td>";
echo "<td>" .$dtime1 . "</td>";
echo "</tr>";
 echo "<tr>";
   echo "<th>" . $sub2 . "</th>";
echo "<td>" .$ddate2 . "</td>";
echo "<td>" .$dday2 . "</td>";
echo "<td>" .$dtime2 . "</td>";
echo "</tr>";
 echo "<tr>";
   echo "<th>" . $sub3 . "</th>";
echo "<td>" .$ddate3 . "</td>";
echo "<td>" .$dday3 . "</td>";
echo "<td>" .$dtime3 . "</td>";
echo "</tr>";
 echo "<tr>";
   echo "<th>" . $sub4 . "</th>";
echo "<td>" .$ddate4 . "</td>";
echo "<td>" .$dday4 . "</td>";
echo "<td>" .$dtime4 . "</td>";
echo "</tr>";
 echo "<tr>";
   echo "<th>" . $sub5 . "</th>";
echo "<td>" .$ddate5 . "</td>";
echo "<td>" .$dday5 . "</td>";
echo "<td>" .$dtime5 . "</td>";
echo "</tr>";
 echo "<tr>";
   echo "<th>" . $sub6 . "</th>";
echo "<td>" .$ddate6 . "</td>";
echo "<td>" .$dday6 . "</td>";
echo "<td>" .$dtime6 . "</td>";
echo "</tr>";
 echo "<tr>";
   echo "<th>" . $sub7 . "</th>";
echo "<td>" .$ddate7 . "</td>";
echo "<td>" .$dday7 . "</td>";
echo "<td>" .$dtime7 . "</td>";
echo "</tr>";
 echo "<tr>";
   echo "<th>" . $sub8 . "</th>";
echo "<td>" .$ddate8 . "</td>";
echo "<td>" .$dday8 . "</td>";
echo "<td>" .$dtime8 . "</td>";
echo "</tr>";
  echo "<tr>";
   echo "<th>" . $sub9 . "</th>";
echo "<td>" .$ddate9 . "</td>";
echo "<td>" .$dday9 . "</td>";
echo "<td>" .$dtime9 . "</td>";
echo "</tr>";
  echo "<tr>";
   echo "<th>" . $sub10 . "</th>";
echo "<td>" .$ddate10 . "</td>";
echo "<td>" .$dday10 . "</td>";
echo "<td>" .$dtime10 . "</td>";
echo "</tr>";
  
  
 echo "<tr>";
 
echo "<th colspan=4  align=left bgcolor=#0099FF><br><br> Principal Signature______________ </th>";
echo "</tr>";
  }
  
  ?>
                                       
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
            


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

    <!-- Right Panel -->

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

</body>

</html>
<?php
}
?>