| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- $(document).ready(function () {
- showDate('showDate');
- $(".qrcodeReader").qrCodeReader();
- });
- $("#qrr-close").on("click", function () {
- $("#form-event").val("");
- });
- function checkEmagementControl() {
- if (checkconnection()) {
- $.ajax({
- url: $("#QRCodeRead").val(),
- dataType: "json",
- encode: true,
- }).done(function (data) {
- $('#ResultQRCode').remove();
- $("#confirmationModal").append(getConfirmModal(data));
- $('#ResultQRCode').modal("show");
- if (data["result"] == true) {
- $('#ResultQRCode').on('hidden.bs.modal', function () {
- getEvements();
- });
- }
- }).fail(function (xhr, status, error) {
- retour = Array;
- retour["result"] = false;
- retour["description"] = "Le QR-Code n'est pas valide";
- retour["salarie"] = null;
- retour["evenement"] = null;
- $('#ResultQRCode').remove();
- $("#confirmationModal").append(getConfirmModal(retour));
- $('#ResultQRCode').modal("show");
- });
- $("#QRCodeRead").removeAttr('value');
- } else {
- $("#divOffline").empty();
- $("#divOffline").append('<div class="alert alert-warning alertLogin" role="alert">Vous n\'êtes pas connecté à internet</div>');
- $("#divOffline").show();
- window.setTimeout(function () {
- $("#divOffline").fadeTo(600, 0).slideUp(600, function () {
- $(this).hide();
- $(this).css('opacity', '1');
- });
- }, 1000);
- }
- }
- $("#QRCodeRead").bind("DOMSubtreeModified", function () {
- if ($("#QRCodeRead").val() !== null && $("#QRCodeRead").val() !== '') {
- checkEmagementControl();
- }
- });
|