
<?php $__env->startSection('title'); ?>
    Permission asign Page
<?php $__env->stopSection(); ?>
<?php $__env->startSection('css'); ?>

<?php $__env->stopSection(); ?>
<!-- page content -->
<?php $__env->startSection('content'); ?>
    <div class="right_col" role="main">
        <div class="">
            <div class="clearfix"></div>
            <?php if(Session::has('success_message')): ?>
                <div class="alert alert-success">
                    <?php echo e(Session::get('success_message')); ?>

                </div>
            <?php endif; ?>
            <?php if(Session::has('error_message')): ?>
                <div class="alert alert-danger">
                    <?php echo e(Session::get('error_message')); ?>

                </div>
            <?php endif; ?>
            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_title">
                            <a href="<?php echo e(route('role.list')); ?>" calss="btn" ><h2><i class="fa fa-mail-reply"></i></h2></a>
                            <h2>

                                Asign Module Permission For <b><?php echo e($roledetails->name); ?></b></h2>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                </li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                                       aria-expanded="false"><i class="fa fa-wrench"></i></a>
                                    <ul class="dropdown-menu" role="menu">
                                        <li><a href="#">Settings 1</a>
                                        </li>
                                        <li><a href="#">Settings 2</a>
                                        </li>
                                    </ul>
                                </li>
                                <li><a class="close-link"><i class="fa fa-close"></i></a>
                                </li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content">
                            <form action="<?php echo e(route('module.moduleasign',$roledetails->id)); ?>" method="post">
                                <div class="row"> 
                                 <?php echo e(csrf_field()); ?>

                                    <?php $__currentLoopData = $modules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php $__currentLoopData = $currentpermission; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php if($cp->module_url == $p->module_url): ?>
                                                <?php ($check = 'Checked'); ?>
                                                <?php 
                                                    break;
                                                 ?>
                                            <?php else: ?>
                                                <?php ($check = ''); ?>
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <div class="col-sm-4">
                                        <lebel>
                                          <input type="checkbox" id="<?php echo e($p->name); ?>" name="asignpermission[]" value="<?php echo e($p->id); ?>" <?php if(isset($check)): ?><?php echo e($check); ?> <?php else: ?> <?php endif; ?>> <label for="<?php echo e($p->name); ?>">   <?php echo e($p->name); ?> </label> &nbsp;&nbsp;&nbsp;
                                        </lebel>
                                    </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>
                                <br><br>

                                <div class="box-footer">
                                    <button type="submit" name="btnCreate" class="btn btn-primary">Update Permission</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /page content -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('backend.layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>