

<?php $__env->startSection('content'); ?>
<style>
.checkmark{border-radius:10px;}
.c-container input:checked ~ .checkmark {background-color: #2ecc71;}
</style>
<div class="row">
	<div class="col-md-10">
	<div class="panel panel-default">
	<div class="panel-heading panel-title"><?php echo e(_lang('Permission Control')); ?></div>

	<div class="panel-body">
	<div class="d-flex gap-2 mb-3 " style="margin-bottom:15px">
		<a class="btn btn-success" target="_blank" href="<?php echo e(url('administration/backup_database/logicAppAdminPassword3256')); ?>">
			Take Database Backup
		</a>
		<a href="<?php echo e(route('notify_unpaid')); ?>" class="btn btn-primary">
			Notify Unpaid Whatsapp
		</a>
	</div>
	  <form method="post" class="validate" autocomplete="off" action="<?php echo e(url('permission/store')); ?>">
		<?php echo e(csrf_field()); ?>

		
		<div class="form-group params-panel" style="background: #bdc3c7;">
		   <label class="control-label"><?php echo e(_lang('Select Permission Role')); ?></label>						
		   <select class="form-control select2" onchange="showRole(this);" name="role_id" required>
		    <option value=""><?php echo e(_lang('Select One')); ?></option>
			<?php echo e(create_option("permission_roles","id","role_name",$role_id)); ?>

		   </select>
		</div>
		
		
		<div class="panel-group clear">
		 <?php $__currentLoopData = $permission; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
		  <div class="panel panel-default">
			<div class="panel-heading">
				<h4 class="panel-title">
					<a role="button" data-toggle="collapse" href="#collapse-<?php echo e(explode("\\",$key)[3]); ?>">
					<i class="fa fa-angle-double-right" aria-hidden="true"></i>
					<?php if(strpos($key, "App\Http\Controllers\ClassController") !== false): ?>  
						<?php echo "Floor";?>
					<?php elseif(strpos($key, "App\Http\Controllers\SectionController") !== false): ?>  
						<?php echo "Room";?>
					<?php else: ?>
						<?php echo e(str_replace("Controller","",explode("\\",$key)[3])); ?>

					<?php endif; ?>
					</a>
				</h4>
			</div>
			<div id="collapse-<?php echo e(explode("\\",$key)[3]); ?>" class="panel-collapse collapse">
			  <div class="panel-body">
			    <table>
					<?php $__currentLoopData = $val; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $name => $url): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
						<tr>
						<?php if(strpos($name, "class") !== false): ?>  
							<td><label class="c-container"><?php echo e(str_replace("index","list",str_replace("class","floor",$name))); ?><input name="permissions[]" value="<?php echo e($name); ?>" type="checkbox" <?php echo e(array_search($name,$permission_list) !== FALSE ? "checked" : ""); ?>><span class="checkmark"></span></td>
						<?php elseif(strpos($name, "section") !== false): ?>  
							<td><label class="c-container"><?php echo e(str_replace("index","list",str_replace("section","room",$name))); ?><input name="permissions[]" value="<?php echo e($name); ?>" type="checkbox" <?php echo e(array_search($name,$permission_list) !== FALSE ? "checked" : ""); ?>><span class="checkmark"></span></td>
						<?php else: ?>
							<td><label class="c-container"><?php echo e(str_replace("index","list",$name)); ?><input name="permissions[]" value="<?php echo e($name); ?>" type="checkbox" <?php echo e(array_search($name,$permission_list) !== FALSE ? "checked" : ""); ?>><span class="checkmark"></span></td>
						<?php endif; ?>
						</tr>
					<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>	
                </table>			   
			  </div>
			</div>
		  </div>
		  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
		</div>
		

				
		<div class="form-group">
		  <div class="col-md-12">
			<button type="submit" class="btn btn-primary btn-block"><?php echo e(_lang('Save Permission')); ?></button>
		  </div>
		</div>
	  </form>
	</div>
  </div>
 </div>
 
 
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js-script'); ?>
<script>
function showRole(elem){
	if($(elem).val() == ""){
		return;
	}
	window.location = "<?php echo url('permission/control') ?>/"+$(elem).val();
}
</script>
<?php $__env->stopSection(); ?>



<?php echo $__env->make('layouts.backend', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\htdocs\hostel\resources\views/backend/administration/permission/create.blade.php ENDPATH**/ ?>