@extends('layouts.app')

@section('content')
{{--*/ usort($tableGrid, "SiteHelpers::_sort") /*--}}
<div class="page-titles">
  <h2> {{ $pageTitle }} <small> {{ $pageNote }} </small></h2>
</div>
<div  class="card">
	<div class="card-body">
		<div class="toolbar-nav">
			<div class="row">
				<div class="col-md-6">
					<div class="btn-group">
						<button type="button" class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-bars"></i> Bulk Action </button>
				        <ul class="dropdown-menu">
				         @if($access['is_excel'] ==1)
							<li class="nav-item"><a href="{{ url( $pageModule .'/export?do=excel&return='.$return) }}" class="nav-link"> Export CSV </a></li>	
						@endif
				        </ul>
				    </div>	
				</div>    
			</div>
		<div >

	


		 {!! Form::open(array('url'=>'rekaptakdesperiodetebang/delete/', 'class'=>'form-horizontal' ,'id' =>'SximoTable' )) !!}
		 <div class="table-responsive" style="min-height:300px; max-height:600px; overflow-y:auto;">
	    <table class="table table-hover table-striped  ">
	        <thead style="position: sticky; top: 0; z-index: 10; background-color: #000000; color: #ffffff;">
				<tr>
					<th class="number" style="background-color: #000000; color: #ffffff;"> No </th>			
					@foreach ($tableGrid as $t)
						@if($t['view'] =='1')
							<th style="background-color: #000000; color: #ffffff;">{{ $t['label'] }}</th>
						@endif
					@endforeach
				  </tr>
	        </thead>

	        <tbody>
							
	            @foreach ($rowData as $row)
	                <tr>
						<td width="30"> {{ ++$i }} </td>	
					<?php $colIndex = 0; ?>
					@foreach ($tableGrid as $field)
						 @if($field['view'] =='1')
						 	<?php 
						 		$colIndex++;
						 		$limited = isset($field['limited']) ? $field['limited'] :''; 
						 	?>
						 	@if(SiteHelpers::filterColumn($limited ))
							 <td style="{{ ($colIndex >= 6 && $colIndex <= 30) ? 'text-align: right;' : '' }}">					 
							 	@if($colIndex >= 6 && $colIndex <= 30)
							 		<?php 
							 			$value = $row->{$field['field']};
							 			if($value == 0 || $value == '0' || empty($value)) {
							 				echo '-';
							 			} else {
							 				echo number_format($value, 2, ',', '.');
							 			}
							 		?>
							 	@else
							 		{!! SiteHelpers::formatRows($row->{$field['field']},$field ,$row ) !!}
							 	@endif						 
							 </td>
							@endif	
						 @endif					 
					 @endforeach				 
					
	                </tr>
					
	            @endforeach
	              
	        </tbody>
	      
	    </table>
		<input type="hidden" name="md" value="" />
		</div>
		{!! Form::close() !!}
		
		
		@include('footer')
	</div>  
</div>
@stop