fixed dashboard
This commit is contained in:
@@ -344,8 +344,13 @@
|
||||
const linee = $('#lineeSelect').val();
|
||||
fetch('save_matrice_linee.php', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ id, linee })
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
id,
|
||||
linee
|
||||
})
|
||||
}).then(r => r.json()).then(d => {
|
||||
Swal.fire({
|
||||
icon: d.success ? 'success' : 'error',
|
||||
@@ -360,33 +365,43 @@
|
||||
const id = $(this).data('id');
|
||||
const nome = $(this).data('nome');
|
||||
$('#idMatriceMescole').val(id);
|
||||
$('.modal-title').text('Associa Mescole a ' + nome);
|
||||
|
||||
$('#associaMescoleModal .modal-title').text('Associa Mescole a ' + nome);
|
||||
|
||||
fetch('get_mescole_matrice.php?id=' + id)
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
const sel = $('#mescoleSelect');
|
||||
sel.empty();
|
||||
|
||||
data.tutte.forEach(m => {
|
||||
const selected = data.associate.includes(m.id.toString()) ? 'selected' : '';
|
||||
sel.append(`<option value="${m.id}" ${selected}>${m.nome}</option>`);
|
||||
});
|
||||
|
||||
sel.select2({
|
||||
theme: 'bootstrap-5',
|
||||
width: '100%'
|
||||
});
|
||||
|
||||
$('#associaMescoleModal').modal('show');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#associaMescoleForm').on('submit', e => {
|
||||
e.preventDefault();
|
||||
const id = $('#idMatriceMescole').val();
|
||||
const mescole = $('#mescoleSelect').val();
|
||||
fetch('save_matrice_mescole.php', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ id, mescole })
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
id,
|
||||
mescole
|
||||
})
|
||||
}).then(r => r.json()).then(d => {
|
||||
Swal.fire({
|
||||
icon: d.success ? 'success' : 'error',
|
||||
@@ -399,4 +414,4 @@
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
Reference in New Issue
Block a user