Ajout de la BD OCOM

This commit is contained in:
George Frederick "Buzz" Beurling
2020-03-14 09:51:26 -04:00
parent 7433051f85
commit 8a0e09cb80
12 changed files with 434 additions and 40 deletions

39
public/js/ocom.js vendored Normal file
View File

@@ -0,0 +1,39 @@
function deleteOCOM(id)
{
Swal.fire({
title: 'Êtes vous certain ?',
text: "Vous ne pourrez annuler cette action",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Oui',
cancelButtonText: 'Non'
}).then((result) => {
if (result.value) {
let request = $.ajax({
url: "/api/ocom/"+id,
method: "DELETE",
data: { api_token : api_token },
dataType: "html"
});
request.done(function (msg) {
Swal.fire(
'Supprimé!',
'Le fichier a été supprimé',
'success'
).then(() => {
window.location.href = '/admin/ocom';
});
});
request.fail(function (jqXHR, textStatus) {
Swal.fire({
type: 'error',
title: 'Oops...',
text: 'Le cours n\'a pas pus être supprimé',
footer: '<small>'+textStatus+'</small>'
})
})
}
});
}

View File

@@ -1,5 +1,4 @@
{
"/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css",
"/css/material-dashboard.css": "/css/material-dashboard.css",
"/css/custom.css": "/css/custom.css"