@extends('adminlte::page')
@section('css')
<style>
	.tabs-left,
	.tabs-right {
		border-bottom: none;
		padding-top: 2px;
	}

	.tabs-left {
		border-right: 1px solid #ddd;
	}

	.tabs-right {
		border-left: 1px solid #ddd;
	}

	.tabs-left>li,
	.tabs-right>li {
		float: none;
		margin-bottom: 2px;
	}

	.tabs-left>li {
		margin-right: -1px;
	}

	.tabs-right>li {
		margin-left: -1px;
	}

	ul li {
		margin-left: 30px
	}

	ul li.row-list {
		width: 300px !important;
		float: left;
		padding-left: 30px
	}

	.tabs-left>li.active>a,
	.tabs-left>li.active>a:hover,
	.tabs-left>li.active>a:focus {
		border-bottom-color: #ddd;
		border-right-color: transparent;
	}

	.tabs-right>li.active>a,
	.tabs-right>li.active>a:hover,
	.tabs-right>li.active>a:focus {
		border-bottom: 1px solid #ddd;
		border-left-color: transparent;
	}

	.tabs-left>li>a {
		border-radius: 4px 0 0 4px;
		margin-right: 0;
		display: block;
	}

	.tabs-right>li>a {
		border-radius: 0 4px 4px 0;
		margin-right: 0;
	}
	ul{
		margin-bottom: 100px
	}
</style>
@stop
@section('content')
<?php 
	Fun::lang();
	$index = 1;
 ?>
<div class="title-add">
	<div class="page-bar">
		<ul class="page-breadcrumb">
			<li> <a class="ng-binding" href="#"><i class="fa fa-dashboard"></i> Dashboard</a> </li>
			<li><a href="#">Manage User</a></li>
			<li><a href="#">Role</a></li>
			<li><a href="#">View Role</a></li>
		</ul>
	</div>
</div>
<div class="page">
	<div class="row">
		<div class="col-sm-12">
			<div class="top-content">
				<div class="margin-tb">
					<div class="pull-left">
						<h2> {{__('administrator.view')}}</h2>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div class="row">
		<div class="col-xs-12 col-sm-12 col-md-12">
			<div class="form-group">
				<h2>{{ $role->name }}</h2>
				<br>
			</div>
		</div>
		<div class="col-xs-12 col-sm-12 col-md-12">
			<div class="col-xs-9">
				<div class="tab-content">
					@foreach($prefixes as $key => $prefix)
					<div class="tab-pane {{($key==0)?'active':''}}" id="{{$key}}-tab">
						<div class="col-sm-12 col-xs-12">
							@foreach($groups as $j => $group)
								@if($prefix->prefix_name==$group->prefix_name)
									<ul>
										<label style="width: 100%;color: #003eff;margin-bottom:20px" class="checkbox-list">
											{{$group->group_name}}
										</label>
										@foreach($permission as $value => $perm)
											@if($perm->group_name == $group->group_name)
											<li class="row-list">
												<label style="width: 100%;font-size: 14px" class="checkbox-list">
													{{ Form::checkbox('permission[]', $perm->id, in_array($perm->id, $rolePermissions) ? true : false, array('class' => 'name '.$key.'-box','disabled')) }}
													{{ $perm->name }}<span class="checkmark"></span>
												</label>
											</li>
											@endif
										@endforeach
									</ul>
									<hr>
								@endif
							@endforeach
							
						</div>
					</div>
					@endforeach
				</div>
			</div>
			<div class="col-xs-3">
				<ul class="nav nav-tabs tabs-right sideways">
					@foreach($prefixes as $index => $prefix)
					<li class="{{($index==0)?'active':''}}"><a href="#{{$index}}-tab" data-toggle="tab">{{$prefix->prefix_name}}</a></li>
					@endforeach
				</ul>
			</div>
		</div>
	</div>
</div>
@endsection