<?php defined('BASEPATH')or exit("NO DIRECT ACCESS iS ALLOWED");?>
<div class="col-md-12  padding_sidebar">
<div class="row" style="margin-right:0px ;margin-left:0px;">
		<div class="card-head profile-categories_bread"><header>Session Completed</header>
		<div class="pull-left"><?php echo  $link;?></div>
    		 <ol class="breadcrumb page-breadcrumb pull-right">
                    <li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="<?=site_url("Teacher")?>">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
                    </li>
                    <li class="active">Session Completed</li>

             </ol>
			<div class="pull-left">
			            <a href="#" class="btn btn-sm btn-social btn-github pull-right button_collapse">
						<i class="fa fa-fw fa-search  text-green"></i>Search</a>
						</div>
    	</div>
    <div class="card card-topline-purple">
    	<div class="card-head">

    	</div>
	   <div class="table-responsive">
	   <div id="tableContainer2" class="container-tb">
	     <table class="table" style="font-family: sans-serif;font-size: 12px;">
			<thead>
				<tr>
					<th>#</th>
            <th>Class Id</th>
            <th>Recording</th>
            <th>Class Date</th>
            <th>Start</th>
            <th>End</th>
            <th>Class</th>
            <th>Subject</th>
				</tr>
			</thead>
		   <tbody>
		   <?php if( count($list) ):$sn=1;
                $count = $this->uri->segment(4);
                foreach($list as $lists ): ?>
                <?php
                           $todays_date       =   date("Y-m-d H:i");
                           $today             =   strtotime($todays_date);
                           $starts            =   strtotime($lists->class_date.' '.$lists->class_start_time);
                           $ends              =   strtotime($lists->class_date.' '.$lists->class_end_time);
                           $time1             =   $starts - (10 * 60);
                           $less_10_min_start_time = date("Y-m-d H:i", $time1);
                           //echo $less_10_min_start_time;
                           $stars             =    strtotime($less_10_min_start_time);
                          ?>
				<tr <?php if(($today>=$stars)&&($today<$ends)){ ?>style="background-color:#bfcadacf;"<?php }?>>
				<td><?php echo  $sn; ?></td>
        <td><?php echo  strtoupper($lists->class_name);?></td>
					<td><a target="blank" href="<?php echo  ($lists->teacher_rec_url);?>" class="label label-mini"
					style="background: #2ecc71;cursor:pointer;">Recording</a>

                </td>
                <td><?php echo date("d-M-Y l", strtotime($lists->class_date));?></td>
                <td><?php echo  strtoupper(date('g:i a',strtotime($lists->class_start_time)));?></td>
                <td><?php echo  strtoupper(date('g:i a',strtotime($lists->class_end_time)));?></td>
                <td><?php echo  strtoupper(str_replace('-'," ",$lists->class));?></td>
                <td><?php echo  strtoupper(str_replace('-'," ",$lists->subject));?></td>
				</tr>
		<?php $sn++;unset($json2);unset($user_id);unset($user_url);unset($stars);unset($ends);unset($today);?>
        <?php endforeach; ?>
        <?php else : ?>
        <tr><td><a href="#">No Record Found</a></td></tr>
         <?php endif; ?>
		  </tbody><?php $count++; ?>

	</table>
	</div>
</div>

</div>
</div>
</div>
</div>
</div>
<div class='wrap_search'>
	<div class='content content_pop'>
		<div class="col-md-12">
			  <?=form_open('Teacher/recent_classes_15_days_search');?>
				<div class="col-md-10">
					<div class="col-md-2  padding_20 emp_style">
			<select id='sel_category' class="form-control input-sm" name="category">
					<option value="" >Select Category</option>
					<?php
					foreach($category as $category1){
						echo "<option value='".$category1['id']."'>".strtoupper($category1['category_code'])." | ".strtoupper($category1['category'])."</option>";
					}
					?>
			</select>
					</div>
					<div class="col-md-2  padding_20 emp_style">
						<select id='sel_class' class="form-control input-sm" name="class" >
							<option value="" >Select class</option>
						</select>
					</div>
					<div class="col-md-2  padding_20 emp_style">
						<select id='sel_subject' class="form-control input-sm" name="subject" >
							<option value="" >Select subject</option>
						</select>
					</div>
					<div class="col-md-2  padding_20 emp_style">
					<select id='sel_course_list' class="form-control input-sm" name="course" >
						<option value="" >Select course</option>
					</select>
		          </div>
				<div class="col-md-2  btn_mrgin1 emp_style">
							 <?=form_submit('search','search',['class'=>'btn btn-primary btn_mrgin btn-sm']);?>
				</div>
				</div>
			<?php echo form_close();?>
			</div>
	<?=form_open('Teacher/recent_classes_15_days_search2');?>
	<div class="col-md-2">
		<div class="col-md-12  padding_20 emp_style">
			<?=form_dropdown('subject_code',$subject_code ,set_value('subject_code',$data_taskpo['subject_code']),['class'=>'form-control input-sm select2 select2-hidden-accessible',
			"tabindex"=>"-1","aria-hidden"=>"true","style"=>"width: 100%;",'onchange'=>"this.form.submit()"]);?>
		</div>
  </div>
	<?php echo form_close();?>

	</div>

</div>
