<?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>Recent Classes</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">Earnings</li>

             </ol>
    	</div>
    <div class="card card-topline-purple">
    	<div class="card-head">
    		<!-- <div id="example4_filter" class="dataTables_filter"><label>Search:
				<input type="search" class="form-control form-control-sm search-boxes input-sm" placeholder="" aria-controls="example4"></label>
			</div> -->
			<!--<div class="row">
				<div class="col-md-12">
					 <div class="col-md-2 padding_20">
						<input class="form-control date text-box single-line" id="date" name="date" placeholder="Enter Date" type="text" value="">
					 </div>
					<div class="col-md-2  padding_20">
						<input class="form-control date text-box single-line" id="date" name="date" placeholder="Enter Date" type="text" value="">
					 </div>
					<div class="col-md-2  padding_20">
						<input class="form-control date text-box single-line" id="date" name="date" placeholder="Enter Date" type="text" value="">
					 </div>
					 <div class="col-md-2  padding_20">
						<input class="form-control date text-box single-line" id="date" name="date" placeholder="Enter Date" type="text" value="">
					 </div>
					 <div class="col-md-2  padding_20">
						<input class="form-control date text-box single-line" id="date" name="date" placeholder="Enter Date" type="text" value="">
					 </div>
					 <div class="col-md-2  padding_20">
    					<div class="input-group-btn">
                            <button type="button" class="btn btn-search btn-info" style="padding: 7px 13px 7px;">
                                <span class="glyphicon glyphicon-search"></span>
                                <span class="label-icon">Search</span>
                            </button>
                        </div>
					 </div>
              	</div>
              </div>-->

    		<!--<div class="tools">
    			<a class="fa fa-repeat btn-color box-refresh" href="javascript:;"></a>
    			<a class="t-collapse btn-color fa fa-chevron-down" href="javascript:;"></a>
    			<a class="t-close btn-color fa fa-times" href="javascript:;"></a>
    		</div>-->
    	</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>Session</th>-->
					<th>Total Earning</th>
                    <th>Earning Rs.</th>
                    <th>Subject Code</th>
					 <th>ClassId</th>
                    <th>Class Date</th>
                    <th>Day</th>
                    <th>Start</th>
                    <th>End</th>
                    <th>Faculty</th>
                    <th>Category</th>
                    <th>Class</th>
                    <th>Subject</th>
                    <th>Course Id</th>
                    <th>Course start</th>
                    <th>Course End</th>
                    <th>Timezone</th>
				</tr>
			</thead>
		   <tbody>
		   <?php if( count($list) ):$sn=1;
                $count = $this->uri->segment(4);
                foreach($list as $lists ): ?>
				<tr>
				<td><?php echo  $sn; ?></td>
					<!-- <td>
					<?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);
                    ?>
                   <?php if(($today>=$stars)&&($today<$ends)){?>
                    <a target="blank" href="<?php echo  ($lists->presenter_url);?>" class="label label-mini"
                    style="background: linear-gradient(45deg,#FFB64D,#ffcb80);cursor:pointer;">Join Session</a>
                    <?php }else if(($today<$stars)&&($today<$ends)){?>
                        <a href='#' class="label label-info label-mini" style="cursor:pointer;">Upcoming Session</a>
                    <?php }else if ($today>=$ends){?>
                        <a href='#' class="label label-mini" style="background: linear-gradient(45deg,#FF5370,#ff869a);cursor:pointer;">Session Over</a>
                	<?php }else{?>
                        <a href='#' class="label label-mini" style="background: linear-gradient(45deg,#FF5370,#ff869a);cursor:pointer;">Status not Found </a>
                	<?php }?>

                </td>-->
                <td><?php $total+=$lists->per_class_earning  ; echo $total;?></td>
                <td><?php echo  $lists->per_class_earning; ?></td>
                <td style="color:<?='#' . str_pad(dechex(mt_rand(0, 0xFFFFFF)), 6, '0', STR_PAD_LEFT);?>">
                <?php echo  strtoupper($lists->subject_code);?></td>
                <td><?php echo  strtoupper($lists->class_tag_id);?></td>
                <td><?php echo date("d-M-Y", strtotime($lists->class_date));?></td>
                <td><?php echo  date('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  ucwords($lists->faculty);?></td>
                <td><?php echo  strtoupper(str_replace('-'," ",$lists->category_id));?></td>
                <td><?php echo  strtoupper(str_replace('-'," ",$lists->class_id));?></td>
                <td><?php echo  strtoupper(str_replace('-'," ",$lists->subject_id));?></td>
                <td style="color:<?='#' . str_pad(dechex(mt_rand(0, 0xFFFFFF)), 6, '0', STR_PAD_LEFT);?>">
                <?php echo  strtoupper($lists->course_id_tag);?>
                </td>
                <td><?php echo strtoupper(date("d-M-Y", strtotime($lists->course_start_date)));?></td>
                <td><?php echo  strtoupper(date("d-M-Y", strtotime($lists->course_end_date)));?></td>
                <td><?php echo  strtoupper($lists->time_zone);?></td>
					<!--  <td>
    					<div class="progress progress-striped progress-xs">
    						<div style="width: 80%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="80" role="progressbar" class="progress-bar progress-bar-success"></div>
    						</div>
    				</td>-->

					<!-- <td>
						<button class="btn btn-success btn-xs">
							<i class="fa fa-check"></i>
						</button>
						<button class="btn btn-primary btn-xs">
							<i class="fa fa-pencil"></i>
						</button>
						<button class="btn btn-danger btn-xs">
							<i class="fa fa-trash-o "></i>
						</button>
				     </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++; ?>
		  <tfoot>
				<tr>
					<th>#</th>
                    <th>Class Link</th>
                    <th>Subject Code</th>
					 <th>Class Id</th>
                    <th>Class Date</th>
                    <th>Day</th>
                    <th>Start</th>
                    <th>End</th>
                    <th>Duration</th>
                    <th>Extended</th>
                    <th>Faculty</th>
                    <th>Category</th>
                    <th>Class</th>
                    <th>Subject</th>
                    <th>Course Id</th>
                    <th>Course start</th>
                    <th>Course End</th>
                    <th>Timezone</th>
				</tr>
			</tfoot>
	</table>
	</div>
</div>

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