<?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"];

?>
<!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-md-14">
                        <div class="card">
                            <div class="card-header">
                                <strong class="card-title">Edit Student Activity</strong>
                            </div>
                            <div class="card-body">
							<?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$class_name=$_POST["class_name"];
$date=$_POST["date"];
$month_name=$_POST["month_name"];
$sess1=$_POST["sess1"];
$cls_sec=$_POST["cls_sec"];
$sql = "SELECT * FROM activity where date='$date' and class_name='$class_name' and month_name='$month_name' and sess1='$sess1' and cls_sec='$cls_sec' and user_id='$userid'";
$result=$conn->query($sql);
?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
									   echo "<th >  Id </th>";
echo "<th >  Adm No </th>";

echo "<th > Portal Id </th>";
echo "<th > Studnet Name </th>";
echo "<th > Father Name </th>";
echo "<th > Class Name </th>";
echo "<th > Sec </th>";
echo "<th > Status</th>";



echo "</tr>";
$srno=0;
?>
                                    </thead>
									
                                    <tbody>
									<?php
									$a = 0;
									echo "<form name='form_update' method='post' action='Mark_Activity_Save.php'>\n";

                                       while($students = $result->fetch_assoc())
 
  {
  echo '<tr>';
	echo "<td>{$students['id']}<input type='hidden' name='id[$i]' value='{$students['id']}' /></td>";
	echo "<td>{$students['rollno']}</td>";
	echo "<td>{$students['portal_id']}</td>";
	echo "<td>{$students['stdname']}</td>";
	echo "<td>{$students['fname']}</td>";
	echo "<td>{$students['class_name']}</td>";
	echo "<td>{$students['cls_sec']}</td>";
	
	
	echo "<td><input type='text' size='20' name='status[$i]' value='{$students['status']}' /></td>";
	echo '</tr>';
	++$a;
	$srno=$srno + 1;
}

	
		echo '<tr>';
echo "<td><input type='submit' value='submit' /></td>";
echo "<td>$srno</td>";
echo '</tr>';
echo "</form>";
  


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


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

    <!-- Right Panel -->

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

</body>

</html>
<?php
}

?>