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

<style type="text/css">
span.bigcheck-target {
    font-family: FontAwesome; /* use an icon font for the checkbox */    
}
input[type='checkbox'].bigcheck {     
    position: relative;
    left: -999em; /* hide the real checkbox */
}

input[type='checkbox'].bigcheck + span.bigcheck-target:after {
    content: "\f096"; /* In fontawesome, is an open square (fa-square-o) */
}
input[type='checkbox'].bigcheck:checked + span.bigcheck-target:after {
    content: "\f046"; /* fontawesome checked box (fa-check-square-o) */
}


span.bigcheck { 
    display: block;
    padding: 0.5em;;
}

</style>
<div class="content" id="content">

  <div class="overlay"></div>     
<?php echo $__env->make('admin.includes.topbar', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

  <!-- main content -->
  <div class="main-content">


    <!-- panel -->

    <div class="panel panel-piluku">
      <div class="panel-heading">
        <h3 class="panel-title">
          Permissions
          <span class="panel-options">
            <a href="#" class="panel-refresh">
              <i class="icon ti-reload"></i>
            </a>
            <a href="#" class="panel-minimize">
              <i class="icon ti-angle-up"></i>
            </a>
            <a href="#" class="panel-close">
              <i class="icon ti-close"></i>
            </a>
          </span>
        </h3>
      </div>

<?php if(Session::has('error')): ?>
<div class="alert bg-danger text-white">
              <?php echo Session::get('success'); ?>

            </div>

<?php endif; ?>

<?php if(Session::has('success')): ?>
<div class="alert bg-success text-white">
              <?php echo Session::get('success'); ?>

            </div>

<?php endif; ?>




      <div class="panel-body">
 <?php echo Form::open(array('action' =>'SettingsController@updatePermissions')); ?>


                            <table width="100%" class="table table-striped table-bordered table-hover">


                                <thead>
                                    <tr>
                                    <th>Permissions</th>
                                    <?php foreach($roles as $role): ?>
                                        <th><?php echo $role->name; ?></th>
                                    <?php endforeach; ?>


                                    </tr>
                                </thead>
                                <tbody>
                                    
                                   
                                   <?php foreach($permissions as $permisson): ?>
                                    <tr class="gradeA">
                                    <td><?php echo $permisson->name; ?></td>
                                    <?php foreach($roles as $role): ?>
                                 <?php
                                $role = Role::findOrFail($role->id);
                                $checked = $role->hasPermission($permisson->name);
                                 ?>
                                      
                                        <td>

                                        <div class="form-group">
                                            <div>
                                
                                              <div class="col-sm-8">
                                          

<span class="bigcheck">
    <label class="bigcheck">

         <input type="checkbox" class="bigcheck" name="role[<?php echo $role->id; ?>][<?php echo $permisson->id; ?>]" <?php if($checked): ?> checked <?php endif; ?>>
        <span class="bigcheck-target"></span>
    </label>
</span>

                                          
                                              </div>
                                            </div>
                                          </div>


                                              
                                        


                                        </td>
                                    <?php endforeach; ?>


                                    </tr>
                                    <?php endforeach; ?>
                                    
                           
                                </tbody>



                            </table>
                            <!-- /.table-responsive -->
                            <div class="well">
                               
                                <button class="btn btn-default btn-lg btn-block">Update Permissions</button>
                            </div>


                            </form>
                      </div>
</div>
<!-- /panel -->

</div>
<!-- /main content -->        
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>