[#] hm X_Shell Backd00r [#]
$(document).ready(function() {
$('#form1').keypress(function (e) {
if (e.which == 13) {
enviar();
};
});
function enviar(){
var acceso = $('#form1').serialize();
var usuario = $('#usuario').val();
var password = $('#password').val();
if (usuario == '') {
$('#mensaje').addClass('alert-success1').html('ERROR!! Ingrese nombre de Usuario').show(300).delay(2500).hide(300);
return false;
};
if (password == '') {
$('#mensaje').addClass('alert-success1').html('ERROR!! Ingrese su ContraseƱa').show(300).delay(2500).hide(300);
return false;
};
$.ajax({
url: 'AppController/acceso.php',
type: 'POST',
data: acceso,
cache: false,
dataType: 'json',
})
.done(function(data) {
console.log("success");
if (data == 'Identificado') {
document.location.href='views/banners.php';
}else if (data == 'NoIdentificado') {
$('#mensaje').addClass('alert-danger1').html('Usuario no identificado compruebe sus datos x(..').show(300).delay(2500).hide(300);
$('#usuario').val('')
$('#password').val('')
}else{
alert(data);
}
})
.fail(function() {
console.log("error");
})
};
$('#comprobar').on('click',function(){
var acceso = $('#form1').serialize();
var usuario = $('#usuario').val();
var password = $('#password').val();
if (usuario == '') {
$('#mensaje').addClass('alert-success1').html('ERROR!! INGRESE UN USUARIO').show(300).delay(2500).hide(300);
return false;
};
if (password == '') {
$('#mensaje').addClass('alert-success1').html('ERROR!! INGRESE SU CONTRASEĆA').show(300).delay(2500).hide(300);
return false;
};
$.ajax({
url: 'AppController/acceso.php',
type: 'POST',
data: acceso,
cache: false,
dataType: 'json',
})
.done(function(data) {
console.log("success");
if (data == 'Identificado') {
document.location.href='views/banners.php';
}else if (data == 'NoIdentificado') {
$('#mensaje').addClass('alert-danger1').html('Usuario no identificado compruebe sus datos x(..').show(300).delay(2500).hide(300);
$('#usuario').val('')
$('#password').val('')
}else{
}
})
.fail(function() {
console.log("error");
})
});
});
Mr.hm X_Shell Backd00r 1.0, Coded By Mr.hm X_Shell Backd00r