$(document).ready(function() {
showDate('showDate');
getEvements();
});
// Show QRCode
function printTuile(data){
if(data === null){
return '
Aucun évènement n\'est associé à votre profil à ce jour
';
} else {
var explication = null;
var meta = null;
var classCard = null;
var txtFooter = null;
var classFadeIn = getClassTuile(data["nb"]);
if(data["type_emargement"] == 1){
explication = '' + data["titre"] + '
' + explication + ' ';
}
}
function getClassTuile(nb){
switch (nb) {
case 0:
return "first";
break;
case 1:
return "second";
break;
case 2:
return "third";
break;
case 3:
return "fourth";
break;
default:
return "fifth";
break;
}
}
function getEvements(){
var formData = {
jsonData: "list-events"
}
if (checkconnection()) {
$.ajax({
type: "GET",
url: "json.php",
data: formData,
dataType: "json",
encode: true,
}).done(function (json) {
$("#listEvent").html("");
if(json[0] === null){
$("#listEvent").append(printTuile(null));
} else {
$.each(json, function () {
$("#listEvent").append(printTuile(this));
});
$(".qrcodeReader").qrCodeReader();
}
});
} else {
$("#divOffline").empty();
$("#divOffline").append('