var lang = 'en'; var loc = 'privacy_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(" White Bulk", "80 g / m2 Special white bulk (natural white) )\n\n This type of paper is very suitable for books with text, without high-quality photos or detailed images. \n The paper is also less white, which makes reading more comfortable."); else if (v == 'roman_geel') show_dialog(" Ivory Bulk", "80 g/m2 Bulk ivory \n\ This type of paper is very suitable for books with text, without high-quality photos or detailed images.\n The paper is also less white, which makes reading more comfortable."); else if (v == 'cursus') show_dialog(" Course paper","80 g/m² Wood-free offset paper. \n\ This paper will not discolor as it ages because it does not contain a lot of wood fibers. \n This type of paper is very suitable for books with text and color illustrations."); else if (v == 'kunstdruk_90') show_dialog("90 g / m² coated paper","90 g/m² machine-coated. \n\n This paper is smoother than course paper. \ Because of its smooth surface, this coated paper is very suitable for printing books and brochures containing detailed text (e.g., diacritics) or color images."); else if (v == 'kunstdruk_115') show_dialog("115 g / m² coated paper","115 g/m² machine-coated. \n\n This paper is smoother than course paper. \ Because of its smooth surface, this coated paper is very suitable for printing books and brochures containing detailed text (e.g., diacritics) or color images."); } function formaat_info() { var v = $('#formaat').val(); if (v == '148x210') show_dialog("size 148 x 210 mm", " A5 - novels "); else if (v == "160x240") show_dialog("size 160 x 240 mm", " academic - theses / PhD "); else if (v == "170x250") show_dialog("size 170 x 250 mm", " academic - theses / PhD "); else if (v == "206x276") show_dialog("size 206 x 276 mm", " academic – journals "); else if (v == "210x297") show_dialog("size 210 x 297 mm", " A4 – journals "); } 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(" Thank you for uploading your files.

Before continuing with the order, we will check your files for formatting, embedded fonts, resolution, and the number of pages. Within 10 minutes you will receive an email telling you whether your file is compliant or what you need to do to fix it. The email will also detail the next steps to proceed with your order.

Regards,

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(" incorrect number of pages "); $('#herbereken_gif').hide(); return; } if (aantal_blz > 750 && loc != 'kopie') { alert(" the maximum number of pages is 750.Contact us for a customized quote"); $('#herbereken_gif').hide(); return; } if (! $.isNumeric(oplage)) { alert("incorrect print run"); $('#herbereken_gif').hide(); return; } if (oplage > 300 && loc != 'kopie') { alert(" Maximum print run is 300. Contact us for a customized quote."); $('#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(" incorrect number of pages "); $('#herbereken_gif').hide(); return; } if (aantal_blz > 750 && loc != 'kopie') { alert(" the maximum number of pages is 750.Contact us for a customized quote"); $('#herbereken_gif').hide(); return; } if (! $.isNumeric(oplage)) { alert("incorrect print run"); $('#herbereken_gif').hide(); return; } if (oplage > 300 && loc != 'kopie') { alert(" Maximum print run is 300. Contact us for a customized quote."); $('#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(" This is not a valid email address."); 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 = ' Select another file'; 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 ) + '' + ' has been successfully uploaded .'; $('#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(" if you do not check the auto correction, we cannot process your order! 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(" if you do not check the agreement, we can not process your order!"); return; } else { $('#back_box').slideUp(); $('#back_box2').slideDown(); } } function levering_change(btn) { var v = $(btn).val(); /* if (v == 'drukkerij' || v == 'winkel') { alert('Due to the current measures on COVID-19 virus, collection is temporarily 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('choose your delivery method first'); 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(" address is not fully completed "); return; } else { $('#back_box2').slideUp(); $('#back_box3').slideDown(); } } function afrekenen3(offer_id) { if (! $('#akkoord_check').is(':checked')) { alert(" you must tick the checkbox to agree to terms and conditions "); return; } var overzicht = "'; overzicht += "

You have chosen to pay by purchase order. A colleague will contact you. You do not have to pay yet.

"; overzicht += "     "; } else { overzicht += "
  • total price "; 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='/en/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/en/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(" the order has been placed "); 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(); });