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 --> |
<?php if(session()->getFlashdata('success')): ?> |
||||
<div class="content-wrapper"> |
<div class="alert alert-success alert-dismissible" role="alert"> |
||||
<!-- Content Header (Page header) --> |
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> |
||||
<section class="content-header"> |
<?php echo session()->getFlashdata('success'); ?> |
||||
<h1> |
</div> |
||||
Gérer les |
<?php elseif(session()->getFlashdata('error')): ?> |
||||
<small>Rôles</small> |
<div class="alert alert-error alert-dismissible" role="alert"> |
||||
</h1> |
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> |
||||
<ol class="breadcrumb"> |
<?php echo session()->getFlashdata('error'); ?> |
||||
<li><a href="#"><i class="fa fa-dashboard"></i> Accueil</a></li> |
</div> |
||||
<li class="active">Rôles</li> |
<?php endif; ?> |
||||
</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(in_array('createGroup', $user_permission)): ?> |
<?php if(in_array('createGroup', $user_permission)): ?> |
||||
<a href="<?php echo base_url('groups/create') ?>" class="btn btn-primary">Ajouter un Rôle</a> |
<a href="<?php echo base_url('groups/create') ?>" class="btn btn-primary">Ajouter un Rôle</a> |
||||
<br /> <br /> |
<br /> <br /> |
||||
<?php endif; ?> |
<?php endif; ?> |
||||
|
|
||||
<div class="box"> |
<div class="box"> |
||||
<div class="box-header"> |
<div class="box-header"> |
||||
<h3 class="box-title">Gérer les Rôles</h3> |
<h3 class="box-title">Gérer les Rôles</h3> |
||||
</div> |
</div> |
||||
<!-- /.box-header --> |
<!-- /.box-header --> |
||||
<div class="box-body"> |
<div class="box-body"> |
||||
<table id="groupTable" class="table table-bordered table-striped"> |
<table id="groupTable" class="table table-bordered table-striped"> |
||||
<thead> |
<thead> |
||||
<tr> |
<tr> |
||||
<th>Désignation</th> |
<th>Désignation</th> |
||||
<?php if(in_array('updateGroup', $user_permission) || in_array('deleteGroup', $user_permission)): ?> |
<?php if(in_array('updateGroup', $user_permission) || in_array('deleteGroup', $user_permission)): ?> |
||||
<th>Action</th> |
<th>Action</th> |
||||
<?php endif; ?> |
<?php endif; ?> |
||||
</tr> |
</tr> |
||||
</thead> |
</thead> |
||||
|
|
||||
<tbody> |
<tbody> |
||||
<?php if($groups_data): ?> |
<?php if($groups_data): ?> |
||||
<?php foreach ($groups_data as $k => $v): ?> |
<?php foreach ($groups_data as $k => $v): ?> |
||||
<tr> |
<tr> |
||||
<td><?php echo $v['group_name']; ?></td> |
<td><?php echo $v['group_name']; ?></td> |
||||
|
|
||||
<?php if(in_array('updateGroup', $user_permission) || in_array('deleteGroup', $user_permission)): ?> |
<?php if(in_array('updateGroup', $user_permission) || in_array('deleteGroup', $user_permission)): ?> |
||||
<td> |
<td> |
||||
<?php if(in_array('updateGroup', $user_permission)): ?> |
<?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> |
<a href="<?php echo base_url('groups/edit/'.$v['id']) ?>" class="btn btn-default"><i class="fa fa-edit"></i></a> |
||||
<?php endif; ?> |
<?php endif; ?> |
||||
<?php if(in_array('deleteGroup', $user_permission)): ?> |
<?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> |
<button type="button" class="btn btn-danger" onclick="confirmDelete(<?php echo $v['id']; ?>, '<?php echo addslashes($v['group_name']); ?>')"> |
||||
<?php endif; ?> |
<i class="fa fa-trash"></i> |
||||
</td> |
</button> |
||||
<?php endif; ?> |
<?php endif; ?> |
||||
</tr> |
</td> |
||||
<?php endforeach ?> |
<?php endif; ?> |
||||
<?php endif; ?> |
</tr> |
||||
</tbody> |
<?php endforeach ?> |
||||
</table> |
<?php endif; ?> |
||||
</div> |
</tbody> |
||||
<!-- /.box-body --> |
</table> |
||||
</div> |
</div> |
||||
<!-- /.box --> |
<!-- /.box-body --> |
||||
</div> |
</div> |
||||
<!-- col-md-12 --> |
<!-- /.box --> |
||||
</div> |
</div> |
||||
<!-- /.row --> |
<!-- col-md-12 --> |
||||
|
</div> |
||||
|
<!-- /.row --> |
||||
|
</section> |
||||
|
<!-- /.content --> |
||||
|
</div> |
||||
|
<!-- /.content-wrapper --> |
||||
|
|
||||
</section> |
<!-- Modal de confirmation de suppression --> |
||||
<!-- /.content --> |
<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> |
</div> |
||||
<!-- /.content-wrapper --> |
</div> |
||||
|
|
||||
<script type="text/javascript"> |
<script type="text/javascript"> |
||||
$(document).ready(function() { |
$(document).ready(function() { |
||||
// datatable-fr.js |
// datatable-fr.js |
||||
$.extend(true, $.fn.dataTable.defaults, { |
$.extend(true, $.fn.dataTable.defaults, { |
||||
language: { |
language: { |
||||
sProcessing: "Traitement en cours...", |
sProcessing: "Traitement en cours...", |
||||
sSearch: "Rechercher :", |
sSearch: "Rechercher :", |
||||
sLengthMenu: "Afficher _MENU_ éléments", |
sLengthMenu: "Afficher _MENU_ éléments", |
||||
sInfo: "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments", |
sInfo: "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments", |
||||
sInfoEmpty: "Affichage de l'élement 0 à 0 sur 0 élément", |
sInfoEmpty: "Affichage de l'élement 0 à 0 sur 0 élément", |
||||
sInfoFiltered: "(filtré de _MAX_ éléments au total)", |
sInfoFiltered: "(filtré de _MAX_ éléments au total)", |
||||
sLoadingRecords: "Chargement en cours...", |
sLoadingRecords: "Chargement en cours...", |
||||
sZeroRecords: "Aucun élément à afficher", |
sZeroRecords: "Aucun élément à afficher", |
||||
sEmptyTable: "Aucune donnée disponible dans le tableau", |
sEmptyTable: "Aucune donnée disponible dans le tableau", |
||||
oPaginate: { |
oPaginate: { |
||||
sFirst: "Premier", |
sFirst: "Premier", |
||||
sPrevious: "Précédent", |
sPrevious: "Précédent", |
||||
sNext: "Suivant", |
sNext: "Suivant", |
||||
sLast: "Dernier" |
sLast: "Dernier" |
||||
}, |
}, |
||||
oAria: { |
oAria: { |
||||
sSortAscending: ": activer pour trier la colonne par ordre croissant", |
sSortAscending: ": activer pour trier la colonne par ordre croissant", |
||||
sSortDescending: ": activer pour trier la colonne par ordre décroissant" |
sSortDescending: ": activer pour trier la colonne par ordre décroissant" |
||||
} |
} |
||||
} |
} |
||||
}); |
}); |
||||
|
|
||||
$('#groupTable').DataTable(); |
$('#groupTable').DataTable(); |
||||
|
|
||||
$("#mainUserNav").addClass('active'); |
$("#mainUserNav").addClass('active'); |
||||
$("#manageGroupNav").addClass('active'); |
$("#manageGroupNav").addClass('active'); |
||||
}); |
}); |
||||
</script> |
|
||||
|
// 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