@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'=>'takmarkebun/delete/', 'class'=>'form-horizontal' ,'id' =>'SximoTable' )) !!}
		 <div class="table-responsive" style="min-height:300px;">
		<table class="table table-hover table-striped table-bordered shadow-sm rounded">
			<thead class="thead-dark">
				<tr>
					<th class="number text-center align-middle">No</th>			
					@foreach ($tableGrid as $t)
						@if($t['view'] =='1')
							<th class="align-middle">{{ $t['label'] }}</th>
						@endif
					@endforeach
				</tr>
			</thead>
			<tbody>
				@php $i = 0; @endphp
				@foreach ($rowData as $row)
					<tr>
						<td class="text-center align-middle"> {{ ++$i }} </td>	
						@foreach ($tableGrid as $field)
							@if($field['view'] =='1')
								<?php $limited = isset($field['limited']) ? $field['limited'] :''; ?>
								@if(SiteHelpers::filterColumn($limited ))
									<td class="align-middle">					 
										{!! SiteHelpers::formatRows($row->{$field['field']},$field ,$row ) !!}
									</td>
								@endif	
							@endif					 
						@endforeach				 
					</tr>
				@endforeach
			</tbody>
		</table>
		<style>
			.table thead th {
				background: #343a40;
				color: #fff;
				font-weight: 600;
			}
			.table tbody tr:hover {
				background: #f1f3f6;
				transition: background 0.2s;
			}
			.table {
				box-shadow: 0 2px 8px rgba(0,0,0,0.05);
			}
		</style>
		<input type="hidden" name="md" value="" />
		</div>
		{!! Form::close() !!}
		
		
		@include('footer')
	</div>  
</div>
@stop