22 changed files with 3331 additions and 2356 deletions
File diff suppressed because it is too large
@ -1,125 +1,155 @@ |
|||
<!-- Content Wrapper. Contains page content --> |
|||
<div class="content-wrapper"> |
|||
<!-- Content Header (Page header) --> |
|||
<section class="content-header"> |
|||
<h1> |
|||
Gérer les |
|||
<small>Rôles</small> |
|||
</h1> |
|||
<ol class="breadcrumb"> |
|||
<li><a href="#"><i class="fa fa-dashboard"></i> Accueil</a></li> |
|||
<li class="active">Rôles</li> |
|||
</ol> |
|||
</section> |
|||
|
|||
|
|||
<!-- Main content --> |
|||
<section class="content"> |
|||
<!-- Small boxes (Stat box) --> |
|||
<div class="row"> |
|||
<div class="col-md-12 col-xs-12"> |
|||
|
|||
<!-- Content Wrapper. Contains page content --> |
|||
<div class="content-wrapper"> |
|||
<!-- Content Header (Page header) --> |
|||
<section class="content-header"> |
|||
<h1> |
|||
Gérer les |
|||
<small>Rôles</small> |
|||
</h1> |
|||
<ol class="breadcrumb"> |
|||
<li><a href="#"><i class="fa fa-dashboard"></i> Accueil</a></li> |
|||
<li class="active">Rôles</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">×</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">×</span></button> |
|||
<?php echo session()->getFlashdata('error'); ?> |
|||
</div> |
|||
<?php endif; ?> |
|||
<?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">×</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">×</span></button> |
|||
<?php echo session()->getFlashdata('error'); ?> |
|||
</div> |
|||
<?php endif; ?> |
|||
|
|||
<?php if(in_array('createGroup', $user_permission)): ?> |
|||
<a href="<?php echo base_url('groups/create') ?>" class="btn btn-primary">Ajouter un Rôle</a> |
|||
<br /> <br /> |
|||
<?php endif; ?> |
|||
<?php if(in_array('createGroup', $user_permission)): ?> |
|||
<a href="<?php echo base_url('groups/create') ?>" class="btn btn-primary">Ajouter un Rôle</a> |
|||
<br /> <br /> |
|||
<?php endif; ?> |
|||
|
|||
<div class="box"> |
|||
<div class="box-header"> |
|||
<h3 class="box-title">Gérer les Rôles</h3> |
|||
</div> |
|||
<!-- /.box-header --> |
|||
<div class="box-body"> |
|||
<table id="groupTable" class="table table-bordered table-striped"> |
|||
<thead> |
|||
<tr> |
|||
<th>Désignation</th> |
|||
<?php if(in_array('updateGroup', $user_permission) || in_array('deleteGroup', $user_permission)): ?> |
|||
<th>Action</th> |
|||
<?php endif; ?> |
|||
</tr> |
|||
</thead> |
|||
|
|||
<tbody> |
|||
<?php if($groups_data): ?> |
|||
<?php foreach ($groups_data as $k => $v): ?> |
|||
<tr> |
|||
<td><?php echo $v['group_name']; ?></td> |
|||
<div class="box"> |
|||
<div class="box-header"> |
|||
<h3 class="box-title">Gérer les Rôles</h3> |
|||
</div> |
|||
<!-- /.box-header --> |
|||
<div class="box-body"> |
|||
<table id="groupTable" class="table table-bordered table-striped"> |
|||
<thead> |
|||
<tr> |
|||
<th>Désignation</th> |
|||
<?php if(in_array('updateGroup', $user_permission) || in_array('deleteGroup', $user_permission)): ?> |
|||
<th>Action</th> |
|||
<?php endif; ?> |
|||
</tr> |
|||
</thead> |
|||
|
|||
<tbody> |
|||
<?php if($groups_data): ?> |
|||
<?php foreach ($groups_data as $k => $v): ?> |
|||
<tr> |
|||
<td><?php echo $v['group_name']; ?></td> |
|||
|
|||
<?php if(in_array('updateGroup', $user_permission) || in_array('deleteGroup', $user_permission)): ?> |
|||
<td> |
|||
<?php if(in_array('updateGroup', $user_permission)): ?> |
|||
<a href="<?php echo base_url('groups/edit/'.$v['id']) ?>" class="btn btn-default"><i class="fa fa-edit"></i></a> |
|||
<?php endif; ?> |
|||
<?php if(in_array('deleteGroup', $user_permission)): ?> |
|||
<a href="<?php echo base_url('groups/delete/'.$v['id']) ?>" class="btn btn-danger"><i class="fa fa-trash"></i></a> |
|||
<?php endif; ?> |
|||
</td> |
|||
<?php if(in_array('updateGroup', $user_permission) || in_array('deleteGroup', $user_permission)): ?> |
|||
<td> |
|||
<?php if(in_array('updateGroup', $user_permission)): ?> |
|||
<a href="<?php echo base_url('groups/edit/'.$v['id']) ?>" class="btn btn-default"><i class="fa fa-edit"></i></a> |
|||
<?php endif; ?> |
|||
<?php if(in_array('deleteGroup', $user_permission)): ?> |
|||
<button type="button" class="btn btn-danger" onclick="confirmDelete(<?php echo $v['id']; ?>, '<?php echo addslashes($v['group_name']); ?>')"> |
|||
<i class="fa fa-trash"></i> |
|||
</button> |
|||
<?php endif; ?> |
|||
</tr> |
|||
<?php endforeach ?> |
|||
<?php endif; ?> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!-- /.box-body --> |
|||
</td> |
|||
<?php endif; ?> |
|||
</tr> |
|||
<?php endforeach ?> |
|||
<?php endif; ?> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<!-- /.box --> |
|||
<!-- /.box-body --> |
|||
</div> |
|||
<!-- col-md-12 --> |
|||
<!-- /.box --> |
|||
</div> |
|||
<!-- /.row --> |
|||
|
|||
<!-- col-md-12 --> |
|||
</div> |
|||
<!-- /.row --> |
|||
</section> |
|||
<!-- /.content --> |
|||
</div> |
|||
<!-- /.content-wrapper --> |
|||
|
|||
</section> |
|||
<!-- /.content --> |
|||
<!-- Modal de confirmation de suppression --> |
|||
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel"> |
|||
<div class="modal-dialog" role="document"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
|||
<span aria-hidden="true">×</span> |
|||
</button> |
|||
<h4 class="modal-title" id="deleteModalLabel">Confirmation de suppression</h4> |
|||
</div> |
|||
<div class="modal-body"> |
|||
<p>Voulez-vous vraiment supprimer le rôle <strong id="roleName"></strong> ?</p> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<form id="deleteForm" method="post" style="display: inline;"> |
|||
<button type="button" class="btn btn-warning" data-dismiss="modal">Annuler</button> |
|||
<button type="submit" class="btn btn-danger" name="confirm" value="Oui"> |
|||
<i class="fa fa-trash"></i> Oui, supprimer |
|||
</button> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- /.content-wrapper --> |
|||
</div> |
|||
|
|||
<script type="text/javascript"> |
|||
$(document).ready(function() { |
|||
// datatable-fr.js |
|||
$.extend(true, $.fn.dataTable.defaults, { |
|||
language: { |
|||
sProcessing: "Traitement en cours...", |
|||
sSearch: "Rechercher :", |
|||
sLengthMenu: "Afficher _MENU_ éléments", |
|||
sInfo: "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments", |
|||
sInfoEmpty: "Affichage de l'élement 0 à 0 sur 0 élément", |
|||
sInfoFiltered: "(filtré de _MAX_ éléments au total)", |
|||
sLoadingRecords: "Chargement en cours...", |
|||
sZeroRecords: "Aucun élément à afficher", |
|||
sEmptyTable: "Aucune donnée disponible dans le tableau", |
|||
oPaginate: { |
|||
sFirst: "Premier", |
|||
sPrevious: "Précédent", |
|||
sNext: "Suivant", |
|||
sLast: "Dernier" |
|||
}, |
|||
oAria: { |
|||
sSortAscending: ": activer pour trier la colonne par ordre croissant", |
|||
sSortDescending: ": activer pour trier la colonne par ordre décroissant" |
|||
} |
|||
} |
|||
}); |
|||
<script type="text/javascript"> |
|||
$(document).ready(function() { |
|||
// datatable-fr.js |
|||
$.extend(true, $.fn.dataTable.defaults, { |
|||
language: { |
|||
sProcessing: "Traitement en cours...", |
|||
sSearch: "Rechercher :", |
|||
sLengthMenu: "Afficher _MENU_ éléments", |
|||
sInfo: "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments", |
|||
sInfoEmpty: "Affichage de l'élement 0 à 0 sur 0 élément", |
|||
sInfoFiltered: "(filtré de _MAX_ éléments au total)", |
|||
sLoadingRecords: "Chargement en cours...", |
|||
sZeroRecords: "Aucun élément à afficher", |
|||
sEmptyTable: "Aucune donnée disponible dans le tableau", |
|||
oPaginate: { |
|||
sFirst: "Premier", |
|||
sPrevious: "Précédent", |
|||
sNext: "Suivant", |
|||
sLast: "Dernier" |
|||
}, |
|||
oAria: { |
|||
sSortAscending: ": activer pour trier la colonne par ordre croissant", |
|||
sSortDescending: ": activer pour trier la colonne par ordre décroissant" |
|||
} |
|||
} |
|||
}); |
|||
|
|||
$('#groupTable').DataTable(); |
|||
$('#groupTable').DataTable(); |
|||
|
|||
$("#mainUserNav").addClass('active'); |
|||
$("#manageGroupNav").addClass('active'); |
|||
}); |
|||
</script> |
|||
$("#mainUserNav").addClass('active'); |
|||
$("#manageGroupNav").addClass('active'); |
|||
}); |
|||
|
|||
// Fonction pour ouvrir le modal de confirmation |
|||
function confirmDelete(id, name) { |
|||
$('#roleName').text(name); |
|||
$('#deleteForm').attr('action', '<?php echo base_url('groups/delete/'); ?>' + id); |
|||
$('#deleteModal').modal('show'); |
|||
} |
|||
</script> |
|||
File diff suppressed because it is too large
Loading…
Reference in new issue