add semakin imut
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
$(document).ready(function() {
|
||||
$('#butsave').on('click', function() {
|
||||
$("#butsave").attr("disabled", "disabled");
|
||||
|
||||
var username = $('#username').val();
|
||||
var password = $('#password').val();
|
||||
|
||||
if (username != "" && password != "") {
|
||||
$.ajax({
|
||||
url: "model/logon.php?login=true",
|
||||
type: "POST",
|
||||
data: {
|
||||
|
||||
username: username,
|
||||
password: password,
|
||||
},
|
||||
cache: false,
|
||||
success: function(dataResult) {
|
||||
var dataResult = JSON.parse(dataResult);
|
||||
if (dataResult.statusCode == 200) {
|
||||
$("#butsave").removeAttr("disabled");
|
||||
$("#success").show();
|
||||
$('#success').html('berhasil login !');
|
||||
} else if (dataResult.statusCode == 201) {
|
||||
alert('Username atau Password tidak sesuai. Silahkan diulang kembali!');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
window.location.reload();
|
||||
|
||||
} else {
|
||||
alert('Username dan password tidak boleh kosong !');
|
||||
}
|
||||
|
||||
window.location.reload();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user