| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- $(document).ready(function() {
- $("#formLogin").submit(function(event) {
- if(checkconnection()){
- var formData = {
- email: $("#email").val(),
- password: $("#password").val(),
- from: $("#from").val(),
- event: $("#event").val()
- };
- $.ajax({
- type: "POST",
- url: "json.php?jsonData=login",
- data: formData
- }).done(function(data) {
- var json = $.parseJSON(data);
- if(!json.success) {
- $("#divAlerte").empty();
- $("#divAlerte").html('<div class="alert alert-danger alertLogin" role="alert">Erreur d\'authentification</div>');
- $("#divAlerte").show();
- window.setTimeout(function() {
- $("#divAlerte").fadeTo(600, 0).slideUp(600, function(){
- $(this).hide();
- $(this).css('opacity', '1');
- });
- }, 1000);
- } else {
- window.location = "/home.php";
- }
- });
- event.preventDefault();
-
- } else {
- event.preventDefault();
- $("#divAlerte").empty();
- $("#divAlerte").append('<div class="alert alert-warning alertLogin" role="alert">Vous n\'êtes pas connecté à internet</div>');
- $("#divAlerte").show();
- window.setTimeout(function() {
- $("#divAlerte").fadeTo(600, 0).slideUp(600, function(){
- $(this).hide();
- $(this).css('opacity', '1');
- });
- }, 1000);
- }
- })
- });
|