mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-22 01:16:26 +02:00
Mise en place des dossiers pour les templates
This commit is contained in:
parent
01aad35f7d
commit
59b35b09c2
39 changed files with 63 additions and 136 deletions
77
templates/groups/add.php
Executable file
77
templates/groups/add.php
Executable file
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
//Template dashboard
|
||||
$incs = new internalIncs();
|
||||
$incs->head('Groups - Add');
|
||||
?>
|
||||
<div id="wrapper">
|
||||
<?php
|
||||
$incs->nav('groups');
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
Nouveau groupe
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li>
|
||||
<i class="fa fa-dashboard"></i> <a href="<?php echo $this->generateUrl('dashboard'); ?>">Dashboard</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-group"></i> <a href="<?php echo $this->generateUrl('groups'); ?>">Groupes</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<i class="fa fa-plus"></i> Nouveau
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-group fa-fw"></i> Ajout d'un groupe</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="<?php echo $this->generateUrl('groups', 'create', [$_SESSION['csrf']]);?>" method="POST">
|
||||
<div class="form-group">
|
||||
<label>Nom du groupe</label>
|
||||
<div class="form-group input-group">
|
||||
<span class="input-group-addon"><span class="fa fa-users"></span></span>
|
||||
<input name="name" class="form-control" type="text" placeholder="Nom groupe" autofocus required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Contacts au groupe</label>
|
||||
<input class="add-contacts form-control" name="contacts[]"/>
|
||||
</div>
|
||||
<a class="btn btn-danger" href="<?php echo $this->generateUrl('groups'); ?>">Annuler</a>
|
||||
<input type="submit" class="btn btn-success" value="Enregistrer le contact" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
jQuery('.add-contacts').each(function()
|
||||
{
|
||||
jQuery(this).magicSuggest({
|
||||
data: '<?php echo $this->generateUrl('contacts', 'jsonGetContacts'); ?>',
|
||||
valueField: 'id',
|
||||
displayField: 'name',
|
||||
name: 'contacts[]'
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$incs->footer();
|
104
templates/groups/default.php
Executable file
104
templates/groups/default.php
Executable file
|
@ -0,0 +1,104 @@
|
|||
<?php
|
||||
//Template dashboard
|
||||
$incs = new internalIncs();
|
||||
$incs->head('Groups - Show All');
|
||||
?>
|
||||
<div id="wrapper">
|
||||
<?php
|
||||
$incs->nav('groups');
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
Dashboard <small>Groupes</small>
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li>
|
||||
<i class="fa fa-dashboard"></i> <a href="<?php echo $this->generateUrl('dashboard'); ?>">Dashboard</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<i class="fa fa-group"></i> Groupes
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-group fa-fw"></i> Liste des groupes</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover table-striped" id="table-groups">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Nom</th>
|
||||
<th>Nombre de contacts</th>
|
||||
<th style="width:5%;">Sélectionner</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($groups as $group)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td><?php secho($group['id']); ?></td>
|
||||
<td><?php secho($group['name']); ?></td>
|
||||
<td><?php secho($group['nb_contacts']); ?></td>
|
||||
<td><input type="checkbox" value="<?php secho($group['id']); ?>"></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<div class="col-xs-6 no-padding">
|
||||
<a class="btn btn-success" href="<?php echo $this->generateUrl('groups', 'add'); ?>"><span class="fa fa-plus"></span> Ajouter un groupe</a>
|
||||
</div>
|
||||
<div class="text-right col-xs-6 no-padding">
|
||||
<strong>Action groupée :</strong>
|
||||
<div class="btn-group action-dropdown" target="#table-groups">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Action pour la sélection <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu pull-right" role="menu">
|
||||
<li><a href="<?php echo $this->generateUrl('groups', 'edit'); ?>"><span class="fa fa-edit"></span> Modifier</a></li>
|
||||
<li><a href="<?php echo $this->generateUrl('groups', 'delete', [$_SESSION['csrf']]); ?>"><span class="fa fa-trash-o"></span> Supprimer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
jQuery(document).ready(function ()
|
||||
{
|
||||
jQuery('.action-dropdown a').on('click', function (e)
|
||||
{
|
||||
e.preventDefault();
|
||||
var target = jQuery(this).parents('.action-dropdown').attr('target');
|
||||
var url = jQuery(this).attr('href');
|
||||
jQuery(target).find('input:checked').each(function ()
|
||||
{
|
||||
url += '/' + jQuery(this).val();
|
||||
});
|
||||
window.location = url;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$incs->footer();
|
91
templates/groups/edit.php
Executable file
91
templates/groups/edit.php
Executable file
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
//Template dashboard
|
||||
$incs = new internalIncs();
|
||||
$incs->head('Groupes - Edit');
|
||||
?>
|
||||
<div id="wrapper">
|
||||
<?php
|
||||
$incs->nav('groups');
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
Modification groupes
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li>
|
||||
<i class="fa fa-dashboard"></i> <a href="<?php echo $this->generateUrl('dashboard'); ?>">Dashboard</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-group"></i> <a href="<?php echo $this->generateUrl('groups'); ?>">Groupes</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<i class="fa fa-edit"></i> Modifier
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-edit fa-fw"></i> Modification de groupes</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="<?php echo $this->generateUrl('groups', 'update', [$_SESSION['csrf']]);?>" method="POST">
|
||||
<?php
|
||||
foreach ($groups as $group)
|
||||
{
|
||||
$contacts = array();
|
||||
foreach ($group['contacts'] as $contact)
|
||||
{
|
||||
$contacts[] = (int)$contact['id'];
|
||||
}
|
||||
$contacts = json_encode($contacts);
|
||||
|
||||
?>
|
||||
<div class="form-group">
|
||||
<label>Nom groupe</label>
|
||||
<div class="form-group input-group">
|
||||
<span class="input-group-addon"><span class="fa fa-user"></span></span>
|
||||
<input name="groups[<?php secho($group['id']); ?>][name]" class="form-control" type="text" placeholder="Nom groupe" autofocus required value="<?php secho($group['name']); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Contacts du groupe</label>
|
||||
<input class="add-contacts form-control" name="groups[<?php secho($group['id']); ?>][contacts][]" value="<?php secho($contacts); ?>"/>
|
||||
</div>
|
||||
<hr/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<a class="btn btn-danger" href="<?php echo $this->generateUrl('groups'); ?>">Annuler</a>
|
||||
<input type="submit" class="btn btn-success" value="Enregistrer le contact" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
jQuery('.add-contacts').each(function()
|
||||
{
|
||||
jQuery(this).magicSuggest({
|
||||
data: '<?php echo $this->generateUrl('contacts', 'jsonGetContacts'); ?>',
|
||||
valueField: 'id',
|
||||
displayField: 'name',
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$incs->footer();
|
Loading…
Add table
Add a link
Reference in a new issue