<?php $__env->startSection('content'); ?>
<div class="content-wrapper">
	<section class="content-header">
		<h1>
		Roles
		</h1>
	</section>

	<section class="content">
		<div class="row">
			<div class="col-md-12">
				<?php echo $__env->make('alert.success', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

				<a href="<?php echo e(asset('/roles/create')); ?>" type="button" class="btn btn-success btn-flat margin">New Role</a>
				<div class="box box-success">
					<div class="box-header">
						<h3 class="box-title">Role List</h3>
						<div class="box-tools">
							<?php echo Form::open(['url' => '/roles/search', 'method' => 'get']); ?>

							<div class="input-group input-group-sm" style="width: 150px;">
							<?php echo Form::text('term', null, ['class' => 'form-control pull-right', 'placeholder' => 'Search']); ?>

							<div class="input-group-btn">
							<button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
							</div>
							</div>
							<?php echo Form::close(); ?>

						</div>
					</div>
					<div class="box-body table-responsive no-padding">
						<table class="table table-hover">
							<tr>
								<th>ID</th>
								<th>Role</th>
								<th>Action</th>
							</tr>
							<?php foreach($roles as $role): ?>
							<tr>
								<td><?php echo e($role->id); ?></td>
								<td><?php echo e($role->role); ?></td>
								<td>
									<?php if($role->id != 1): ?>
									<div class="btn-group">
										<a href="<?php echo e(asset('roles/'.$role->id.'/edit')); ?>" title="Edit" class="btn btn-default btn-flat btn-sm"><i class="fa fa-pencil"></i></a>
										<?php if($role->id != 2 && $role->id != 3): ?>
										<a type="button" class="btn btn-default btn-flat btn-sm" title="Delete" data-toggle="modal" data-target="#deleteModal<?php echo e($role->id); ?>"><i class="fa fa-trash"></i></a>
										<div id="deleteModal<?php echo e($role->id); ?>" class="modal fade" role="dialog">
											<div class="modal-dialog">
											<div class="modal-content">
											<div class="modal-header">
											<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
											<h4 class="modal-title">Confirm Delete</h4>
											</div>
											<div class="modal-body">
											<p>Are you sure you want to delete this item?</p>
											</div>
											<div class="modal-footer">
											<button type="button" class="btn btn-default btn-flat pull-left" data-dismiss="modal">Close</button>
											<?php echo Form::open(['url' => ['roles/'.$role->id], 'method' => 'delete']); ?>

											<?php echo Form::submit('Yes', ['class' => 'btn btn-success btn-flat']); ?>

											<?php echo Form::close(); ?>

											</div>
											</div>
											</div>
										</div>
										<?php endif; ?>
									</div>
									<?php endif; ?>
								</td>
							</tr>
							<?php endforeach; ?>
						</table>
					</div>
					<div class="box-footer clearfix">
						<div class="row">
							<div class="col-xs-12">
								Showing <?php echo e($roles->firstItem()); ?> to <?php echo e($roles->lastItem()); ?> of <?php echo e($roles->total()); ?> entries
								<div class="pull-right">
								<?php echo $roles->links(); ?>

								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</section>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make(Auth::check() && Auth::user()->role->layout == 1 ? 'layouts.admin' : 'layouts.employee', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>