<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <h1>
      Gérer les
      <small>Staffs</small>
    </h1>
    <ol class="breadcrumb">
      <li><a href="#"><i class="fa fa-dashboard"></i> Accueil</a></li>
      <li class="active">Staff</li>
    </ol>
  </section>

  <!-- Main content -->
  <section class="content">
    <!-- Small boxes (Stat box) -->
    <div class="row">
      <div class="col-md-12 col-xs-12">

        <?php if (session()->getFlashdata('success')): ?>
          <div class="alert alert-success alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <?php echo session()->getFlashdata('success'); ?>
          </div>
        <?php elseif (session()->getFlashdata('error')): ?>
          <div class="alert alert-error alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <?php echo session()->getFlashdata('error'); ?>
          </div>
        <?php endif; ?>

        <div class="box">
          <div class="box-header">
            <h3 class="box-title">Ajouter un Staff</h3>
          </div>
          <form role="form" action="<?php base_url('groups/create') ?>" method="post">
            <div class="box-body">
              <!-- validation -->
              <?php if (isset($validation)): ?>
                <div class="alert alert-danger">
                  <ul>
                    <?php foreach ($validation->getErrors() as $error): ?>
                      <li><?= esc($error) ?></li>
                    <?php endforeach; ?>
                  </ul>
                </div>
              <?php endif; ?>

              <div class="form-group">
                <label for="group_name">Désignation</label>
                <input type="text" class="form-control" id="group_name" name="group_name" placeholder="Enter group name">
              </div>
              <!-- <div class="form-group">
                <label for="permission">Permission</label> -->

                <!-- <table class="table table-responsive">
                  <thead>
                    <tr>
                      <th></th>
                      <th>Créer</th>
                      <th>Mise à jour</th>
                      <th>Voir</th>
                      <th>Supprimer</th>
                      <th>Assigner</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr>
                      <td>Commercial</td>
                      <td>-</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateCom" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewCom" class="minimal"></td>
                      <td>-</td>
                      <td>-</td>
                    </tr>
                    <tr>
                      <td>Utilisateurs</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="createUser" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateUser" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewUser" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="deleteUser" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="assignerUser" class="minimal"></td>
                    </tr>
                    <tr>
                      <td>Rôle</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="createGroup" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateGroup" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewGroup" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="deleteGroup" class="minimal"></td>
                      <td>-</td>
                    </tr>
                    <tr>
                      <td>Marques</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="createBrand" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateBrand" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewBrand" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="deleteBrand" class="minimal"></td>
                      <td>-</td>
                    </tr>
                    <tr>
                      <td>Categories</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="createCategory" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateCategory" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewCategory" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="deleteCategory" class="minimal"></td>
                      <td>-</td>
                    </tr>
                    <tr>
                      <td>Point de ventes</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="createStore" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateStore" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewStore" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="deleteStore" class="minimal"></td>
                      <td>-</td>
                    </tr>
                    <tr>
                      <td>Mécanicien</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="createMecanicien" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateMecanicien" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewMecanicien" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="deleteMecanicien" class="minimal"></td>
                      <td>-</td>
                    </tr>
                    <tr>
                      <td>Attributs</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="createAttribute" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateAttribute" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewAttribute" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="deleteAttribute" class="minimal"></td>
                      <td>-</td>
                    </tr>
                    <tr>
                      <td>Produits</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="createProduct" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateProduct" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewProduct" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="deleteProduct" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="assignerProduct" class="minimal"></td>
                    </tr>
                    <tr>
                      <td>Commandes</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="createOrder" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateOrder" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewOrder" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="deleteOrder" class="minimal"></td>
                      <td>-</td>
                    </tr>
                    <tr>
                    <tr>
                      <td>Recouvrement</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewRecouvrement" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="createRecouvrement" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateRecouvrement" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="deleteRecouvrement" class="minimal"></td>
                      <td>-</td>
                    </tr>
                    <tr>
                      <td>Décaissement</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewSortieCaisse" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="createSortieCaisse" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateSortieCaisse" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="deleteSortieCaisse" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="validateSortieCaisse" class="minimal"></td>
                     
                    </tr>
                    <tr>
                      <td>Remise</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewRemise" class="minimal"></td>
                       <td><input type="checkbox" name="permission[]" id="permission" value="validateRemise" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="refusedRemise" class="minimal"></td>
                      
                      <td>-</td>
                    </tr>
                    <tr>
                      <td>Validation commande</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="validateCommande1" class="minimal"></td>
                      <td>-</td>
                      <td>-</td>
                      <td>-</td>
                    </tr>
                    <tr>
                      <td>Securité</td>
                      <td> - </td>
                      <td> <input type="checkbox" name="permission[]" id="permission" value="viewSecurite" class="minimal"> </td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="createSecurite" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateSecurite" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="deleteSecurite" class="minimal"></td>
                    </tr>
                    <tr>
                      <td>Rapports</td>
                      <td>-</td>
                      <td>-</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewReports" class="minimal"></td>
                      <td>-</td>
                      <td>-</td>
                    </tr>
                    <tr>
                      <td>Avances</td>
                      <td> - </td>
                      <td> <input type="checkbox" name="permission[]" id="permission" value="viewAvance" class="minimal"> </td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="createAvance" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateAvance" class="minimal"></td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="deleteAvance" class="minimal"></td>
                    </tr>
                    <tr>
                      <td>Entreprise</td>
                      <td>-</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateCompany" class="minimal"></td>
                      <td>-</td>
                      <td>-</td>
                      <td>-</td>
                    </tr>
                    <tr>
                      <td>Profile</td>
                      <td>-</td>
                      <td>-</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="viewProfile" class="minimal"></td>
                      <td>-</td>
                      <td>-</td>
                    </tr>
                    <tr>
                      <td>Paramètre</td>
                      <td>-</td>
                      <td><input type="checkbox" name="permission[]" id="permission" value="updateSetting" class="minimal"></td>
                      <td>-</td>
                      <td>-</td>
                      <td>-</td>
                    </tr>
                  </tbody>
                </table> -->


              </div>
            </div>
            <!-- /.box-body -->

            <div class="box-footer">
              <button type="submit" class="btn btn-primary">Enregistrer</button>
              <a href="<?php echo base_url('groups/') ?>" class="btn btn-warning">Retour</a>
            </div>
          </form>
        </div>
        <!-- /.box -->
      </div>
      <!-- col-md-12 -->
    </div>
    <!-- /.row -->


  </section>
  <!-- /.content -->
</div>
<!-- /.content-wrapper -->

<script type="text/javascript">
  $(document).ready(function() {
    $("#mainUserNav").addClass('active');
    $("#addGroupNav").addClass('active');

    $('input[type="checkbox"].minimal').iCheck({
      checkboxClass: 'icheckbox_minimal-blue',
      radioClass: 'iradio_minimal-blue'
    });
  });
</script>