<?php $__env->startSection('content'); ?>
	<div class="row">
    	<div class="col-lg-12">
    		<h1 class="page-header">Users</h1>
    	</div>
    </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                    
                    	<?php if(session('status')): ?>
						<div class="alert alert-success">
							<?php echo e(session('status')); ?>

						</div>
						<?php endif; ?>
						<?php if(count($errors) > 0): ?>
							<div class="alert alert-danger">
								<strong>Whoops!</strong> There were some problems with your input.<br><br>
								<ul>
									<?php foreach($errors->all() as $error): ?>
										<li><?php echo e($error); ?></li>
									<?php endforeach; ?>
								</ul>
							</div>
						<?php endif; ?>
						
						<div class="panel-heading">
                            Edit Permissions for <?php echo e($user->name); ?>

                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-12">
				                    <form class="form-horizontal" role="form" method="POST" action="<?php echo e(url('admin/users/permissions')); ?>">
										<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
										<input type="hidden" name="userID" value="<?php echo e($user->id); ?>">

										<div class="form-group">
										<?php foreach($actions as $action): ?>
											<?php if($action->visible == 1 && $action->id == 1): ?>
											<label class="col-md-2 control-label"><?php echo e($action->action); ?></label>
											<div class="col-md-1">
												<input type="checkbox" class="form-control" name="<?php echo e($action->id); ?>" value="1"
												<?php if(isset($permissions[$action->id]) && $permissions[$action->id] == 1): ?>
												 checked
												<?php endif; ?>
												>
											</div>
											<?php endif; ?>
										<?php endforeach; ?>
										</div>
										<div class="form-group">
										<?php foreach($actions as $action): ?>
											<?php if($action->visible == 1 && $action->id != 1): ?>
											<label class="col-md-2 control-label"><?php echo e($action->action); ?></label>
											<div class="col-md-1">
												<input type="checkbox" class="form-control" name="<?php echo e($action->id); ?>" value="1"
												<?php if(isset($permissions[$action->id]) && $permissions[$action->id] == 1): ?>
												 checked
												<?php endif; ?>
												>
											</div>
											<?php endif; ?>
										<?php endforeach; ?>
										</div>
										
										
										<div class="form-group">
											<div class="col-md-10 col-md-offset-1">
												<button type="submit" class="btn btn-primary">
													Save
												</button>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('residential.templates.uadmin', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>