-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
48 lines (44 loc) · 1.38 KB
/
script.js
File metadata and controls
48 lines (44 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$(function() {
$('table').DataTable();
// CREER UNE FACTURE
$('#create').on('click', function(e){
let formOrder = $('#formOrder')
if(formOrder[0].checkValidity()){
e.preventDefault();
$.ajax({
url: 'requette_ajax.php',
type: 'post',
data: formOrder.serialize() + '&action=create',
success: function(response){
// console.log(response);
$('#createModal').modal('hide');
Swal.fire({
icon: 'success',
title: 'Succès',
})
formOrder[0].reset();
}
})
}
})
// Récuperer les factures
getFactures();
function getFactures(){
$.ajax({
url: 'requette_ajax.php',
type: 'post',
data: { action: 'fetch'},
success: function(response){
$('#orderTable').html(response);
$('#table').DataTable();
// console.log(response);
// $('#createModal').modal('hide');
// Swal.fire({
// icon: 'success',
// title: 'Succès',
// })
// formOrder[0].reset();
}
});
}
});