<?php include("parent/callMe.php"); ?>
<?php  include("sessioncheck.php"); ?>
<?php

$class_id=$_REQUEST['class_id'];
$section=$_REQUEST['section'];
$branchId=$_SESSION['branch'];
$sessionID=$_SESSION['current_session'];
$jobType=$_REQUEST['job_type'];

      
$sql="SELECT * FROM edu_user_config where branch_id='$branchId' and status='0' and user_jobtype='$jobType'";
 //echo $sql;
$WorkAssignListings = $m->query($sql);

?>


<!DOCTYPE html>
<html lang="en">
  <head>
    
    <title>Daily Lecture Attendance | EduPortal</title>
    <?php include('RootMe/css_links.php');?>
   
<style>

.tdStyle{border-bottom:1px solid lightgray;}
.thStyle{background-color:#00AFEF;color:white;}

input.largerCheckbox {
            width: 25px;
            height: 25px;
        }


  td {
  text-align: center;
  /* center checkbox horizontally */
  vertical-align: middle;
  /* center checkbox vertically */
}

</style>
  </head>
 
<script src="js/ajax_functions.js"></script> 


  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
             
            <?php //include('RootMe/sidebar.php');?>

              <?php //include('RootMe/header.php');?>
     
        <!-- page content -->
          <div class="" role="main" style="margin-left: 25px;margin-right: 25px;margin-top: 14px;">

            <a href="<?php echo $_SESSION['dashboard'];?>">Dashboard </a> &nbsp; <i style="" class="fa fa-angle-double-right"></i>  &nbsp; 
            Teacher Daily Lecture Attendance 

            <a href="<?php echo $_SESSION['dashboard'];?>" id="" class="btn btn-success" style="float: right;">Dashboard </a>
            <a href="view_daily_lecture_attendance.php" id="" class="btn btn-success" style="float: right;">View Lecture Attendance </a>
          <br><br>
          
          <div class="row" style="background-color: white;">
           
     <h3>Teacher Daily Lecture Attendance <span style="font-size: 16px;"> (<?php echo count($WorkAssignListings);?> records) </span></h3>
 

  <form class="form-style-7" action="teacher_daily_lecture_attendance.php" method="Get">
              
<div class="col-md-3 col-xs-12" style="padding: 8px;">
<div class="form-group ">
  <label class="required">Job Type</label>


  <select name="job_type" id="job_type"  name="term_id"   data-placeholder="Select" class="chosen-multi-select inputfield form-control">
    <option value="">Select </option>                 
            <option <?php if($_REQUEST['job_type']=="Permanent"){echo "Selected";} ?> value="Permanent"> Permanent</option>
            <option <?php if($_REQUEST['job_type']=="Contract"){echo "Selected";} ?> value="Contract"> Contract</option>
            <option <?php if($_REQUEST['job_type']=="Visiting"){echo "Selected";} ?> value="Visiting"> Visiting</option>

    </select> 
    </div>
  </div>


<div class="col-md-3 col-xs-12" style="padding: 8px;">
<div class="form-group ">
  <label class="required">Date</label>
   
  <input type="date" name="lecture_attendance_date" value="<?php echo date('Y-m-d');?>" class="form-control ">
  
</div>
</div> 


<div class="col-md-3 col-xs-12" style="padding: 8px;">
<div class="form-group ">
<label class="required">No of Lecture</label>
<select name="no_lecture" id="no_lecture"   data-placeholder="Select" class="chosen-multi-select inputfield form-control" onChange="getsec(this.value)"  >

          <option value="">Select </option> 

          <option <?php if($_REQUEST['no_lecture']=="1"){echo "Selected";} ?> value="1"> 1</option>

          <option <?php if($_REQUEST['no_lecture']=="2"){echo "Selected";} ?> value="2"> 2</option>

          <option <?php if($_REQUEST['no_lecture']=="3"){echo "Selected";} ?> value="3"> 3</option>

          <option <?php if($_REQUEST['no_lecture']=="4"){echo "Selected";} ?> value="4"> 4</option>

          <option <?php if($_REQUEST['no_lecture']=="5"){echo "Selected";} ?> value="5"> 5</option>

          <option <?php if($_REQUEST['no_lecture']=="6"){echo "Selected";} ?> value="6"> 6</option>

          <option <?php if($_REQUEST['no_lecture']=="7"){echo "Selected";} ?> value="7"> 7</option>

          <option <?php if($_REQUEST['no_lecture']=="8"){echo "Selected";} ?> value="8"> 8</option>

          <option <?php if($_REQUEST['no_lecture']=="9"){echo "Selected";} ?> value="9"> 9</option>

          <option <?php if($_REQUEST['no_lecture']=="10"){echo "Selected";} ?> value="10"> 10</option>

  </select> 
  </div>
</div>



  <div class="col-md-2 " style="padding:2px;">


    <div class="form-group ">
       
    <button id="month"  type="submit" class="btn btn-primary" style="margin-top: 30px;">Search</button>
  <?php   if(isset($_REQUEST['cat_id'])) { ?>
    <a href="print_contacts.php?<?php echo session_id().session_id().session_id().session_id().session_id(); ?>&cat_id=<?php echo $_REQUEST['cat_id'];?>" id="subuser"target="_blank" class="btn btn-primary" style="margin-top: 27px;">Print </a>
  <?php } ?>
    </div>

  </div>
             
</form>


  <section class="add_sub_agent" id="table_sub_agent">
  <div class="container">

 <div class="" style="margin-top:10px;">
    
      <div class="clearfix"></div>
    </div>
    <br>

     
<?php if (isset($_REQUEST['no_lecture'])) { ?>

<form class="form-style-7" action="<?php echo DOMAIN.AgentDirectory;?>parent/InsertMe.php" method="post"  enctype="multipart/form-data">

  <input type="hidden" name="action" value="StaffLectureAttendance"> 

<input type="hidden" value="<?php echo $_REQUEST['job_type']; ?>" name="job_type" />
<input type="hidden" value="<?php echo $_REQUEST['lecture_attendance_date']; ?>" name="lecture_attendance_date" />
<input type="hidden" value="<?php echo $_REQUEST['no_lecture']; ?>" name="no_lecture" />


<div style="overflow-x:auto;">

<table id="listofstudents" class="table table-striped table-bordered" style="width:100%;background-color: white;">
        <thead>
            <tr>

          
                <th width="">Teacher Name</th>

               <?php 
                	
                	for ($x = 1; $x <= $_REQUEST['no_lecture']; $x++) { 
    		 	
    		?>         

    		<input type="hidden" name="Lecture<?php echo $x;?>[]" value="<?php echo "Lecture ".$x; ?>">
    	  <th width="" style="text-align: center;"> <?php echo "Lecture ".$x; ?> </th>
            
    		<?php } ?>

              
                
                
                
            </tr>
        </thead>
        <tbody>


   
     
     <?php 

     $count=1;
     $number1;
      foreach($WorkAssignListings as $WorkAssignListVal)
      { 
        
    
    $m->where("designation_id", $WorkAssignListVal['designation_id']);
    $designation=$m->get("eduportal_designation_config");
      

      ?>
 
        <tr>

        		
                
          <td style="text-align:left;"> <?php echo $WorkAssignListVal['user_fname'];?> (<?php echo $designation[0]['designation_name'];?>) </td>

			        <?php
					for ($x = 1; $x <= $_REQUEST['no_lecture']; $x++) { 

         ?>
					  <td>
					  	
                 <input type="checkbox" style="text-align:center;" class="largerCheckbox" value="<?php echo "Lecture ".$x; ?>" name="attend_lecture<?php echo $WorkAssignListVal['user_id'];?>[]">
					  </td>

					<?php } ?>
                 
    



              </tr>


 <?php  }  ?>



           
        </tbody>
        
    </table>

  </div>

<button type="submit" style="margin: 30px;float: right;" class="btn btn-success" name="submit" >Submit </button>
    </form>

    <br><br>
<?php } else {?>
<br>
  <div  style="display:block;" class="alert alert-danger alert-dismissible">
      <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
       <strong>Warning !</strong> Please select Job Type / No of Lecture and serarch to create daily attendance Lecture  !!!
  </div>
  <?php }?>

  </div>
  <div class="clearfix"></div>
</section>          
    

           
          </div>
        </div>

            
          </div>
        </div>
        <!-- /page content -->
     
  <?php include('RootMe/js_linksscript.php');?>

     <!-- searchable dropdown -->
    
    <link href="autosearch_select/select2.css" rel="stylesheet">
    <link href="autosearch_select/select2-default.css" rel="stylesheet">
    <script src="autosearch_select/select2.min.js"></script>
    
    <script>
    $(function() {
    $('.chosen-select').select2( { width:'100%', maximumSelectionSize: 1 } );
    $(document).ready(function() {
    $(".chosen-multi-select").select2( { width:'100%', } ); }); }); function slideout(){ setTimeout(function(){
    $(".alert-success").fadeOut("slow", function () { });
    $(".alert-danger").fadeOut("slow", function () { }); }, 4000);}
    </script>


  </body>
</html>
