@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'=>'klentekmututebangan/delete/', 'class'=>'form-horizontal' ,'id' =>'SximoTable' )) !!}
			<div class="table-responsive" style="min-height:300px; max-height:500px; overflow-y:auto;">
				<table class="table table-hover table-striped modern-blue-table" style="position:relative;">
					<thead class="bg-primary text-white" style="position:sticky; top:0; z-index:2;">
						<tr>
							<th class="number text-right"> No </th>
							@foreach ($tableGrid as $t)
								@if($t['view'] =='1')
									<th
										@if(isset($t['type']) && in_array($t['type'], ['int','float','double','number','decimal']))
											class="text-right"
										@endif
									>{{ $t['label'] }}</th>
								@endif
							@endforeach
						</tr>
					</thead>
					<tbody>
						@foreach ($rowData as $row)
							<tr>
								<td width="30" class="text-right"> {{ ++$i }} </td>
								@foreach ($tableGrid as $field)
									@if($field['view'] =='1')
										<?php $limited = isset($field['limited']) ? $field['limited'] :''; ?>
										@if(SiteHelpers::filterColumn($limited ))
											<td
												@if(isset($field['type']) && in_array($field['type'], ['int','float','double','number','decimal']))
													class="text-right"
												@endif
											>
												{!! SiteHelpers::formatRows($row->{$field['field']},$field ,$row ) !!}
											</td>
										@endif
									@endif
								@endforeach
							</tr>
						@endforeach
					</tbody>
				</table>
				<input type="hidden" name="md" value="" />
			</div>
			{!! Form::close() !!}
		</div>

		<style>
		.modern-blue-table {
			border-radius: 8px;
			overflow: hidden;
			box-shadow: 0 2px 8px rgba(0,0,128,0.08);
			border: none;
		}
		.modern-blue-table thead {
			background: linear-gradient(90deg, #1976d2 0%, #2196f3 100%);
		}
		.modern-blue-table th {
			color: #fff !important;
			font-weight: 600;
			border: none;
		}
		.modern-blue-table td {
			border-top: 1px solid #e3f2fd;
			background-color: #f5fafd;
		}
		.modern-blue-table tr:hover td {
			background-color: #e3f2fd;
		}
		</style>
		
		
		@include('footer')
	</div>  
</div>
@stop