File: /home/ser65kty/metahack.serversmw.com/resources/js/enable.js
$('.eliminar').on('click', function () {
var id = $(this).parents("tr").attr("id");
var nome = $(this).parents("tr").attr("name");
var pathname = window.location.pathname;
$.confirm({
backgroundDismiss: true,
icon: 'fa fa-times',
closeIcon: 'true',
type: 'red',
theme: 'modern',
title: 'Confirmación',
content: '¿Seguro que quiere eliminar <b>'+ nome +'</b>?<br>Después de eliminarlo no lo podrá recuperar',
buttons: {
Eliminar: {
btnClass: 'btn-red',
action: function () {
window.location = pathname + '/' + id + '/destroy';
},
},
Cancelar: {
btnClass: 'btn-blue',
cancel: function () {
//
},
},
}
});
});
$('.eliminarfront').on('click', function () {
var id = $(this).parents("tr").attr("id");
var nome = $(this).parents("tr").attr("name");
var pathname = window.location.pathname;
$.confirm({
backgroundDismiss: true,
icon: 'fa fa-times',
closeIcon: 'true',
type: 'red',
theme: 'modern',
title: 'Confirmación',
content: '¿Seguro que quiere eliminar este ticket?<br>Después de eliminarlo no lo podrá recuperar',
buttons: {
Eliminar: {
btnClass: 'btn-red',
action: function () {
window.location = '/account/' + id + '/destroyfront';
},
},
Cancelar: {
btnClass: 'btn-blue',
cancel: function () {
//
},
},
}
});
});
$('.eliminarimg').on('click', function () {
var id = $(this).parents("div").attr("id");
var nome = $(this).parents("div").attr("name");
var pathname = '/admin/documentos/files';
$.confirm({
backgroundDismiss: true,
icon: 'fa fa-times',
closeIcon: 'true',
type: 'red',
theme: 'modern',
title: 'Confirmación',
content: '¿Seguro que quiere eliminar <b>'+ nome +'</b>?<br>Después de eliminarlo no lo podrá recuperar',
buttons: {
Eliminar: {
btnClass: 'btn-red',
action: function () {
window.location = pathname + '/' + id + '/destroy';
},
},
Cancelar: {
btnClass: 'btn-blue',
cancel: function () {
//
},
},
}
});
});
$('.desactivar').on('click', function () {
var id = $(this).parents("tr").attr("id");
var nome = $(this).parents("tr").attr("name");
var pathname = window.location.pathname;
$.confirm({
backgroundDismiss: true,
icon: 'fa fa-ban',
closeIcon: 'true',
type: 'red',
theme: 'modern',
title: 'Confirmación',
content: '¿Seguro que quiere desactivar <b>'+ nome +'</b>?<br> ' + nome + ' irá a la papelera',
buttons: {
Desactivar: {
btnClass: 'btn-red',
action: function () {
window.location = pathname + '/' + id + '/desactivar';
},
},
Cancelar: {
btnClass: 'btn-blue',
cancel: function () {
//
},
},
}
});
});
$('.desactivartickets').on('click', function () {
var id = $(this).parents("tr").attr("id");
var nome = $(this).parents("tr").attr("name");
var pathname = window.location.pathname;
$.confirm({
backgroundDismiss: true,
icon: 'fa fa-ban',
closeIcon: 'true',
type: 'red',
theme: 'modern',
title: 'Confirmación',
content: '¿Seguro que quiere desactivar el ticket?<br> El ticket irá a la papelera y los puntos no se contabilizarán para el usuario',
buttons: {
Desactivar: {
btnClass: 'btn-red',
action: function () {
window.location = pathname + '/' + id + '/desactivar';
},
},
Cancelar: {
btnClass: 'btn-blue',
cancel: function () {
//
},
},
}
});
});
$('.activar').on('click', function () {
var id = $(this).parents("tr").attr("id");
var nome = $(this).parents("tr").attr("name");
$.confirm({
backgroundDismiss: true,
icon: 'fa fa-check',
closeIcon: 'true',
type: 'green',
theme: 'modern',
title: 'Confirmación',
content: '¿Seguro que quiere activar <b>'+ nome +'</b>?',
buttons: {
Activar: {
btnClass: 'btn-green',
action: function () {
window.location = 'alunos/' + id + '/ativar';
},
},
Cancelar: {
btnClass: 'btn-blue',
cancel: function () {
//
},
},
}
});
});
$('.activarusers').on('click', function () {
var id = $(this).parents("tr").attr("id");
var nome = $(this).parents("tr").attr("name");
$.confirm({
backgroundDismiss: true,
icon: 'fa fa-check',
closeIcon: 'true',
type: 'green',
theme: 'modern',
title: 'Confirmación',
content: '¿Seguro que quiere activar <b>'+ nome +'</b>?',
buttons: {
Activar: {
btnClass: 'btn-green',
action: function () {
window.location = 'users/' + id + '/activar';
},
},
Cancelar: {
btnClass: 'btn-blue',
cancel: function () {
//
},
},
}
});
});
$('.activardocuments').on('click', function () {
var id = $(this).parents("tr").attr("id");
var nome = $(this).parents("tr").attr("name");
$.confirm({
backgroundDismiss: true,
icon: 'fa fa-check',
closeIcon: 'true',
type: 'green',
theme: 'modern',
title: 'Confirmación',
content: '¿Seguro que quiere activar el ticket <b>'+ nome +'</b>?',
buttons: {
Activar: {
btnClass: 'btn-green',
action: function () {
window.location = 'documents/' + id + '/activar';
},
},
Cancelar: {
btnClass: 'btn-blue',
cancel: function () {
//
},
},
}
});
});