Mise a jour Modals Tables
This commit is contained in:
parent
78515d6c87
commit
89fb69f680
@ -1,15 +1,3 @@
|
|||||||
/* Global styles */
|
|
||||||
body {
|
|
||||||
font-family: 'Arial', sans-serif;
|
|
||||||
background-color: #f9f9f9;
|
|
||||||
color: #333;
|
|
||||||
margin: 0;
|
|
||||||
padding: 20px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Page container */
|
/* Page container */
|
||||||
.page-container {
|
.page-container {
|
||||||
|
@ -1,16 +1,10 @@
|
|||||||
/* Global styles */
|
|
||||||
body {
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
margin: 20px;
|
|
||||||
background-color: #f9f9f9;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
text-align: center;
|
/*h1 {*/
|
||||||
color: #db5559;
|
/* text-align: center;*/
|
||||||
margin-bottom: 20px;
|
/* color: #db5559;*/
|
||||||
}
|
/* margin-bottom: 20px;*/
|
||||||
|
/*}*/
|
||||||
|
|
||||||
/* Table styles */
|
/* Table styles */
|
||||||
.table {
|
.table {
|
||||||
|
@ -1,15 +1,3 @@
|
|||||||
/* Global styles */
|
|
||||||
body {
|
|
||||||
font-family: 'Arial', sans-serif;
|
|
||||||
background-color: #fff5f5;
|
|
||||||
color: #333;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Page container */
|
/* Page container */
|
||||||
.page-container {
|
.page-container {
|
||||||
|
77
public/js/GestionTables/GestionTables.js
Normal file
77
public/js/GestionTables/GestionTables.js
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
document.querySelector('.btn-gestion-table').addEventListener('click', function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
document.getElementById('container_modal');
|
||||||
|
|
||||||
|
fetch('/tables')
|
||||||
|
.then(response => {
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error('Erreur de chargement de la section Promotions');
|
||||||
|
}
|
||||||
|
return response.text();
|
||||||
|
})
|
||||||
|
.then(html => {
|
||||||
|
// Insérer le HTML dans le conteneur et l'afficher
|
||||||
|
container_modal.innerHTML = html;
|
||||||
|
container_modal.style.display = 'block';
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Erreur:', error);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function addTable (event) {
|
||||||
|
document.getElementById('container_modal');
|
||||||
|
|
||||||
|
fetch(`/tables/new`)
|
||||||
|
.then(response => {
|
||||||
|
return response.text();
|
||||||
|
})
|
||||||
|
.then(html => {
|
||||||
|
// Insérer le HTML dans le conteneur et l'afficher
|
||||||
|
container_modal.innerHTML = html;
|
||||||
|
container_modal.style.display = 'block';
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Erreur:', error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function updateTable (event) {
|
||||||
|
document.getElementById('container_modal');
|
||||||
|
const reductionsIdString = event.getAttribute('data-id');
|
||||||
|
let reductionsId = parseInt(reductionsIdString);
|
||||||
|
|
||||||
|
fetch(`/reductions/${reductionsId}/edit`)
|
||||||
|
.then(response => {
|
||||||
|
return response.text();
|
||||||
|
})
|
||||||
|
.then(html => {
|
||||||
|
// Insérer le HTML dans le conteneur et l'afficher
|
||||||
|
container_modal.innerHTML = html;
|
||||||
|
container_modal.style.display = 'block';
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Erreur:', error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function deletePromotion (event) {
|
||||||
|
document.getElementById('container_modal');
|
||||||
|
const reductionsIdString = event.getAttribute('data-id');
|
||||||
|
let reductionsId = parseInt(reductionsIdString);
|
||||||
|
|
||||||
|
fetch(`/reductions/${reductionsId}`)
|
||||||
|
.then(response => {
|
||||||
|
return response.text();
|
||||||
|
})
|
||||||
|
.then(html => {
|
||||||
|
// Insérer le HTML dans le conteneur et l'afficher
|
||||||
|
container_modal.innerHTML = html;
|
||||||
|
container_modal.style.display = 'block';
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Erreur:', error);
|
||||||
|
});
|
||||||
|
}
|
@ -41,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<div class="btn-custom icon-container">
|
<div class="btn-custom btn-gestion-table icon-container">
|
||||||
<i class="icon-medium"> {{ ux_icon('ic:outline-table-bar') }}</i>
|
<i class="icon-medium"> {{ ux_icon('ic:outline-table-bar') }}</i>
|
||||||
<span>Gérer Table</span>
|
<span>Gérer Table</span>
|
||||||
</div>
|
</div>
|
||||||
@ -134,4 +134,5 @@
|
|||||||
<script src="{{ asset('js/Compte/CompteModal.js') }}" defer></script>
|
<script src="{{ asset('js/Compte/CompteModal.js') }}" defer></script>
|
||||||
<script src="{{ asset('js/GestionUtilisateurs/GestionUtilisateurs.js') }}" defer></script>
|
<script src="{{ asset('js/GestionUtilisateurs/GestionUtilisateurs.js') }}" defer></script>
|
||||||
<script src="{{ asset('js/GestionPromotion/GestionPromotion.js') }}" defer></script>
|
<script src="{{ asset('js/GestionPromotion/GestionPromotion.js') }}" defer></script>
|
||||||
|
<script src="{{ asset('js/GestionTables/GestionTables.js') }}" defer></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -35,5 +35,9 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<a href="{{ path('app_tables_new') }}">Créer une nouvelle table</a>
|
<button onclick="addTable(this)" href="{{ path('app_reductions_new') }}">Créer une tables</button>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block javascripts %}
|
||||||
|
<script src="{{ asset('js/GestionPromotion/GestionPromotion.js') }}" defer></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user