@extends('layouts.app')

@section('content')
{{--*/ usort($tableGrid, "SiteHelpers::_sort") /*--}}
<div class="page-header mb-4">
	<div class="d-flex justify-content-between align-items-center">
		<h2 class="page-title">{{ $pageTitle }}</h2>
		<small class="text-muted">{{ $pageNote }}</small>
	</div>
</div>
<div class="card shadow-sm">
	<div class="card-body">
		<div class="toolbar mb-3">
			<div class="btn-group">
				<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
					<i class="fa fa-bars"></i> Bulk Action
				</button>
				<div class="dropdown-menu">
					@if($access['is_excel'] ==1)
						<a href="{{ url( $pageModule .'/export?do=excel&return='.$return) }}" class="dropdown-item">Export CSV</a>
					@endif
				</div>
			</div>
		</div>

		{!! Form::open(['url'=>'rangkingpasokmandortebang/delete/', 'class'=>'form-horizontal', 'id'=>'SximoTable']) !!}
		<div class="table-responsive" style="max-height:500px; overflow-y:auto;">
			<table class="table table-hover align-middle table-bordered table-striped" id="freeze-header-table" style="min-width:1200px;">
				<thead class="table-success" style="position: sticky; top: 0; z-index: 10; background: #d1e7dd;">
					<tr>
						<th class="text-center" style="width:40px;">No</th>
						@foreach ($tableGrid as $t)
							@if($t['view'] =='1')
								<th>{{ $t['label'] }}</th>
							@endif
						@endforeach
					</tr>
				</thead>
				<tbody>
					@foreach ($rowData as $row)
						<tr>
							<td class="text-center">{{ ++$i }}</td>
							@foreach ($tableGrid as $field)
								@if($field['view'] =='1')
									<?php $limited = isset($field['limited']) ? $field['limited'] :''; ?>
									@if(SiteHelpers::filterColumn($limited ))
										<td>
											{!! SiteHelpers::formatRows($row->{$field['field']},$field ,$row ) !!}
										</td>
									@endif
								@endif
							@endforeach
						</tr>
					@endforeach
				</tbody>
			</table>
			<input type="hidden" name="md" value="" />
		</div>
		{!! Form::close() !!}

		@push('styles')
		<style>
			#freezeTable thead th {
				position: sticky;
				top: 0;
				background: #f8f9fa;
				z-index: 2;
			}
		</style>
		@endpush

		@include('footer')
	</div>
</div>
@stop
