<?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';
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"];
$id=$_REQUEST["id"];
$sql = "SELECT * FROM addsubject where id = '$id' and user_id='$userid'";
$result=$conn->query($sql);
$row = $result->fetch_assoc();
$class_name=$row['class_name'] ;
$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'] ;
$sql3="Select * from term_exam where user_id='$userid'";
$result1 = $conn->query($sql3);

?>
<!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-lg-12">
                        <div class="card">
                            <div class="card-header"><strong>Genrate Datesheet</strong><small> Form</small></div>
                            <div class="card-body card-block">
							<form action="Genrate_Student_Datesheet_Save.php" method="post" enctype="multipart/form-data" class="form-group">
							           
                                                                    <div class="col-12 col-md-3">
																	<div class="form-group"><label for="cname" class=" form-control-label">Term</label>
                                                                        <select name="term" id="term" class="form-control">
                                                                             <?php
  while($user_data3=$result1->fetch_assoc())
  {
  ?>
              <option value="<? echo $user_data3['tname']; ?>"><? echo $user_data3["tname"]; ?></option>
              <?php
  }
  ?>
                                                                           
                                                                        </select>
                                                                    </div>
																	</div>
                                                              
							<div class="col-3">
                                <div class="form-group"><label for="cname" class=" form-control-label">Class Name</label><input type="text" id="class_name" name="class_name" class="form-control" value="<? echo $class_name ?>"></div>
								</div>
								<div class="col-3">
                                <div class="form-group"><label for="cname" class=" form-control-label">Month Name</label><input type="text" id="month_name" name="month_name" class="form-control" value="<? echo $my ?>"></div>
								</div>
								<div class="col-3">
                                <div class="form-group"><label for="cname" class=" form-control-label">Session</label><input type="text" id="sess1" name="sess1" class="form-control" value="<? echo $year ?>"></div>
								</div>
							
							<div class="col-3">
                                <div class="form-group"><label for="cname" class=" form-control-label"></label><input type="text" id="sub1" name="sub1" placeholder="Subject Name 1" class="form-control" value="<? echo $sub1 ?>"><input type="text" id="ddate1" name="ddate1" placeholder="Date" class="form-control" value="<? echo $today ?>"><input type="text" id="dday1" name="dday1" placeholder="Day" class="form-control"><input type="text" id="dtime1" name="dtime1" placeholder="Time" class="form-control"></div>
								</div>
								<div class="col-3">
                                    <div class="form-group"><label for="mfee" class=" form-control-label"></label><input type="text" id="sub2" name="sub2" placeholder="Subject Name 2" class="form-control" value="<? echo $sub2 ?>"><input type="text" id="ddate2" name="ddate2" placeholder="Date" class="form-control" value="<? echo $today ?>"><input type="text" id="dday2" name="dday2" placeholder="Day" class="form-control"><input type="text" id="dtime2" name="dtime2" placeholder="Time" class="form-control"></div>
									</div>
									<div class="col-3">
                                <div class="form-group"><label for="feedisc1" class=" form-control-label"></label><input type="text" id="sub3" name="sub3" placeholder="Subject Name 3" class="form-control" value="<? echo $sub3 ?>"><input type="text" id="ddate3" name="ddate3" placeholder="Date" class="form-control" value="<? echo $today ?>"><input type="text" id="dday3" name="dday3" placeholder="Day" class="form-control"><input type="text" id="dtime3" name="dtime3" placeholder="Time" class="form-control"></div>
								</div>
								<div class="col-3">
                                    <div class="form-group"><label for="fee1" class=" form-control-label"></label><input type="text" id="sub4" name="sub4" placeholder="Subject Name 4" class="form-control" value="<? echo $sub4 ?>"><input type="text" id="ddate4" name="ddate4" placeholder="Date" class="form-control" value="<? echo $today ?>"><input type="text" id="dday4" name="dday4" placeholder="Day" class="form-control"><input type="text" id="dtime4" name="dtime4" placeholder="Time" class="form-control"></div>
									</div>
									
									<div class="col-3">
                                <div class="form-group"><label for="feedisc2" class=" form-control-label"></label><input type="text" id="sub5" name="sub5" placeholder="Subject Name 5" class="form-control" value="<? echo $sub5 ?>"><input type="text" id="ddate5" name="ddate5" placeholder="Date" class="form-control" value="<? echo $today ?>"><input type="text" id="dday5" name="dday5" placeholder="Day" class="form-control"><input type="text" id="dtime5" name="dtime5" placeholder="Time" class="form-control"></div>
								</div>
								<div class="col-3">
                                    <div class="form-group"><label for="fee2" class=" form-control-label"></label><input type="text" id="sub6" name="sub6" placeholder="Subject Name 6" class="form-control" value="<? echo $sub6 ?>"><input type="text" id="ddate6" name="ddate6" placeholder="Date" class="form-control" value="<? echo $today ?>"><input type="text" id="dday6" name="dday6" placeholder="Day" class="form-control"><input type="text" id="dtime6" name="dtime6" placeholder="Time" class="form-control"></div>
									</div>
									
									
									<div class="col-3">
                                <div class="form-group"><label for="feedisc3" class=" form-control-label"></label><input type="text" id="sub7" name="sub7" placeholder="Subject Name 7" class="form-control" value="<? echo $sub7 ?>"><input type="text" id="ddate7" name="ddate7" placeholder="Date" class="form-control" value="<? echo $today ?>"><input type="text" id="dday7" name="dday7" placeholder="Day" class="form-control"><input type="text" id="dtime7" name="dtime7" placeholder="Time" class="form-control"></div>
								</div>
								<div class="col-3">
                                    <div class="form-group"><label for="fee3" class=" form-control-label"></label><input type="text" id="sub8" name="sub8" placeholder="Subject Name 8" class="form-control" value="<? echo $sub8 ?>"><input type="text" id="ddate8" name="ddate8" placeholder="Date" class="form-control" value="<? echo $today ?>"><input type="text" id="dday8" name="dday8" placeholder="Day" class="form-control"><input type="text" id="dtime8" name="dtime8" placeholder="Time" class="form-control"></div>
									</div>
									<div class="col-3">
                                    <div class="form-group"><label for="fee3" class=" form-control-label"></label><input type="text" id="sub9" name="sub9" placeholder="Subject Name 9" class="form-control" value="<? echo $sub9 ?>"><input type="text" id="ddate9" name="ddate9" placeholder="Date" class="form-control" value="<? echo $today ?>"><input type="text" id="dday9" name="dday9" placeholder="Day" class="form-control"><input type="text" id="dtime9" name="dtime9" placeholder="Time" class="form-control"></div>
									</div>
									
									<div class="col-3">
                                    <div class="form-group"><label for="fee3" class=" form-control-label"></label><input type="text" id="sub10" name="sub10" placeholder="Subject Name 10" class="form-control" value="<? echo $sub10 ?>"><input type="text" id="ddate10" name="ddate10" placeholder="Date" class="form-control" value="<? echo $today ?>"><input type="text" id="dday10" name="dday10" placeholder="Day" class="form-control"><input type="text" id="dtime10" name="dtime10" placeholder="Time" class="form-control"></div>
									</div>
									
									
									
								
				
													
                                                    </div>
													<div class="card-footer">
                                                        <button type="submit" class="btn btn-primary btn-sm">
                                                            <i class="fa fa-dot-circle-o"></i> Genrate Datesheet
                                                        </button>
                                                        
                                                    </div>
													
													</form>
                                                </div>
                                            </div>

            


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

    <!-- Right Panel -->

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

</body>

</html>
<?php
}
?>