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


include 'dbc.php';

$userid=$_SESSION["userid"];
$today=date("Y-m-d");
$month = date("m",strtotime($today));
		$year = date("Y",strtotime($today));
		 $month_name = date("F", mktime(0, 0, 0, $month, 10));
		
		
		 $my=$month_name . " " . $year;
		 
		
?>
<!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="breadcrumbs">
            <div class="col-sm-6">
                <div class="page-header float-left">
                    <div class="page-title">
                        <h1><? echo "" . $_SESSION["userid"]; ?></h1>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="page-header float-right">
                    <div class="page-title">
                        <ol class="breadcrumb text-right">
                            <li class="active"><? echo "" . $_SESSION["username"]; ?></li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>

        <div class="content mt-3">

           


          
<div class="col-md-14">
                        <div class="card">
                            <div class="card-header">
                                <strong class="card-title"> Student Attendance Report</strong>
                            </div>
                            <div class="card-body">
							<?php

include 'dbc.php';

$class_name=$_POST["class_name"];
$cls_sec=$_POST["cls_sec"];
$adate=$_POST["adate"];
$userid=$_SESSION["userid"];

$sql11 = "SELECT * FROM attendence where class_name='$class_name' and date = '$adate' and user_id='$userid' order by cls_sec,status,rollno";
$result11=$conn->query($sql11);
?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
echo "<th > Date </th>";
echo "<th > Time </th>";
echo "<th > Student Roll No </th>";
echo "<th > Student Name </th>";
echo "<th > Father Name </th>";
echo "<th > Class Name </th>";
echo "<th > Cell No </th>";
echo "<th > Attendance Status </th>";


echo "</tr>";
?>
                                    </thead>
									
                                    <tbody>
									<?php
                                       while($ppp = $result11->fetch_assoc())
 
  {
   $rollno = $ppp['rollno'];	
  echo "<tr>";
    echo "<td >"  .$ppp["date"] . "</td>" ;
	 echo "<td >"  .$ppp["ttime"] . "</td>" ;
   
   echo "<td >"  .$ppp["rollno"] . "</td>" ;
   echo "<td >"  .$ppp["stdname"] . "</td>" ;
   echo "<td >"  .$ppp["fname"] . "</td>" ;
    echo "<td >"  .$ppp["class_name"] . "</td>" ;
    echo "<td >"  .$ppp["cell"] . "</td>" ;
	   
   echo "<td >"  .$ppp["status"] . "</td>" ;
 
	 
     echo"<th> <a href ='Attendance_Report_Monthly.php?rollno=$rollno'>"?><button type="button" class="btn btn-primary">  Monthly Report</button><?php "</a>";

   echo "</tr>";
    $cnt=$cnt + 1;
   }
   echo "<tr>";
 echo "<th  colspan=8>" ."Toatl  Attendance   :     " .$cnt . "</th>";
 echo "</tr>";
 
   echo "</table>";


	
  ?>
                                       
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
            


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

    <!-- Right Panel -->

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

</body>

</html>
<?php
}

?>