<?php
session_start();
if($_SESSION["username"]=="")
{
 	echo "You are not Logged in Please <a href='index.html'>Sign in </a> First ";
}
else
{
date_default_timezone_set("Asia/Karachi");
$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;
$userid=$_SESSION["userid"];
include 'dbc.php';
$sql1="Select * from teacher";
$result1 = $conn->query($sql1);
$sql2="Select * from addclass";
$result2 = $conn->query($sql2);
$sql3="Select * from tt_days";
$result3 = $conn->query($sql3);
$sql4="Select * from tt_periods";
$result4 = $conn->query($sql4);
$sql5="Select * from tt_subject";
$result5 = $conn->query($sql5);

?>
<!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="animated fadeIn">
                <div class="row">
<div class="col-lg-4">
                        <div class="card">
                            <div class="card-header"><strong>Time Table Day wise</strong><small> Details Report</small></div>
                            <div class="card-body card-block">
							<form action="timetable.php" method="post" enctype="multipart/form-data" class="form-group">
                                                    </div>
													<div class="card-footer">
                                                        <button type="submit" class="btn btn-primary btn-sm">
                                                            <i class="fa fa-dot-circle-o"></i>Show Report
                                                        </button>
                                                       
                                                    </div>
													
													</form>
                                                </div>
												</div>
	<div class="col-lg-4">											
												<div class="card">
                            <div class="card-header"><strong>Time Table Slot wise </strong><small> Details Report</small></div>
                            <div class="card-body card-block">
							<form action="timetable1.php" method="post" enctype="multipart/form-data" class="form-group">
                                                    </div>
													<div class="card-footer">
                                                        <button type="submit" class="btn btn-primary btn-sm">
                                                            <i class="fa fa-dot-circle-o"></i>Show Report
                                                        </button>
                                                       
                                                    </div>
													
													</form>
                                                </div>
												</div>
												
										<div class="col-md-14">
                        <div class="card">
                            <div class="card-header">
                                <strong class="card-title"> Teacher Wise Timetable Reports</strong>
                            </div>
                            <div class="card-body">
							<?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$sql = "SELECT * FROM teacher";
$result=$conn->query($sql);
?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
echo "<th >  Name </th>";
echo "</tr>";
?>
                                    </thead>
									
                                    <tbody>
									<?php
                                       while($row = $result->fetch_assoc())
  {
  $tname = $row['tech_name'];	
   echo "<tr>";
echo "<td>" .$row['tech_name'] . "</td>";
 echo"<th> <a href ='Timetable_Teacher.php?tname=$tname'>"?><button type="button" class="btn btn-primary">  Time Table</button><?php "</a>";  
		  
  echo "</tr>";


  }
  ?>
                                       
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
					
					<div class="col-md-14">
                        <div class="card">
                            <div class="card-header">
                                <strong class="card-title"> Subject Wise Timetable Reports</strong>
                            </div>
                            <div class="card-body">
							<?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$sql = "SELECT * FROM tt_subject";
$result=$conn->query($sql);
?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
echo "<th >  Name </th>";
echo "</tr>";
?>
                                    </thead>
									
                                    <tbody>
									<?php
                                       while($row = $result->fetch_assoc())
  {
  $tname = $row['tname'];	
   echo "<tr>";
echo "<td>" .$row['tname'] . "</td>";
 echo"<th> <a href ='Timetable_Subject.php?tname=$tname'>"?><button type="button" class="btn btn-primary">  Time Table</button><?php "</a>";  
		  
  echo "</tr>";


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

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

    <!-- Right Panel -->

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

</body>

</html>
<?php
}

?>