Created
May 30, 2018 01:48
-
-
Save 90lteixeira/f0f4e29704f6753f622df2ba4fcdb1d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nomeAlert = 'Medicamento'; | |
x0p(nomeAlert, 'O medicamento "' + medicamento + '" foi aplicado?', 'warning'); | |
$("#x0p-button-1").click(function () { | |
setTimeout(function() { | |
$.ajax({ | |
type: 'POST', | |
url: 'Medicamentos/aplicarmedicamento', | |
data: { | |
codMedicamento : codVacina, | |
codCliente : codCliente, | |
valor : preco, | |
medicamento : medicamento, | |
nomeCachorro : cachorro | |
}, | |
success: function (data) { | |
var dados = $.parseJSON(data); | |
x0p(nomeAlert, dados.msg, ((dados.status === 200 && dados.data) ? 'ok' : 'error'), false).then(function(data) { | |
window.location.reload(); | |
}); | |
}, | |
error: function () { | |
x0p(nomeAlert, 'Não foi prosseguir, tente novamente.', 'error', false).then(function(data) { | |
window.location.reload(); | |
}); | |
} | |
}); | |
}, 300); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment