@extends('layouts.app')
@section('pageTitle', 'Privileges')
@section('content')
<?php use App\Http\Controllers\ConfigController; ?>
@if(ConfigController::check_privilege('ACCESS_SEARCH_PRIVILEGES'))
	<div class="offset-2 col-8">
		<div class="card ">
			<div class="card-header">Search Privileges @if(ConfigController::check_privilege('ACCESS_ADD_PRIVILEGES'))<div class="float-right"><a href="{{url('/role.list')}}" class="btn btn-danger btn-sm btn-space">Back to Cofigs</a><a href="{{url('/privilege.add')}}" class="btn btn-success btn-sm">Add Privilege</a></div>@endif</div>

			<div class="card-body">
				<form class="form-horizontal" method="get" action="{{url('/privilege.search')}}">
					<div class="form-group">
						<div class="offset-2 col-md-8">
							<input type="text" name="name" placeholder="Please Enter Privilege Name" class="form-control form-control-sm">
						</div>
						
					</div>

					<div class="form-group">
						<div class="offset-8 col-md-2">
							<button type="submit" class="btn btn-primary btn-sm col-md-12">
								Search
							</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
@endif

<br>
	<div class="container">
		<div class="card">
			<div class="card-header">Privileges <div class="float-right"><span class="btn btn-danger btn-sm">{{$privileges->total()}} result(s) found</span></div>
			</div>
				<div class="card-body">
					@include('configs.privileges_data')
				</div>
					
		</div>
	</div>
@endsection