/**
* User: lukas
* Date: 06.01.2016
* Time: 15:39
*/
$(document).ready(function () {
$('#send').click(function () {
var username = $("#uName").val();
var password = $("#uPass").val();
var dataString = 'uName=' + username + '&uPass=' + password;
if ($.trim(username).length > 0 && $.trim(password).length > 0) {
$.ajax({
type: "POST",
url: "./include/login_form.php",
data: dataString,
cache: false,
success: function (data) {
if (data) {
$('#err').html('
Erfolgreich: ' + data + '
');
window.setTimeout(function () {
location.reload();
}, 2000);
}
else {
$("#err").html('Error: Ungültiger Benutzername und/oder Passwort!
');
}
}
});
} else {
$("#err").html('Error: Bitte alle Felder ausfüllen!
');
}
return false;
});
$('#send_code').click(function () {
var code = $("#uCode").val();
var dataString = 'uCode=' + code;
if ($.trim(code).length > 0) {
$.ajax({
type: "POST",
url: "./include/login_form.php",
data: dataString,
cache: false,
success: function (data) {
if (data) {
$('#err').html('Erfolgreich: ' + data + '
');
window.setTimeout(function () {
location.reload();
}, 2000);
}
else {
$("#err").html('Error: Ungültiger Code!
');
}
}
});
}
return false;
});
$(".switch_link").on("click", function () {
$("[role=form]").slideToggle();
})
});