<?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';
$username=$_SESSION["username"];
$current_file_name = basename($_SERVER['PHP_SELF']);
$sql = "SELECT * FROM adduser where feedisc2 = '$current_file_name' and uname = '$username'";
$result=$conn->query($sql);
$row = $result->fetch_assoc();
$status=$row['feedisc3'] ;

if ($status =="")
{
echo "You are not Authorized This Page <a href='maindashboard.php'>Back </a> ";
}
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 -->

    <?php include("includes/menu.php") ?><!-- /#left-panel -->

    <!-- Left Panel -->

    <!-- Right Panel -->

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

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

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

        </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-12">
                        <div class="card">
                            <div class="card-header">
                                <strong class="card-title">Genrate DateSheet</strong>
                            </div>
                            <div class="card-body">
							<?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$sql = "SELECT * FROM addsubject where user_id='$userid' order by class_name";
$result=$conn->query($sql);
?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
echo "<th > Class Name </th>";
echo "<th > Subject 1 </th>";
echo "<th > Subject 2 </th>";
echo "<th > Subject 3 </th>";
echo "<th > Subject 4 </th>";
echo "<th > Subject 5 </th>";
echo "<th > Subject 6 </th>";
echo "<th > Subject 7 </th>";
echo "<th > Subject 8 </th>";
echo "<th > Subject 9 </th>";
echo "<th > Subject 10 </th>";


echo "</tr>";
?>
                                    </thead>
									
                                    <tbody>
									<?php
                                       while($row = $result->fetch_assoc())
 
  {
  $id = $row['id'];
   $class_name = $row['class_name'];	
   echo "<tr>";
echo "<td>" .$row['class_name'] . "</td>";
echo "<td>" .$row['sub1'] . "</td>";
 echo "<td>" .$row['sub2'] .  "</td>";
  echo "<td>" .$row['sub3'] .  "</td>";
 echo "<td>" .$row['sub4'] .  "</td>";
 echo "<td>" .$row['sub5'] .  "</td>";
 echo "<td>" .$row['sub6'] .  "</td>";
 echo "<td>" .$row['sub7'] .  "</td>";
  echo "<td>" .$row['sub8'] .  "</td>";
   echo "<td>" .$row['sub9'] .  "</td>";
    echo "<td>" .$row['sub10'] .  "</td>";


		 ?>
		 
		  
		 <?php
		  echo"<th> <a href ='Genrate_Student_Datesheet.php?id=$id'>"?><button type="button" class="btn btn-primary">  Genrate DateSheet </button><?php "</a>";
		   echo"<th> <a href ='Print_Rollno_Slip.php?id=$id'>"?><button type="button" class="btn btn-primary">  Print Rollno Slip </button><?php "</a>";
		    echo"<th> <a href ='Open_Datesheet.php?class_name=$class_name'>"?><button type="button" class="btn btn-primary">  Print DateSheet </button><?php "</a>";
		    echo"<th> <a href ='Del_Student_Datesheet.php?id=$id'>"?><button type="button" class="btn btn-primary">  Del DateSheet </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
}
}
?>