<?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>Course Enrolled List </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('Student')?>">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
                    </li>
                    <li><a class="parent-item" href="#">Courses</a>&nbsp;<i class="fa fa-angle-right"></i></li>
                    <li class="active">Enrolled</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>Course</th>
					<th>Status</th>
					<th>Category</th>
					<th>Class</th>
					<th>Subject</th>
					<th>Subject Code</th>
					<th>Course Duration</th>
				</tr>
			</thead>
		   <tbody>
		   <?php if( count($list) ):$sn=1;
                $count = $this->uri->segment(4);
                foreach($list as $lists ): ?>
				<tr>
					<td ><?php echo  ucfirst($sn);?><!--<a href='<?php //echo site_url("Student/course_enrolled_detail/{$lists->course_id}")?>' ><i class="fa fa-eye" style="color:#ffa500;float:right"></i></a>--></td>
					<td><a class="label label-mini" href='<?php echo site_url("Student/course_enrolled_detail/{$lists->course_id}")?>' style="color:#ffffff;cursor:pointer;"><?php echo  strtoupper($lists->course_id_tag);?></a>
					<td>
    					<?php
    					$todays_date = date("Y-m-d");
    					$today      =   strtotime($todays_date);
    					$stars      =   strtotime($lists->course_start_date);
    					$ends       =   strtotime($lists->course_end_date);
    					?>
              <?php if(($today>=$stars)&&($today<$ends)){?>
              <!-- <a href='<?=$user_url?>' class="label label-mini" style="background: linear-gradient(45deg,#FFB64D,#ffcb80);cursor:default;">Running</a> -->
              <span style="color:blue;"> Running </span>
              <?php }else if(($today<$stars)&&($today<$ends)){?>
              <!-- <a href='#' class="label label-info label-mini" style="cursor:default;">Upcoming</a> -->
              <span style="color:orange;">  Upcoming </span>
              <?php    }else if ($today>=$ends){?>
              <!-- <a href='#' class="label label-mini" style="background: linear-gradient(45deg,#1ebdcc,#1ebdcc);cursor:default;">Completed</a> -->
              <span style="color:red;">   Completed </span>
              <?php    }else{?>
              <!-- <a href='#' class="label label-mini" style="background: linear-gradient(45deg,#FF5370,#ff869a);cursor:default;">Status not Found </a> -->
              <span >    Status not Found </span>
              <?php    }?>
              </td>
              <td><?php echo  strtoupper($lists->category);?></td>
					<td><?php echo  strtoupper($lists->class);?></td>
					<td ><?php echo  strtoupper($lists->subject);?></td>
					<td ><?php echo  strtoupper($lists->subject_code);?></td>
					<td> <?php //echo  $lists->class_duration_min." Mins";?></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('Student/course_enrolled_list_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('Student/course_enrolled_list_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>
