<?php defined('BASEPATH') or exit('No direct Access is Allowed'); ?>

<?php
  $last     = $this->uri->total_segments();
  $classid = $this->uri->segment($last);
?>
<div class="content-wrapper">
  <!-- Content Header (Page header) -->

  <!-- Main content -->
  <section class="content">
  <div class="row">
    <div class="col-xs-12">
      <div class="box">
          <!-- <div class="box-header">
		  <div class="box-header with-border padding_box" style="border-bottom: none;">
				<div class="create pu">
				<div class="box-tools pull-right collapse_tool">
						<a href="#" class="btn btn-sm btn-social btn-github button_collapse" style="margin-left:3px;">
						<i class="fa fa-fw fa-search  text-green"></i>Search</a>
            <?=anchor("admin/course/Course/create","Add Course",["class"=>"btn btn-sm btn-social btn-github"])?>
				</div>
			</div>


          </div>
        </div> -->
        <!--<div class="box-body" style="font-size:8px;">-->
        <div class="box-body table-responsive no-padding">

                           <div class="border_full">
                           <h3 class="full_h3"><?php  echo $list[0]->userid." | ".strtoupper($list[0]->faculty)." Schedule";?>
                             <a href="<?=site_url('admin/course/Course');?>" class="btn btn-default pull-right" style="background-color: #ffffff;"><i class="fa fa-fw fa-list"></i> Course List</a>                           </h3>
                           <div class="table-responsive">
                               <table class="table table-bordered" id="">
                                 <thead>
                                 <tr>
                                    <th>Faculty</th>
                                   <th>Course Name</th>
                                   <th>Total Course Enrolled</th>
                                   <th>Total Class Enrolled</th>
                                </tr>
                              </thead>
                                 <tbody>
                                 <tr>
                                   <td><?php echo ucwords($list[0]->faculty); ?></td>
                                   <td><?php $b= explode(',',$course_names);$z= (array_unique($b));  echo implode(',',$z);?></td>
                                   <td><?php $a= explode(',',$course_count);echo count(array_unique($a)); ?></td>
                                   <td><?php echo ucwords($class_count1); ?></td>
                                </tr>
                              </tbody>
                         </table>
                         </div>

                 </div>

        <div  id="reportsummary">
        <!-- <table id="example2" class="table table-bordered table-hover  table-responsive" style="font-size: 10px;">-->

  <div id="tableContainer2" class="container-tb">
        <table class="table-hover">
          <thead >
            <tr>
                <th>Sr.</th>
                <th>Classid </th>
                <th>Date </th>
                <th>Start Time</th>
                <th>Close Time</th>
                <th>Class Duration</th>
                <th>Faculty</th>
                <th>Status</th>
                <th>class link</th>
                <th>Recording</th>
                <th>Course Name</th>
            </tr>
          </thead>
          <tbody  style="font-size: 12px;" >
			<?php if( count($list) ):$sn=1;
			$count = $this->uri->segment(6);
			foreach($list as $lists ): ?>
            <tr>
                <td><?php echo  $sn; ?></td>
                <td><?php echo strtoupper($lists->class_name);?></td>
                <td><?php echo date("d-M-Y",strtotime($lists->class_date)); ?></td>
                <td><?php echo date("h:i A",strtotime($lists->class_start_time)); ?></td>
                <td><?php echo date("h:i A",strtotime($lists->class_end_time)); ?></td>
                <td><?php if($lists->class_extended_min!=""){
                  $extend =$lists->class_extended_min;
                }
                else{
                  $extend =0;
                } echo ($lists->class_duration_min+$extend); ?></td>
                <td><?php echo ucwords($lists->faculty); ?></td>
                <td><?php echo ucwords($lists->class_status.",".$lists->method); ?></td>
                <td><?php echo anchor($lists->teacher_cls_url,"class url",['title'=>'Class Link','class'=>'btn btn-sm btn-primary']); ?></td>
                <td><?php echo anchor($lists->teacher_rec_url,"Recording",['title'=>'Recording','class'=>'btn btn-sm btn-warning']); ?></td>

                <td><?php echo strtoupper($lists->course_name);?></td>
            </tr>
            <?php $sn++;?>
			<?php unset($a); endforeach; ?>
            <?php else : ?>
            <tr>
              <td><strong>No record found</strong></td>
            </tr>
            <?php endif; ?>
          </tbody>
        </table>
        </div>
        </div>
        <?php $count++; //echo  $link; ?>
        </div>
    </div>
  </div>
</div>
</section>
</div>

			<div class='wrap'>
	<div class='content content_pop'>
		<div class="col-md-12">
		   <?=form_open('admin/Adminlte/course_list_search');?>
				<div class="">

				   	<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 padding_20">
						<?=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%;"]);?>
                   </div>

					<div class="col-md-2  padding_20 emp_style">
						<?php $options=array(''=>'Search Type','and'=>'And','or'=>'OR');?>
						<?=form_dropdown('seach_term',$options,set_value('seach_term','and'),['class'=>'form-control input-sm','style'=>'']);?>
					</div>
					<div class="col-md-2  padding_20 emp_style">
						<?php $options=array(''=>'Order By','ASC'=>'Ascending','DESC'=>'Descending','RANDOM'=>'Random');?>
						<?=form_dropdown('order_by',$options,set_value('order_by','ASC'),['class'=>'form-control input-sm']);?>
					</div>

				</div>
				<div class="btn_mrgin1">

				 <?=form_submit('search','search',['class'=>'btn btn-primary btn_mrgin btn-sm']);?>
				</div>
			<?php echo form_close();?>
			</div>
	</div>
</div>
