var lang = 'fr'; var loc = 'aanleveren_html'; var book_type = ''; function make_dialog_fullscreen() { var dh = $(document).height(); var dw = $(window).width(); $('#dialog_wrapper').height(dh).width(dw); } function formaat_wijzigt(btn) { var v = $(btn).val(); $('#voorbeeld_image').attr('src','/images/schema_'+v+'.png'); } function close_dialog() { $('#videoframe').remove(); $('#dialog_wrapper').hide(); } function papier_soort_info() { var v = $('#papier_soort').val(); if (v == 'roman_wit') show_dialog("Bouffant blanc", "80 g/m2 Bouffant blanc spécial (blanc naturel)\n\nCe type de papier convient très bien aux livres avec du texte, sans photos de haute qualité ou d’images de détail. \nLe papier bouffant est par ailleurs moins blanc, ce qui le rend plus confortable pour la lecture."); else if (v == 'roman_geel') show_dialog("Bouffant ivoire", "80 g/m2 Bouffant blanc-jaune (couleur ivoire)\n\nCe type de papier convient très bien aux livres avec du texte, sans photos de haute qualité ou d’images de détail. \nLe papier bouffant est par ailleurs moins blanc, ce qui le rend plus confortable pour la lecture."); else if (v == 'cursus') show_dialog("Papier de cours","80 g/m² Papier Offset sans bois. \n\nCe papier ne décolorera pas en vieillissant car il ne contient pas beaucoup de fibres de bois. \nCe type de papier convient très bien aux livres avec du texte et des graphiques en couleurs."); else if (v == 'kunstdruk_90') show_dialog("Papier couché 90 gr","90 g/m² Couché mécaniquement. \n\nCe papier est plus lisse par exemple que le papier de cours. \nEn raison de leur surface lisse, ces papiers enduits conviennent très bien à l’impression de livres et de brochures contenant des images en couleurs avec des détails de grande finesse (ex. signes diacritiques)."); else if (v == 'kunstdruk_115') show_dialog("Papier couché 115 gr","115 g/m² Couché mécaniquement.\n\nCe papier est plus lisse que, par exemple, du papier de cours. \nLes papiers enduits conviennent très bien à l’impression de livres et de brochures contenant des images en couleurs avec des détails de grande finesse en raison de leur surface lisse."); } function formaat_info() { var v = $('#formaat').val(); if (v == '148x210') show_dialog("Format 148 x 210 mm", "A5 – livre de lecture"); else if (v == "160x240") show_dialog("Format 160 x 240 mm", "Format de livre scientifique – thèses/dissertations"); else if (v == "170x250") show_dialog("Format 170 x 250 mm", "Format de livre scientifique – thèses/dissertations"); else if (v == "206x276") show_dialog("Format 206 x 276 mm", "Format de magazines scientifiques – magazines "); else if (v == "210x297") show_dialog("Format 210 x 297 mm", "A4 - magazines "); } function show_dialog_with_load(title, url) { $('#dialog_body').html(''); $.get(url, function(res) { show_dialog(title, res); }); return false; } function show_dialog(title, content) { var s = $(document).scrollTop(); $('#dialog_content').css('top',s); if (title.length > 0) { $('#dialog_title').html(title).show(); $('#dialog_close').show(); $('#dialog_hoofding').hide(); $('#dialog_body').css('overflow-y','scroll'); } else { $('#dialog_title').hide(); $('#dialog_close').hide(); $('#dialog_hoofding').show(); $('#dialog_body').css('overflow-y','hidden'); } $('#dialog_body').html(content); $('#dialog_wrapper').show(); return false; } function dummy() { $('#aantal_blz').val(25); $('#aantal_blz_kleur').val(5); $('#oplage').val(100); $('#email').val('jeroen.clarysse@telenet.be'); herbereken(); } function upload_klaar() { var offer_id = $('#email_container #offer_id').val(); var url = '/upload_klaar.php?offer_id=' + encodeURIComponent(offer_id); url += '&lang='+lang; $.get(url, function(res) { if (res == 'ok') { if ($('#wiz_results').length > 0) { $('#wiz_results').html("Merci d’avoir téléchargé vos documents.

Avant de poursuivre la commande, nous allons contrôler ces fichiers pour vous. Nous contrôlons notamment les formats, la présence des bonnes polices, les résolutions et le nombre de pages. Dans les 10 minutes vous recevrez un mail. Dans ce mail nous vous dirons si votre fichier est conforme ou, s’il ne l’est pas, ce que vous devez faire pour le corriger. Les prochaines étapes pour poursuivre la commande vous seront aussi clairement expliquées.

Cordialement,

Nicebooks.digital"); } else { $('#uw_gegevens_box').slideUp(); $('#upload_klaar_box').slideDown(); } } else alert(res); }) } function stap2_email_en_data(wizard) { $('#herbereken_gif').show(); var aantal_blz = $('#aantal_blz').val(); var aantal_blz_kleur = $('#aantal_blz_kleur').val(); var oplage = $('#oplage').val(); var formaat = $('#formaat').val(); var boek_type = $('#boek_type').val(); var papier_soort = $('#papier_soort').val(); if (! $.isNumeric(aantal_blz)) { alert("nombre incorrecte de pages"); $('#herbereken_gif').hide(); return; } if (aantal_blz > 750 && loc != 'kopie') { alert("le nombre maximale de pages est 750.Contactez-nous pour un tirage plus élevé."); $('#herbereken_gif').hide(); return; } if (! $.isNumeric(oplage)) { alert("tirage incorrecte"); $('#herbereken_gif').hide(); return; } if (oplage > 300 && loc != 'kopie') { alert("tirage maximale est 300. Contactez-nous pour un tirage plus élevé."); $('#herbereken_gif').hide(); return; } /* if ($('#radio_kleur').is(':checked') && ! $.isNumeric(aantal_blz_kleur)) { alert('incorrect aantal bladzijden-kleur'); return; } if ( parseInt(aantal_blz_kleur) > parseInt(aantal_blz) ) { alert('aantal bladzijden in kleur moet minder dan of gelijk zijn aan totaal aantal bladzijden'); return; }*/ params = new Object(); params['aantal_blz'] = aantal_blz; params['aantal_blz_kleur'] = aantal_blz; //aantal_blz_kleur; params['oplage'] = oplage; params['formaat'] = formaat; params['papier_soort'] = papier_soort; if ($('#radio_kleur').is(':checked')) params['kleur_of_zwartwit'] = 'kleur'; else params['kleur_of_zwartwit'] = 'zwartwit'; params['type'] = 'verder'; params['lang'] = lang; params['boek_type'] = boek_type; if ($('#isbn_check').length > 0) params['isbn'] = $('#isbn_check').is(':checked'); else params['isbn'] = $('#wiz_isbn_yes').is(':checked'); var url = '/calculate_offer.php'; $.post(url, params, function(res) { $('#herbereken_gif').hide(); json = eval('('+res+')'); if (json.error) alert(json.error); else { if (wizard == true) { $('#wiz_results').html(json.result); } else { $('#uw_gegevens_box').html(json.result); $('#uw_boek_box, #verder_button').slideUp(); $('#uw_gegevens_box').slideDown(); } } }); } function herbereken() { $('#herbereken_gif').show(); var aantal_blz = $('#aantal_blz').val(); var aantal_blz_kleur = $('#aantal_blz_kleur').val(); var oplage = $('#oplage').val(); var formaat = $('#formaat').val(); var papier_soort = $('#papier_soort').val(); var boek_type = $('#boek_type').val(); if (! $.isNumeric(aantal_blz)) { alert("nombre incorrecte de pages"); $('#herbereken_gif').hide(); return; } if (aantal_blz > 750 && loc != 'kopie') { alert("le nombre maximale de pages est 750.Contactez-nous pour un tirage plus élevé."); $('#herbereken_gif').hide(); return; } if (! $.isNumeric(oplage)) { alert("tirage incorrecte"); $('#herbereken_gif').hide(); return; } if (oplage > 300 && loc != 'kopie') { alert("tirage maximale est 300. Contactez-nous pour un tirage plus élevé."); $('#herbereken_gif').hide(); return; } /* if ($('#radio_kleur').is(':checked') && ! $.isNumeric(aantal_blz_kleur)) { alert('incorrect aantal bladzijden-kleur'); return; } if ( parseInt(aantal_blz_kleur) > parseInt(aantal_blz) ) { alert('aantal bladzijden in kleur moet minder dan of gelijk zijn aan totaal aantal bladzijden'); return; }*/ params = new Object(); params['aantal_blz'] = aantal_blz; params['aantal_blz_kleur'] = aantal_blz; //aantal_blz_kleur; params['oplage'] = oplage; params['formaat'] = formaat; params['papier_soort'] = papier_soort; params['boek_type'] = boek_type; if ($('#radio_kleur').is(':checked')) params['kleur_of_zwartwit'] = 'kleur'; else params['kleur_of_zwartwit'] = 'zwartwit'; params['type'] = 'quick'; params['lang'] = lang; if ($('#isbn_check').length > 0) params['isbn'] = $('#isbn_check').is(':checked'); else params['isbn'] = $('#wiz_isbn_yes').is(':checked'); var url = '/calculate_offer.php'; $.post(url, params, function(res) { $('#herbereken_gif').hide(); json = eval('('+res+')'); if (json.error) alert(json.error); else { $('#overzicht_table').html(json.result); } }); } function toggle_kleur() { if ($('#radio_kleur').is(':checked')) $('[enkel_kleur]').show(); else $('[enkel_kleur]').hide(); } function validateEmail(email) { var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(String(email).toLowerCase()); } function confirm_email() { var em = $('#email').val(); if (!validateEmail(em)) { alert("Ceci n'est pas une adresse éléctronique correcte."); return; } var offer_id = $('#email_container #offer_id').val(); var url = '/confirm_email.php?email='+encodeURIComponent(em); url += '&offer_id='+encodeURIComponent(offer_id); $.get(url, function(res) { if (res == 'ok') { $('#email_container').slideUp(); $('#upload_box').slideDown(); prepare_upload(); } else alert(res); }); } // code for uploading : function escapeTags( str ) { return String( str ) .replace( /&/g, '&' ) .replace( /"/g, '"' ) .replace( /'/g, ''' ) .replace( //g, '>' ); } function prepare_upload() { var btn = document.getElementById('uploadBtn'), progressBar = document.getElementById('progressBar'), progressOuter = document.getElementById('progressOuter'), msgBox = document.getElementById('msgBox'); var uploader = new ss.SimpleUpload({ button: btn, url: '/upload_pdf.php', name: 'uploadfile', multipart: true, hoverClass: 'hover', focusClass: 'focus', multiple: true, allowedExtensions: ['pdf'], maxSize: 1024*96, responseType: 'json', data:{'id':$('#offer_id').val()}, startXHR: function() { progressOuter.style.display = 'block'; // make progress bar visible this.setProgressBar( progressBar ); }, onSubmit: function() { // msgBox.innerHTML = ''; // empty the message box btn.innerHTML = 'Uploading...'; // change button text to "Uploading..." }, onSubmit2: function(filename, extension) { //msgBox.innerHTML = ''; // empty the message box btn.innerHTML = 'Uploading...'; // change button text to "Uploading..." // Create the elements of our progress bar var progress = document.createElement('div'), // container for progress bar bar = document.createElement('div'), // actual progress bar fileSize = document.createElement('div'), // container for upload file size wrapper = document.createElement('div'), // container for this progress bar //declare somewhere:
where you want to show the progress-bar(s) progressBox = document.getElementById('progressBox'); //on page container for progress bars // Assign each element its corresponding class progress.className = 'progress progress-striped'; bar.className = 'progress-bar progress-bar-success'; fileSize.className = 'size'; wrapper.className = 'wrapper'; // Assemble the progress bar and add it to the page progress.appendChild(bar); wrapper.innerHTML = '
'+filename+'
'; // filename is passed to onSubmit() wrapper.appendChild(fileSize); wrapper.appendChild(progress); progressBox.appendChild(wrapper); // just an element on the page to hold the progress bars // Assign roles to the elements of the progress bar this.setProgressBar(bar); // will serve as the actual progress bar this.setFileSizeBox(fileSize); // display file size beside progress bar this.setProgressContainer(wrapper); // designate the containing div to be removed after upload }, onComplete: function( filename, response ) { btn.innerHTML = 'Sélectionnez un autre fichier'; progressOuter.style.display = 'none'; // hide progress bar when upload is completed if ( !response ) { msgBox.innerHTML = 'Unable to upload file'; return; } if ( response.success === true ) { msgBox.innerHTML += '
' + escapeTags( filename ) + '' + ' a été téléchargé avec succès.'; $('#klaar_button').show(); } else { if ( response.msg ) { msgBox.innerHTML = escapeTags( response.msg ); } else { msgBox.innerHTML = 'An error occurred and the upload failed.'; } } }, onError: function() { progressOuter.style.display = 'none'; msgBox.innerHTML = 'Unable to upload file'; } }); }; function recalc() { var netto_prijs = parseFloat($('#netto').attr('prijs')); if ($('#pdf_correctie_row').is(':visible')) netto_prijs += 50.0; if ($('#verzending_row').is(':visible')) netto_prijs += parseFloat($('#verzending_row td.right').attr('v')); if ($('#isbn_row').is(':visible')) netto_prijs += 60.0; if ($('#isbn_extra_row').is(':visible')) netto_prijs += parseFloat($('#isbn_extra_row').attr('v')); $('#netto td.right').html(netto_prijs.toFixed(2)+' €'); var btw; if (book_type == 'kopie') btw = netto_prijs*0.21; else btw = netto_prijs*0.06; $('#btw td.right').html(btw.toFixed(2)+' €'); var bruto = netto_prijs*1.06; $('#bruto td.right').html(bruto.toFixed(2)+' €'); } function afrekenen(offer_id) { if ( $('#auto_fix').is(':visible') && ! $('#auto_fix').is(':checked') ) { alert("si vous ne cochez pas l'autocorrection, nous ne pouvons pas traiter votre commande! als je de auto-correctie niet aanvinkt, kunnen we je bestelling niet verwerken !"); return; } else if ( $('#must_agree_check').is(':visible') && ! $('#must_agree_check').is(':checked') ) { alert("si vous ne cochez pas l'accord, nous ne pouvons pas traiter votre commande!"); return; } else { $('#back_box').slideUp(); $('#back_box2').slideDown(); } } function levering_change(btn) { var v = $(btn).val(); /* if (v == 'drukkerij' || v == 'winkel') { alert('En raison des mesures actuelles sur le virus COVID-19, la collecte est temporairement impossible.'); $(btn).val('none'); return; }*/ if ( (v == 'verzenden1') || (v == 'verzenden2') || (v == 'verzenden3') || (v == 'verzenden6') || (v == 'verzenden7') ) { $('#afhaal_adres_drukkerij').slideUp(); $('#afhaal_adres_winkel').slideUp(); $('#verzend_adres').slideDown(); if ((v == 'verzenden1') || (v == 'verzenden7')) { $('#verzending_row').find('td.right').attr('v','15').html('15 €'); $('#verzending_row').show(); } else if (v == 'verzenden2') { $('#verzending_row').find('td.right').attr('v','15').html('30 €'); $('#verzending_row').show(); } else $('#verzending_row').hide(); } else if (v == 'drukkerij') { $('#afhaal_adres_drukkerij').slideDown(); $('#afhaal_adres_winkel').slideUp(); $('#verzend_adres').slideUp(); $('#verzending_row').hide(); } else if (v == 'winkel') { $('#afhaal_adres_drukkerij').slideUp(); $('#afhaal_adres_winkel').slideDown(); $('#verzend_adres').slideUp(); $('#verzending_row').hide(); } else { $('#afhaal_adres_drukkerij').slideUp(); $('#afhaal_adres_winkel').slideUp(); $('#verzend_adres').slideUp(); $('#verzending_row').hide(); } recalc(); } function auto_fix_change(btn) { if ($(btn).is(':checked')) $('#pdf_correctie_row').show(); else $('#pdf_correctie_row').hide(); recalc(); } function afrekenen2(offer_id) { if ($('#levering').val() == 'none') { alert('choisissez d\'abord votre méthode de livraison'); return; } var t = $('#levering_adres'); var adres1 = $('#adres1', t).val().trim(); var adres2 = $('#adres2', t).val().trim(); var adres3 = $('#adres3', t).val().trim(); var adres4 = $('#adres4', t).val().trim(); var adres5 = $('#adres5', t).val().trim(); if (t.is(':visible') && ( (adres1.length == 0) || (adres2.length == 0) || (adres3.length == 0) || (adres4.length == 0) || (adres5.length == 0) )) { alert("l'adresse n'est pas remplise correctement"); return; } else { $('#back_box2').slideUp(); $('#back_box3').slideDown(); } } function afrekenen3(offer_id) { if (! $('#akkoord_check').is(':checked')) { alert("vous devez cochez la case de l'accord avec les conditions générales"); return; } var overzicht = "'; overzicht += "

Vous avez choisi de payer ar bon de commande. Un collègue prendra contacte avec vous. Vous ne devez pas encore faire de paiement.

"; overzicht += "     "; } else { overzicht += "
  • prix total "; overzicht += $('tr#bruto').find('td.right').html() + ''; overzicht += ''; overzicht += "

    "; overzicht += "     "; } $('#back_box3').slideUp(); $('#back_box4').html(overzicht).slideDown(); } else { alert(res); } }); } function herstart() { document.location='/fr/index.php'; } function isbn_check_change(btn) { if ($(btn).is(':checked')) { var per_stuk = 2*parseFloat($('tr#per_stuk td.right').text()); var extra = per_stuk.toFixed(2); $('#isbn_extra_row').find('td.right').attr('v',extra.toString()).html(extra.toString()+" €"); $('#isbn_row, #isbn_extra_row').show(); $('#isbn_info').slideDown(); } else { $('#isbn_row, #isbn_extra_row').hide(); $('#isbn_info').slideUp(); } recalc(); } function kul_bon_change(btn) { if ($(btn).is(':checked')) $('#kul_bon_info').slideDown(); else $('#kul_bon_info').slideUp(); } function opnieuw(offer_id) { document.location='https://nicebooks.digital/fr/index.php?back='+offer_id; } function betalen(offer_id) { document.location='/ogone_form.php?offer_id='+offer_id; } function plaats_via_bon(offer_id) { var url = '/stuur_overzicht_mail.php?offer_id='+offer_id; url += '&lang='+lang; $.get(url, function(res) { if (res == 'ok') $('#back_box4').html("commande a été placée"); else alert(res); }); } // doc ready ! $(document).ready(function() { $('#nav-icon1').click(function() { $(this).toggleClass('open'); $('#popup_menu').slideToggle('fast'); }); $('#slider').coinslider({ width: 1024, // width of slider panel height: 370, // height of slider panel spw: 13, // squares per width sph: 6, // squares per height delay: 5000, // delay between images in ms sDelay: 8, // delay beetwen squares in ms opacity: 0.7, // opacity of title and navigation titleSpeed: 500, // speed of title appereance in ms effect: '', // random, swirl, rain, straight navigation: true, // prev next and buttons links : false, // show images as links hoverPause: false // pause on hover }); $('#uw_gegevens_box').hide(); $(window).resize(function() { make_dialog_fullscreen(); }); $('input[type=number]').on('keypress', function(e) { return e.metaKey || // cmd/ctrl e.which == 37 || // arrow keys e.which == 38 || e.which == 39 || e.which == 40 || e.which == 8 || // delete key /[0-9]/.test(String.fromCharCode(e.which)); // numbers }) make_dialog_fullscreen(); });