Punto Prelievi
Calcola il tuo Preventivo
Siamo Punto Prelievi riconosciuto dalla Regione Emilia Romagna per i Test Sierologici COVID 19 IgG e IgM e quantitativo . Eseguiamo prelievi in studio e a domicilio.
Non necessaria richiesta del Medico
Chiama, richiedi un preventivo, prenota e lascia i tuoi dati .
( Il costo del prelievo è determinato dal costo dei singoli valori che vuoi analizzare)
Se non sai cosa analizzare scegli tra questi pacchetti per ogni esigenza
Meridiana Medical Center offre un punto prelievi attivo :
Martedì e Giovedì dalle 8 alle 9:30 e Mercoledì dalle 7:30 alle 9
Effettuiamo analisi di Laboratorio e proponiamo diversi check up, per informazioni e prezzi clicca qui .
Occorre inviare le prescrizioni del medico o un semplice elenco degli esame da effettuare alla mail prelievi@meridianamedicalcenter.it sia per richiedere un PREVENTIVO che per PRENOTARE .
Il referto viene inviato via mail appena disponibile .
E’ possibile utilizzare il Preventivatore presente sul sito .
Occorre presentarsi a digiuno dalle mezzanotte .
Per informazioni e prezzi conta
Effettuiamo inoltre di Esami per il Covid 19:
Test sierologico con prelievo venoso QUANTITATIVO IgG + IgM + Anticorpi 49€
Test sierologico rapido IgG e IgM 27€
Tampone Rapido ( solo nasale ) 50€ risultato in pochi minuti
Tampone Molecolare ( nasofaringeo ) 100€ risultato in 72h
Presentarsi con richiesta del Medico
Prenotare Telefonicamente o via mail o via whatapp 3921384949.
Non occorre il digiuno .
I tamponi rapidi vengono effettuati TUTTI I GIORNI SU PRENOTAZIONE.
Scarica il file da compilare e consegnare in segreteria il giorno dell’appuntamento .
// INITIALIZING GLOBAL COUPON VARIABLE coupon_1 = null
// DISPLAYING SSC VERSION var scc_version = "You are not admin" console.log('-------------------------------------------------') console.log('| |') console.log('| SCC VER: ' + scc_version + ' |') console.log('| |') console.log('-------------------------------------------------') var modal = document.querySelector("#css_modal"); var trigger = document.querySelector(".trigger"); var closeButton = document.querySelector(".close-button"); function toggleModal() { jQuery(modal).attr("class", "sccshowmodal"); } function CloseModal() { jQuery(modal).attr("class", "scchidenmodal"); } function SCCOpenModal(){
var scc_mandatory = ''; // check if mandatory dropdowns are empty jQuery('.mandatory_yes').each(function(){ if(jQuery(this).val() ==''){ jQuery(this).parent().parent().find('.alert-danger').html('Please choose an option !'); jQuery(this).parent().parent().find('.alert-danger').css('display','block'); jQuery('html, body').animate({ scrollTop: jQuery(this).offset().top }, 1000); scc_mandatory = 'scc_remains'; if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) } checkIfParentIsAccordionAndOpenIt(this) } });
if(scc_mandatory == ''){
jQuery('.alert-danger').html(''); jQuery('.alert-danger').css('display','none');
jQuery('html, body').animate({ scrollTop: jQuery("#sccidsent").offset().top }, 1000) jQuery('#sccidsent').toggle(); // jQuery('#sccidsent').css('display','block'); // jQuery('.hover_bkgr_fricctableprice').show(); jQuery('#sccprinterid').attr('style','display:none !important'); jQuery('#sccemailid').show(); // jQuery('#sccidsent').show(); } } function ClosePopup_scc2_1(){ jQuery('.hover_bkgr_fricctableprice-1').hide(); jQuery('#sccidsent').show(); jQuery('#sccemailid').show(); jQuery('body').css({ overflow: 'visible' }); jQuery('header').css({ display: 'block' }) jQuery('footer').css({ display: 'block' }) } function SCCPrintModal_1(){ var scc_mandatory = ''; // check if mandatory dropdowns are empty
jQuery('header').css({ display: 'none' }) jQuery('footer').css({ display: 'none' }) jQuery('.mandatory_yes_1').each(function(){ if(jQuery(this).val() ==''){ jQuery(this).parent().parent().find('.alert-danger').html('Please choose an option !'); jQuery(this).parent().parent().find('.alert-danger').css('display','block'); jQuery('html, body').animate({ scrollTop: jQuery(this).offset().top }, 1000); scc_mandatory = 'scc_remains'; if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) } checkIfParentIsAccordionAndOpenIt(this) } }); if (scc_mandatory == '') { jQuery('.alert-danger').html(''); jQuery('.alert-danger').css('display','none'); jQuery('.hover_bkgr_fricctableprice-1').show(); jQuery('#sccTale_price-1').attr('data-simplebar', 'init') jQuery('#sccprinterid').show(); jQuery('#sccidsent').hide(); jQuery('#sccemailid').hide(); }
} function ClosePrintPopup(){ jQuery('.hover_bkgr_friccprintprice').hide(); jQuery('header').css({ display: 'block' }) jQuery('footer').css({ display: 'block' }) jQuery('body').css({ overflow: 'visible' }); }
function uniqueArrayObjects(arr) { return arr.reduce(function (p, c) { let key = '' let keys = [] for (var i in c) { keys.push(c[i]) } key = [keys].join('|'); if (p.temp.indexOf(key) === -1) { p.out.push(c); p.temp.push(key); } return p; }, { temp: [], out: [] }).out; };
var jsonPDF_1 = { }; var tableTitle = "preventivo esami";
var scc_currency_coversion_mode = ''; var scc_currency_coversion_manual_selection = ''; var scc_currency = 'EUR';
if(scc_currency_coversion_mode === 'off' || scc_currency_coversion_mode == 'auto_detect') { scc_currency_coversion_manual_selection = '' }
var scc_currency_conversion_rate = -1 var scc_currency_conversion_label = ''
function getCurrentCurrencyRate() {
if(scc_currency_coversion_mode == 'manual_selection' && scc_currency_coversion_manual_selection != '') { $ajaxQuery = { url: 'https://api.exchangeratesapi.io/latest?base=' + scc_currency + '&symbols=' + scc_currency_coversion_manual_selection, type: 'GET', success: function(res){ if( typeof res == 'object' && res.rates && res.rates[scc_currency_coversion_manual_selection]) { scc_currency_conversion_rate = res.rates[scc_currency_coversion_manual_selection] scc_currency_conversion_label = scc_currency_coversion_manual_selection jQuery('.submitPrices').click(); } }, error: function(err){ console.error(err) } } jQuery.ajax($ajaxQuery); }else if(scc_currency_coversion_mode == 'auto_detect') { $ajaxQuery = { url: 'https://httpbin.org/ip', type: 'GET', success: function(data1){ if(data1 && data1.origin && data1.origin.length > 0 ){ ipaddress = data1.origin.split(',')[0]
$ajaxQuery = { url: 'https://ip2c.org/' + ipaddress, type: 'GET', success: function(countryRes){ if(countryRes.includes(';') && countryRes.split(';').length >= 3) { countryCode = countryRes.split(';')[2] $ajaxQuery = { url: 'https://restcountries.eu/rest/v2/alpha/' + countryCode, type: 'GET', success: function(currencyRes){
if(typeof currencyRes === 'object' && currencyRes['currencies'] && typeof currencyRes['currencies'] === 'object' && currencyRes['currencies'].length >= 0 && currencyRes['currencies'][0]['code']) { var codeToChange = currencyRes['currencies'][0]['code']
$ajaxQuery = { url: 'https://api.exchangeratesapi.io/latest?base=' + scc_currency + '&symbols=' + codeToChange, type: 'GET', success: function(res){ if( typeof res == 'object' && res.rates && res.rates[codeToChange]) { scc_currency_conversion_rate = res.rates[codeToChange] scc_currency_conversion_label = codeToChange jQuery('.submitPrices').click(); } }, error: function(err){ console.error(err) } } jQuery.ajax($ajaxQuery);
} }, error: function(err){ console.error(err) } } jQuery.ajax($ajaxQuery); } }, error: function(err){ console.error(err) } } jQuery.ajax($ajaxQuery); } }, error: function(err){ console.error(err) } } jQuery.ajax($ajaxQuery); } } getCurrentCurrencyRate() function germanCharactersInverseFrontEnd(text) {
if(typeof text == "string") { text = text.replace(/\[a\]/g, 'ä') text = text.replace(/\[o\]/g, 'ö') text = text.replace(/\[u\]/g, 'ü') text = text.replace(/\[b\]/g, 'ß') text = text.replace(/\[A\]/g, 'Ä') text = text.replace(/\[O\]/g, 'Ö') text = text.replace(/\[U\]/g, 'Ü') text = text.replace(/\[B\]/g, 'ẞ') }
return text } function CreateTable_1(parts, comments){
// if(jQuery('#sccTale_price').length){ // jQuery('#sccTale_price').empty();
// }
jsonPDF_1 = { pdf_title: "preventivo esami", logo_image: "", banner_image: "", description: "", unit: "", quantity: "", price: "", footer: "", date: "07/05/2022", rows: [] }; var table_body = "
"; var totalPrice =0; var subTotal = 0; var height = 0; var tax=0; var taxrate = 0; var onTax = 'TAX_RATE_ON'; var TAX_RATE_ON = "TAX_RATE_ON"; var displayTax = taxrate; var finalTotal=0; var currencyType = 'EUR';
var lastTitle = '' var currentSubsection = -1 var sections = [] var section = [] var subsection = []
for(var i=0;i
if(parts[i].subsection != currentSubsection) { section.push(subsection) subsection = [] currentSubsection = parts[i].subsection } if(lastTitle != currentTitle){ if(lastTitle != '') { sections.push(section) section = [] } table_body+="
"); height +=6; lastTitle = currentTitle; var jsonPDFrowSection = { type: "section_title", section_title: currentTitle } jsonPDF_1.rows.push(jsonPDFrowSection) } if(isNaN(parts[i].unit)){
parts[i].unit = 1; }
var jsonPDFrow = {} var elementName = ""
if(jQuery(parts[i].name).hasClass('row-fluid Product-Titles-Summary-Window')){ if(jQuery(parts[i].name).children().length == 2) { jsonPDFrow = { type: "element_dropdown", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), description: jQuery(parts[i].name).find('.product-desc-summary-scc').text(), unit: parts[i].unit, value: Number(parts[i].value), unit_price: "", total_price: "", woo_commerce: { product_id: parts[i].scc_woo_commerce_product_id ? Number(parts[i].scc_woo_commerce_product_id) : 0, quantity: parts[i].unit } } } }else{ if(!parts[i].comment){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), unit: parts[i].unit, value: Number(parts[i].value), unit_price: "", total_price: "", woo_commerce: { product_id: parts[i].scc_woo_commerce_product_id ? Number(parts[i].scc_woo_commerce_product_id) : 0, quantity: parts[i].unit } } } } } } else { if(jQuery(parts[i].name).hasClass('span2')){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).text().trim(), unit: parts[i].unit, value: Number(parts[i].value), unit_price: "", total_price: "", woo_commerce: { product_id: parts[i].scc_woo_commerce_product_id ? Number(parts[i].scc_woo_commerce_product_id) : 0, quantity: parts[i].unit } } } }else{ if(parts[i].custom_math) { jsonPDFrow = { type: "custom_math", attr: { value_with_currency: (priceCommaStyler(parts[i].value)), value: Number(parts[i].value), type: parts[i].custom_math_type, name: jQuery(parts[i].name).text().trim(), show_detailed_list: parts[i].show_detailed_list }
}
}else { jsonPDFrow = { type: "element", attr: { name: (parts[i].name).trim(), unit: parts[i].unit, value: Number(parts[i].value), unit_price: "", total_price: "", woo_commerce: { product_id: parts[i].scc_woo_commerce_product_id ? Number(parts[i].scc_woo_commerce_product_id) : 0, quantity: parts[i].unit } } } } }
} if(parts[i].custom_math){ /* adding currency in frontend custom math: */
jQuery('.scc_custom_math_value_front_end').each(function(index, ob){ jQuery(ob).text()
jQuery(ob).text((priceCommaStyler(parts[i].value)))
})
if(parts[i].show_detailed_list) { notPercentTypeWithCurrency = parts[i].custom_math_type + " " + (priceCommaStyler(parts[i].value)); notPercentTypeWithoutCurrency = parts[i].custom_math_type + " " + priceCommaStyler(parts[i].value); percentType = parts[i].value + parts[i].custom_math_type; table_body += "
"; table_body += "
";
table_body += "
";
//table_body += "
" table_body += `
"; table_body += "
" } }else { if(parts[i].comment){
table_body += "
"
var jsonDPDFcomment = { type: "comment", attr: { title: jQuery(parts[i].name).find('.span2').text(), comment: parts[i].text } } jsonPDF_1.rows.push(jsonDPDFcomment) }else { table_body+="
";
table_body+="
"; //Quantity for all items
table_body+="
"; //Unit value for all items table_body+="
"; // Price for all items
jsonPDFrow.attr["unit_price"] = currencyStyle(priceCommaStyler(Number(parts[i].value).toFixed(2))) jsonPDFrow.attr["total_price"] = currencyStyle(priceCommaStyler((parts[i].unit * parts[i].value).toFixed(2))) } }
jsonPDF_1.rows.push(jsonPDFrow) subsection.push(jsonPDFrow) table_body+="
"; // totalPrice +=(parts[i].unit*parts[i].value); height +=6;
}else{ } }else{
} } section.push(subsection) sections.push(section)
/* START - CUSTOM MATH CALCULATOR */
for(var i = 0; i < sections.length; i++) { // sections
var sectionPrice = 0;
for (var j = 0; j < sections[i].length; j++) { // subsections
var subsectionPrice = 0
for(var k = 0; k < sections[i][j].length; k++) { // elements
if(sections[i][j][k].type === "custom_math") {
switch (sections[i][j][k].attr.type) {
case "+":
subsectionPrice = subsectionPrice + Number(sections[i][j][k].attr.value)
break
case "-":
subsectionPrice = subsectionPrice - Number(sections[i][j][k].attr.value)
break
case "x":
subsectionPrice = subsectionPrice * Number(sections[i][j][k].attr.value)
break
case "%":
var showCurrencySymbol = true
var percentCalculation = subsectionPrice * Number(sections[i][j][k].attr.value/100)
subsectionPrice = subsectionPrice * Number(1 + (sections[i][j][k].attr.value/100))
var regex = new RegExp(`${parts[k].calculator_id + '-' + k + 'XXYYXX'}`)
var replaceWith = showCurrencySymbol ? currencyStyle(priceCommaStyler(percentCalculation.toFixed(2))) : priceCommaStyler(percentCalculation.toFixed(2))
table_body = table_body.replace(regex, replaceWith)
break
}
}else if (sections[i][j][k].type === "element" || sections[i][j][k].type === "element_dropdown") {
subsectionPrice += sections[i][j][k].attr.unit * sections[i][j][k].attr.value
}
}
if(subsectionPrice < 0) {
// subsectionPrice = 0
}
sectionPrice += subsectionPrice
}
totalPrice += sectionPrice
}
if(totalPrice < 0) {
totalPrice = 0
}
/*
END - CUSTOM MATH CALCULATOR
*/
subTotal = totalPrice;
if(taxrate !=0 && taxrate !=''){
tax = (totalPrice * taxrate)/100;
finalTotal = totalPrice + tax;
}else{
finalTotal = totalPrice;
}
var lastTitle = ''
var currentSubsection = -1
var sections = []
var section = []
var subsection = []
for(var i=0;i
if(parts[i].subsection != currentSubsection) { section.push(subsection) subsection = [] currentSubsection = parts[i].subsection } if(lastTitle != currentTitle){ if(lastTitle != '') { sections.push(section) section = [] } table_body+="
"); height +=6; lastTitle = currentTitle; var jsonPDFrowSection = { type: "section_title", section_title: currentTitle } jsonPDF_1.rows.push(jsonPDFrowSection) } if(isNaN(parts[i].unit)){
parts[i].unit = 1; }
var jsonPDFrow = {} var elementName = ""
if(jQuery(parts[i].name).hasClass('row-fluid Product-Titles-Summary-Window')){ if(jQuery(parts[i].name).children().length == 2) { jsonPDFrow = { type: "element_dropdown", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), description: jQuery(parts[i].name).find('.product-desc-summary-scc').text(), unit: parts[i].unit, value: Number(parts[i].value), unit_price: "", total_price: "", woo_commerce: { product_id: parts[i].scc_woo_commerce_product_id ? Number(parts[i].scc_woo_commerce_product_id) : 0, quantity: parts[i].unit } } } }else{ if(!parts[i].comment){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), unit: parts[i].unit, value: Number(parts[i].value), unit_price: "", total_price: "", woo_commerce: { product_id: parts[i].scc_woo_commerce_product_id ? Number(parts[i].scc_woo_commerce_product_id) : 0, quantity: parts[i].unit } } } } } } else { if(jQuery(parts[i].name).hasClass('span2')){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).text().trim(), unit: parts[i].unit, value: Number(parts[i].value), unit_price: "", total_price: "", woo_commerce: { product_id: parts[i].scc_woo_commerce_product_id ? Number(parts[i].scc_woo_commerce_product_id) : 0, quantity: parts[i].unit } } } }else{ if(parts[i].custom_math) { jsonPDFrow = { type: "custom_math", attr: { value_with_currency: (priceCommaStyler(parts[i].value)), value: Number(parts[i].value), type: parts[i].custom_math_type, name: jQuery(parts[i].name).text().trim(), show_detailed_list: parts[i].show_detailed_list }
}
}else { jsonPDFrow = { type: "element", attr: { name: (parts[i].name).trim(), unit: parts[i].unit, value: Number(parts[i].value), unit_price: "", total_price: "", woo_commerce: { product_id: parts[i].scc_woo_commerce_product_id ? Number(parts[i].scc_woo_commerce_product_id) : 0, quantity: parts[i].unit } } } } }
} if(parts[i].custom_math){ /* adding currency in frontend custom math: */
jQuery('.scc_custom_math_value_front_end').each(function(index, ob){ jQuery(ob).text()
jQuery(ob).text((priceCommaStyler(parts[i].value)))
})
if(parts[i].show_detailed_list) { notPercentTypeWithCurrency = parts[i].custom_math_type + " " + (priceCommaStyler(parts[i].value)); notPercentTypeWithoutCurrency = parts[i].custom_math_type + " " + priceCommaStyler(parts[i].value); percentType = parts[i].value + parts[i].custom_math_type; table_body += "
"; table_body += "
";
table_body += "
";
//table_body += "
" table_body += `
"; table_body += "
" } }else { if(parts[i].comment){
table_body += "
"; table_body += "
";
table_body += "
"
var jsonDPDFcomment = { type: "comment", attr: { title: jQuery(parts[i].name).find('.span2').text(), comment: parts[i].text } } jsonPDF_1.rows.push(jsonDPDFcomment) }else { table_body+="
";
table_body+="
"; //Quantity for all items
table_body+="
"; //Unit value for all items table_body+="
"; // Price for all items
jsonPDFrow.attr["unit_price"] = currencyStyle(priceCommaStyler(Number(parts[i].value).toFixed(2))) jsonPDFrow.attr["total_price"] = currencyStyle(priceCommaStyler((parts[i].unit * parts[i].value).toFixed(2))) } }
jsonPDF_1.rows.push(jsonPDFrow) subsection.push(jsonPDFrow) table_body+="
"; // totalPrice +=(parts[i].unit*parts[i].value); height +=6;
}else{ } }else{
} } section.push(subsection) sections.push(section)
/* START - CUSTOM MATH CALCULATOR */
for(var i = 0; i < sections.length; i++) { // sections
var sectionPrice = 0;
for (var j = 0; j < sections[i].length; j++) { // subsections
var subsectionPrice = 0
for(var k = 0; k < sections[i][j].length; k++) { // elements
if(sections[i][j][k].type === "custom_math") {
switch (sections[i][j][k].attr.type) {
case "+":
subsectionPrice = subsectionPrice + Number(sections[i][j][k].attr.value)
break
case "-":
subsectionPrice = subsectionPrice - Number(sections[i][j][k].attr.value)
break
case "x":
subsectionPrice = subsectionPrice * Number(sections[i][j][k].attr.value)
break
case "%":
var showCurrencySymbol = true
var percentCalculation = subsectionPrice * Number(sections[i][j][k].attr.value/100)
subsectionPrice = subsectionPrice * Number(1 + (sections[i][j][k].attr.value/100))
var regex = new RegExp(`${parts[k].calculator_id + '-' + k + 'XXYYXX'}`)
var replaceWith = showCurrencySymbol ? currencyStyle(priceCommaStyler(percentCalculation.toFixed(2))) : priceCommaStyler(percentCalculation.toFixed(2))
table_body = table_body.replace(regex, replaceWith)
break
}
}else if (sections[i][j][k].type === "element" || sections[i][j][k].type === "element_dropdown") {
subsectionPrice += sections[i][j][k].attr.unit * sections[i][j][k].attr.value
}
}
if(subsectionPrice < 0) {
// subsectionPrice = 0
}
sectionPrice += subsectionPrice
}
totalPrice += sectionPrice
}
if(totalPrice < 0) {
totalPrice = 0
}
/*
END - CUSTOM MATH CALCULATOR
*/
subTotal = totalPrice;
if(taxrate !=0 && taxrate !=''){
tax = (totalPrice * taxrate)/100;
finalTotal = totalPrice + tax;
}else{
finalTotal = totalPrice;
}
//mark-10072019 tax view position change
if(comments && comments.length > 0){
table_body +="
"
table_body +="
"
for(var i=0; i
"; table_body += "
"; table_body += "
" table_body += "
"
var jsonDPDFcomment = {
type: "comment",
attr: {
title: jQuery(comments[i].title).find('.span2').text(),
comment: comments[i].text
}
}
jsonPDF_1.rows.push(jsonDPDFcomment)
}
// table_body +="
"
}
subTotal = displayCouponDiscountInFrontEnd_1(subTotal) // Start of Displaying Coupon Discount
if(taxrate !=0 && taxrate !=''){ tax = (subTotal * taxrate)/100; finalTotal = subTotal + tax; }else{ finalTotal = subTotal; }
//table_body+="
"; table_body+="
if(Number(coupon_1.discountpercentage) != -1){ var jsonPDFcoupon = { type: "coupon", attr: { title: "Coupon Discount " + coupon_1.discountpercentage + "%", discount_price: "" } } if(window.hasOwnProperty("translatorJson")){ if(translatorJson['Coupon Discount'] && translatorJson['Coupon Discount']['en']) { jsonPDFcoupon = { type: "coupon", attr: { title: translatorJson['Coupon Discount']['en'] + " " + coupon_1.discountpercentage + "%", discount_price: "" } } } } table_body+="
";
jsonPDFcoupon.attr["discount_price"] = "-" + currencyStyle(priceCommaStyler(coupon_1.discount_value_total.toFixed(2))) +"" table_body+="
";
jsonPDF_1.rows.push(jsonPDFcoupon)
} if(Number(coupon_1.discountvalue) != -1){ var jsonPDFcoupon = { type: "coupon", attr: { title: "", discount_price: "" } }
jsonPDFcoupon.attr["title"] = "Coupon Discount " + currencyStyle(priceCommaStyler(Number(coupon_1.discountvalue).toFixed(2))) jsonPDFcoupon.attr["discount_price"] = "-" + currencyStyle(priceCommaStyler(coupon_1.discount_value_total.toFixed(2))) if(window.hasOwnProperty("translatorJson")){ if(translatorJson['Coupon Discount'] && translatorJson['Coupon Discount']['en']) { jsonPDFcoupon.attr["title"] = translatorJson['Coupon Discount']['en'] + " " + currencyStyle(priceCommaStyler(Number(coupon_1.discountvalue).toFixed(2))) } }
table_body+="
"; table_body+="
"; jsonPDF_1.rows.push(jsonPDFcoupon) } table_body+="
" } //table_body+="
"; table_body+="
// Start of Displaying Sub-total Tax // End of Displaying Sub-total Tax
// Start of Displaying Tax // End of Displaying Tax
var jsonPDFtotal = { type: "total", attr: { title: "Prezzo Totale", price: "" } }
table_body+="
"; var total_price = "" if( scc_currency_conversion_rate == -1 ){ total_price = currencyStyle(priceCommaStyler(finalTotal.toFixed(2))) }else { total_price = currencyStyle(priceCommaStyler(finalTotal.toFixed(2))) + ' (' + priceCommaStyler((finalTotal * scc_currency_conversion_rate).toFixed(2)) + ' ' + scc_currency_conversion_label + ')' }
jsonPDFtotal.attr["price"] = total_price
table_body+="
";
jsonPDF_1.rows.push(jsonPDFtotal)
table_body+="
"; table_body+="
";
/* table_body+="
"; */ var xheight = 42+height - 100; if (xheight <= 5) xheight =5;//console.log(xheight, height); table_body+="
";
table_body+="
"; table_body+="
"; jQuery('#sccTale_price-1').html(table_body);
if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) }
jQuery('body').find('.Description').each(function(index, ob){ jsonPDF_1.description = jQuery(ob).text() }) jQuery('body').find('.Quantity').each(function(index, ob){ jsonPDF_1.quantity = jQuery(ob).text() }) jQuery('body').find('.Unit').each(function(index, ob){ jsonPDF_1.unit = jQuery(ob).text() }) jQuery('body').find('.Price').each(function(index, ob){ jsonPDF_1.price = jQuery(ob).text() }) jQuery('body').find('.subtotal_tax_for_pdf').each(function(index, ob){ for(var i= 0; i < jsonPDF_1.rows.length; i++){ if(jsonPDF_1.rows[i].type == "subtotal_tax") { jsonPDF_1.rows[i].attr.title = jQuery(ob).text() } } }) jQuery('body').find('.tax_for_pdf').each(function(index, ob){ for(var i= 0; i < jsonPDF_1.rows.length; i++){ if(jsonPDF_1.rows[i].type == "tax") { jsonPDF_1.rows[i].attr.title = jQuery(ob).text() } } }) // console.log('elemnts array:', jsonPDF) priceObject = { price: subTotal, scc_currency_conversion_rate: scc_currency_conversion_rate, scc_currency_conversion_label: scc_currency_conversion_label } return priceObject } function priceCommaStyler(price){ isCommaBasedStyling = false; price = price + ''; if (isCommaBasedStyling) { var dot = price.indexOf('.') === -1 ? false : true var newPrice = '' for(var i = (price.split('').length - 1) ; i >= 0; i--){ if(price.indexOf('-') === -1){ if(!dot && (i === ((price.split('').length - 1) - 3) || i === ((price.split('').length - 1) - 6) || i === ((price.split('').length - 1) - 9))){ newPrice = ',' + newPrice }else if(dot && (i === ((price.split('').length - 1) - 6) || i === ((price.split('').length - 1) - 9) || i === ((price.split('').length - 1) - 12))){ newPrice = ',' + newPrice } newPrice = price.split('')[i] + newPrice }else{ if(!dot && (i === ((price.split('').length - 1) - 4) || i === ((price.split('').length - 1) - 6) || i === ((price.split('').length - 1) - 9))){ if(price.split('').length > 4){ newPrice = ',' + newPrice } }else if(dot && (i === ((price.split('').length - 1) - 6) || i === ((price.split('').length - 1) - 9) || i === ((price.split('').length - 1) - 12))){ if(price.split('').length > 7){ newPrice = ',' + newPrice } } newPrice = price.split('')[i] + newPrice }
} if(newPrice.length >= 3 && ( newPrice.substring(newPrice.length - 3, newPrice.length - 1) === '.00' || newPrice.substring(newPrice.length - 3, newPrice.length) === '.00') ){ newPrice = newPrice.split('.')[0] } return newPrice; } roundedPrice = parseFloat(parseFloat(price).toFixed(2)); return roundedPrice.toLocaleString(navigator.languages[0]); }
function addWooCommerce (buttonBackground, calculator_id) { var scc_mandatory = '';
jQuery('.mandatory_yes_' + calculator_id).each(function(){ if(jQuery(this).val() ==''){ jQuery(this).parent().parent().parent().find('.alert-danger').html('Please choose an option !'); jQuery(this).parent().parent().parent().find('.alert-danger').css('display','block');
if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) }
checkIfParentIsAccordionAndOpenIt(this)
jQuery('html, body').animate({ scrollTop: jQuery(this).offset().top }, 1000); scc_mandatory = 'scc_remains'; } }); if (scc_mandatory == '') { showWooCommerceLoadingModal(buttonBackground) $ajaxQuery= { url: rt_vars.rt_urlajax, type: 'POST', xhrFields: { responseType: '' }, data: { action: 'sccAddWooCommerce', payload: Base64.encode(JSON.stringify(jsonPDF_1)),
}, success: function(data){
showWooCommerceModal(data, buttonBackground) }, error: function(err){
} } jQuery.ajax($ajaxQuery); }
} function hiddenClone(element){ // Create clone of element var clone = element.cloneNode(true);
// Position element relatively within the // body but still out of the viewport var style = clone.style; // style.position = 'absolute'; // style.top = - window.innerHeight + 'px'; style.left = 0; style.top = 1000 + 'px' // style.background = '#FFFFFF'
// Append clone to body and return the clone document.body.appendChild(clone); return clone; }
function sendPDF_1(enable){ if(enable ==0){ jQuery('.scc-alert').remove();
return; }
$ajaxQuery= { url: rt_vars.rt_urlajax, type: 'POST', xhrFields: { responseType: '' }, data: { action: 'sccSendPDF', payload: Base64.encode(JSON.stringify(jsonPDF_1)), tableTitle, }, success: function(b64){
const linkSource = `data:application/pdf;base64,${b64}`; const downloadLink = document.createElement("a"); const fileName = jsonPDF_1.pdf_title + "-"+ new Date() +".pdf";
downloadLink.href = linkSource; downloadLink.download = fileName; downloadLink.click();
}, error: function(err){ console.log('err', err) console.log('err', err.responseText)
var disposition = err.getResponseHeader('content-disposition'); var matches = /"([^"]*)"/.exec(disposition); var filename = (matches != null && matches[1] ? matches[1] : 'file.pdf');
// The actual download var blob = new Blob([err.responseText], { type: 'application/pdf' }); var link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = filename;
document.body.appendChild(link);
link.click();
document.body.removeChild(link); } } jQuery.ajax($ajaxQuery); // var xmlhttp = new XMLHttpRequest(); // xmlhttp.open("POST", rt_vars.rt_urlajax, true); // xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); // xmlhttp.send(JSON.stringify({ // action: 'sccSendPDF', // payload: JSON.stringify(jsonPDF), // })); } var isMobile = false function sendemail($enable){
if($enable ==0){ jQuery("#myModalSCCEmailQuote").modal(); jQuery('.modal-backdrop').each(function(){ jQuery(this).removeClass('modal-backdrop') }) return; }
if(!jQuery('#sscemailAddress') || !jQuery('#sscemailAddress').val() || !jQuery('#sscemailAddress').val().includes('@') || !jQuery('#sscemailAddress').val().includes('.') || jQuery('#sscemailAddress').val().includes('#') || jQuery('#sscemailAddress').val().length < 4){ jQuery('#email-error').html('Email not valid') return; } createSendEmailModal() jQuery('header').css({ display: 'none' }) jQuery('footer').css({ display: 'none' }) var title = document.getElementById("framtablename") ? document.getElementById("framtablename").innerText : ''; var bar=new RadialProgress(document.getElementById("scc_sendemail_progress_bar"),{indeterminate:false,colorFg:"#000",thick:10,fixedTextSize:0.2}); bar.setValue(0.1); jQuery('.hover_bkgr_fricctableprice-1').show(); jQuery('#sccprinterid').attr('style','display:none !important'); jQuery('#sccidsent').hide(); jQuery('#sccemailid').hide(); var currentScroll = jQuery(document).scrollTop() jQuery(document).scrollTop(0) var bodyWidth = jQuery('body').css('width') if( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)){ isMobile = true } /* jQuery('.scc-buttons-visibility').each(function(index, ob){ jQuery(ob).css('display', 'none') }) */ bar.setValue(0.3) bar.setValue(0.5) jQuery.getJSON('https://httpbin.org/ip', function(data) { var titleFromDatabase = ""; if(titleFromDatabase && titleFromDatabase.length > 0){ title = titleFromDatabase } var email = jQuery('#sscemailAddress').val() var user = jQuery('#sscuserAddress').val() var phone = jQuery('#sscuserPhone').val();
bar.setValue(0.90);
jQuery(document).scrollTop(currentScroll) var ipaddress = 'no IP' if(data){ if(data.origin){ if(data.origin.length > 0 ){ ipaddress = data.origin.split(',')[0] } } } var browserInfo = "" var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; var isFirefox = typeof InstallTrigger !== 'undefined'; var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification)); var isIE = /*@cc_on!@*/false || !!document.documentMode; var isEdge = !isIE && !!window.StyleMedia; var isChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime); var isBlink = (isChrome || isOpera) && !!window.CSS;
if(isOpera) browserInfo = "Opera" if(isFirefox) browserInfo = "Firefox" if(isSafari) browserInfo = "Safari" if(isIE) browserInfo = "Internet Explorer" if(isEdge) browserInfo = "Edge" if(isChrome) browserInfo = "Chrome"
$fragment_refresh={ url: rt_vars.rt_urlajax, type: 'POST', data: { action: 'sccSendEmail', payload: Base64.encode(JSON.stringify(jsonPDF_1)), email_to: email, user_to: user, title: title, phone: phone, ipaddress: ipaddress, browserInfo: browserInfo, device: isMobile }, success: function(data) {
bar.setValue(1); ClosePopup_scc2_1() setTimeout(() => { removeSendEmailProgress() jQuery('body').css({ overflow: 'visible' }); jQuery('header').css({ display: 'block' }) jQuery('footer').css({ display: 'block' }) }, 1000); jQuery('#statusMsg').html(' Thank you, '+user+'. Your quote has been sent to '+email+''); } } jQuery.ajax( $fragment_refresh ) }) .fail(function() { $fragment_refresh={ url: rt_vars.rt_urlajax, type: 'POST', data: { action: 'sccSendEmail', payload: Base64.encode(JSON.stringify(jsonPDF_1)), email_to: email, user_to: user, title: title, phone: phone, ipaddress: '', browserInfo: browserInfo, device: isMobile }, success: function(data) {
bar.setValue(1) ClosePopup_scc2() setTimeout(() => { removeSendEmailProgress() jQuery('body').css({ overflow: 'visible' }); jQuery('header').css({ display: 'block' }) jQuery('footer').css({ display: 'block' }) }, 1000); jQuery('#statusMsg').html(' Thank you, '+user+'. Your quote has been sent to '+email+''); } } jQuery.ajax( $fragment_refresh ) })
jQuery('.scc-email-popup-close').click(); setTimeout(function(){jQuery('#sccidsent').show();},600); }
function check(doc,title, clone, currentScroll, bar){ jQuery.getJSON('https://httpbin.org/ip', function(data) { var titleFromDatabase = "";
if(titleFromDatabase && titleFromDatabase.length > 0){ title = titleFromDatabase } var email = jQuery('#sscemailAddress').val() var user = jQuery('#sscuserAddress').val() var phone = jQuery('#sscuserPhone').val();
bar.setValue(0.90);
var pdf = btoa(doc.output()); jQuery(document).scrollTop(currentScroll) var ipaddress = 'no IP' if(data){ if(data.origin){ if(data.origin.length > 0 ){ ipaddress = data.origin.split(',')[0] } } } var browserInfo = "" var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; var isFirefox = typeof InstallTrigger !== 'undefined'; var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification)); var isIE = /*@cc_on!@*/false || !!document.documentMode; var isEdge = !isIE && !!window.StyleMedia; var isChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime); var isBlink = (isChrome || isOpera) && !!window.CSS;
if(isOpera) browserInfo = "Opera" if(isFirefox) browserInfo = "Firefox" if(isSafari) browserInfo = "Safari" if(isIE) browserInfo = "Internet Explorer" if(isEdge) browserInfo = "Edge" if(isChrome) browserInfo = "Chrome"
$fragment_refresh={ url: rt_vars.rt_urlajax, type: 'POST', data: { action: 'sccSendEmail', payload: Base64.encode(JSON.stringify(jsonPDF_1)), email_to: email, user_to: user, title: title, phone: phone, ipaddress: ipaddress, browserInfo: browserInfo, device: isMobile }, success: function(data) {
bar.setValue(1); ClosePopup_scc2_1(); document.body.removeChild(clone); setTimeout(() => { removeSendEmailProgress() jQuery('body').css({ overflow: 'visible' }); jQuery('header').css({ display: 'block' }) jQuery('footer').css({ display: 'block' }) }, 1000); jQuery('#statusMsg').html(' Thank you, '+user+'. Your quote has been sent to '+email+''); } } jQuery.ajax( $fragment_refresh ) }) .fail(function() { $fragment_refresh={ url: rt_vars.rt_urlajax, type: 'POST', data: { action: 'sccSendEmail', image: pdf, email_to: email, user_to: user, title: title, phone: phone, ipaddress: '' }, success: function(data) { // jQuery('#scc_sending_email_progress_container').css('display', 'none') updateSendEmailProgress(100) ClosePopup_scc2(); document.body.removeChild(clone); setTimeout(() => { removeSendEmailProgress() jQuery('body').css({ overflow: 'visible' }); jQuery('header').css({ display: 'block' }) jQuery('footer').css({ display: 'block' }) }, 1000); jQuery('#statusMsg').html(' Thank you, '+user+'. Your quote has been sent to '+email+''); } } jQuery.ajax( $fragment_refresh ) }) }
PrintDoc = function(enable){ if(enable === 0){ jQuery('.scc-alert').remove(); jQuery('body').find('.scc-detailed-list-head').each(function(index, ob){ jQuery(ob).html("
"); }) return; }
jQuery('.scc-buttons-visibility').each(function(index, ob){ jQuery(ob).css('display', 'none') })
jQuery('.Section-Title-Summary-Window').each(function(index, ob){ jQuery(ob).css('margin-left','15px') })
jQuery('.comments-printing-improvement').each(function(index, ob){ jQuery(ob).css('padding-left', 10) })
//jQuery('#scc-summary-view-header').css('background-color', 'grey')
var printContents = document.getElementById('scctableprice').innerHTML; var originalContents = document.body.innerHTML;
document.body.style.padding = "10px"; document.body.style.height = "100%"; document.body.style.width = "100%"; document.body.innerHTML = printContents;
window.print(); document.body.innerHTML = originalContents;
jQuery('.Section-Title-Summary-Window').each(function(index, ob){ jQuery(ob).css('margin-left:5px') })
jQuery('.scc-buttons-visibility').each(function(index, ob){ jQuery(ob).css('display', 'block') }) jQuery('.comments-printing-improvement').each(function(index, ob){ jQuery(ob).css('padding-left', 0) })
//jQuery('#scc-summary-view-header').css('background-color', '#F1F1F1')
} function updateSendEmailProgress(value){ var elem = document.getElementById("myBar_scc");
elem.innerHTML = value + "%"; //jQuery('#scc_sendemail_progress_value').html(value + '%') } function removeSendEmailProgress(){ jQuery('#scc_send_email_progress_modal').modal('hide') jQuery('#scc_sending_email_progress_container').html('') jQuery('#scc_send_email_progress_modal').modal('hide') jQuery('#scc_send_email_progress_modal').modal('hide') setTimeout(() => { jQuery('#scc_send_email_progress_modal').remove() jQuery('.modal-backdrop').each((index, element) => { jQuery('#preview_modal').modal('hide') element.remove() jQuery(element).remove() setTimeout(() => { jQuery('#scc_send_email_progress_modal').modal('hide') jQuery('#scc_send_email_progress_modal').modal('hide') }, 1000); });
}, 1000); }
function createSendEmailModal(){ var code = ''
code += '
' code += '
' code += '
'
jQuery('#scc_sending_email_progress_container').html(code)
jQuery('#scc_send_email_progress_modal').modal('show')
if( navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)){
jQuery('#scc_send_email_progress_modal').css('left', 80)
jQuery('#scc_send_email_progress_modal').css('top', 80)
}
}
window.rp_requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||(function(callback,element){setTimeout(callback,1000/60);});
function RadialProgress(container,cfg){
container.innerHTML="";
var nc=document.createElement("div");
nc.style.width="10em"; nc.style.height="10em";
nc.style.position="relative";
container.appendChild(nc);
container=nc;
if(!cfg) cfg={};
this.colorBg=cfg.colorBg==undefined?"#404040":cfg.colorBg;
this.colorFg=cfg.colorFg==undefined?"#007FFF":cfg.colorFg;
this.colorText=cfg.colorText==undefined?"#000000":cfg.colorText;
this.indeterminate=cfg.indeterminate==undefined?false:cfg.indeterminate;
this.round=cfg.round==undefined?false:cfg.round;
this.thick=cfg.thick==undefined?2:cfg.thick;
this.progress=cfg.progress==undefined?0:cfg.progress;
this.noAnimations=cfg.noAnimations==undefined?0:cfg.noAnimations;
this.fixedTextSize=cfg.fixedTextSize==undefined?false:cfg.fixedTextSize;
this.animationSpeed=cfg.animationSpeed==undefined?1:cfg.animationSpeed>0?cfg.animationSpeed:1;
this.noPercentage=cfg.noPercentage==undefined?false:cfg.noPercentage;
this.spin=cfg.spin==undefined?false:cfg.spin;
if(cfg.noInitAnimation) this.aniP=this.progress; else this.aniP=0;
var c=document.createElement("canvas");
c.style.position="absolute";c.style.top="0";c.style.left="0";c.style.width="100%";c.style.height="100%";c.className="rp_canvas";
container.appendChild(c);
this.canvas=c;
var tcc=document.createElement("div");
tcc.style.position="absolute";tcc.style.display="table";tcc.style.width="100%";tcc.style.height="100%";
var tc=document.createElement("div");
tc.style.display="table-cell";tc.style.verticalAlign="middle";
var t=document.createElement("div");
t.style.color=this.colorText;t.style.textAlign="center";t.style.overflow="visible";t.style.whiteSpace="nowrap";t.className="rp_text";
tc.appendChild(t);
tcc.appendChild(tc);
container.appendChild(tcc);
this.text=t;
this.prevW=0; this.prevH=0; this.prevP=0; this.indetA=0; this.indetB=0.2; this.rot=0;
this.draw=function(f){
if(!(f==true))rp_requestAnimationFrame(this.draw);
var c=this.canvas;
var dp=window.devicePixelRatio||1;
c.width=c.clientWidth*dp; c.height=c.clientHeight*dp;
if(!(f==true)&&!this.spin&&!this.indeterminate&&(Math.abs(this.prevP-this.progress)<1&&this.prevW==c.width&&this.prevH==c.height)) return;
var centerX=c.width/2, centerY=c.height/2, bw=(c.clientWidth/100.0), radius=c.height/2-(this.thick*bw*dp)/2, bw=(c.clientWidth/100.0);
this.text.style.fontSize=(this.fixedTextSize?(c.clientWidth*this.fixedTextSize):(c.clientWidth*0.26-this.thick))+"px";
if(this.noAnimations) this.aniP=this.progress; else{var aniF=Math.pow(0.93,this.animationSpeed);this.aniP=this.aniP*aniF+this.progress*(1-aniF);}
c=c.getContext("2d");
c.beginPath();
c.strokeStyle=this.colorBg;
c.lineWidth=this.thick*bw*dp;
c.arc(centerX,centerY,radius,-Math.PI/2, 2*Math.PI);
c.stroke();
c.beginPath();
c.strokeStyle=this.colorFg;
c.lineWidth=this.thick*bw*dp;
if(this.round) c.lineCap="round";
if(this.indeterminate){
this.indetA=(this.indetA+0.07*this.animationSpeed)%(2*Math.PI);this.indetB=(this.indetB+0.14*this.animationSpeed)%(2*Math.PI);
c.arc(centerX,centerY,radius,this.indetA, this.indetB);
if(!this.noPercentage)this.text.innerHTML="";
}else{
if(this.spin&&!this.noAnimations)this.rot=(this.rot+0.07*this.animationSpeed)%(2*Math.PI)
c.arc(centerX,centerY,radius,this.rot-Math.PI/2, this.rot+this.aniP*(2*Math.PI)-Math.PI/2);
if(!this.noPercentage)this.text.innerHTML=Math.round(100*this.aniP)+" %";
}
c.stroke();
this.prevW=c.width; this.prevH=c.height; this.prevP=this.aniP;
}.bind(this);
this.draw();
}
RadialProgress.prototype={
constructor:RadialProgress,
setValue:function(p){this.progress=p<0?0:p>1?1:p;},
setIndeterminate:function(i){this.indeterminate=i;},
setText:function(t){this.text.innerHTML=t;}
}
for (i = 0; i < acc.length; i++) { acc[i].addEventListener("click", function() { // this.classList.toggle("active"); if(jQuery(this).hasClass('scc-accordion_active')){ jQuery(this).removeClass('scc-accordion_active') jQuery(this).addClass('scc-accordion') }else{ jQuery(this).removeClass('scc-accordion') jQuery(this).addClass('scc-accordion_active') } jQuery('.' + jQuery(this).attr('id')).each(function(index, ob){ if (jQuery(ob).css('maxHeight') === '0px') { if(jQuery(ob).hasClass('simple_button')){ jQuery(ob).css('display', 'inline-block') jQuery(ob).css('paddingLeft', 10) }else{ jQuery(ob).css('display', 'block') } setTimeout(function(){ jQuery(ob).css('maxHeight', 400) jQuery(ob).removeClass('scc-accordion-panel-hidden') jQuery(ob).css('overflow', 'visible') }, 200) } else { jQuery(ob).css('maxHeight', 0) jQuery(ob).css('overflow', 'hidden') // jQuery(ob).css('display', 'none') setTimeout(function(){ jQuery(ob).addClass('scc-accordion-panel-hidden') jQuery(ob).css('display', 'none') }, 600) } }) }); } for (i = 0; i < acc.length; i++) { jQuery('.' + jQuery(jQuery(acc[i])).attr('id')).each(function(index, ob){ jQuery(ob).css("display","none") }) } }, 500) /* accordion JS END */ translatorJson = {"Total":{"en":"Totale"},"Description":{"en":"Descrizione"},"Unit Price":{"en":"Prezzo Unitario"},"Quantity":{"en":"Quantit\u00e0"},"Price":{"en":"Prezzo"},"SEND":{"en":"INVIA"},"Total Price":{"en":"Prezzo Totale"},"Summary":{"en":"Riepilogo"},"Send quote by email":{"en":"Invia il preventivo per email"},"View detailed list":{"en":"Dettaglio Preventivo"},"Coupon Code":{"en":"Coupon Code"},"Email Quote":{"en":"Invia per Mail"},"Detailed List":{"en":"Dettaglio"},"Your quote has been sent to":{"en":"Il tuo preventivo \u00e8 stato inviato"},"Thank you":{"en":"Grazie"}}; translator = jQuery('body').translate({lang: "en", t: translatorJson}); }); // var triggerRadio = false; function selectChange(id, $this){ triggerSubmit(id, $this); } function triggerSubmit_2(id, select_id, value, $this){ jQuery('#' + select_id).attr('data-dropdownmult', value); } function onchangeComments(){ jQuery('.submitPrices').click(); } function onchangeNumberBox(){ jQuery('.submitPrices').click(); } function triggerSubmit(id, $this){ if (jQuery($this).is(':radio')){ radioCheckbox = jQuery($this); radioCheckbox.attr('data-preselected') ? radioCheckbox.prop('checked', false).removeAttr('data-preselected') : radioBtnSwitch(); function radioBtnSwitch() { radioCheckbox.attr('data-selected') ? radioCheckbox.prop('checked', false).removeAttr('data-selected') : showPriceHintText(); } function showPriceHintText() { radioCheckbox.attr('data-selected', 'true') isPriceHintEnabled = jQuery($this).attr('data-show-pricehint') == 'true'; if(isPriceHintEnabled) { radioCheckbox.parent().children('.price-hint-text').text('+ ' + currencySymbol(currencyLabel) + priceCommaStyler(radioCheckbox.attr('datainputprice'))).css('display', 'inline-block').delay(3000).fadeOut('slow'); } } } if (jQuery($this).is(':checkbox') && jQuery($this).attr('data-show-pricehint') == 'true'){ checkbox = jQuery($this); isSimpleBtnCheckbox = jQuery($this).closest('.simple_button.control-label').length; if(isSimpleBtnCheckbox && jQuery($this).is(':checked')) { jQuery($this).closest('.simple_button.control-label').find('.price-hint-text').text('+ ' + currencySymbol(currencyLabel) + priceCommaStyler(checkbox.attr('datainputprice'))).css('display', 'block').delay(3000).fadeOut('slow'); } else { checkbox.parent().children('.price-hint-text').text('+ ' + currencySymbol(currencyLabel) + priceCommaStyler(checkbox.attr('datainputprice'))).css('display', 'inline-block').delay(3000).fadeOut('slow'); } } sccsubmi = '#scc_submit_' + id; jQuery(sccsubmi).trigger('click'); } jQuery('.customComboBox li').click(function(){ jQuery(this).html(); jQuery(this).parent().find('li').removeClass('activated'); jQuery(this).addClass('activated') }); jQuery('.submitPrices').click(function(){ var parent_id = "#" + jQuery(this).attr('id').replace('submit', 'form'); var xprice = []; var dropprice2 = 0; var price = 0; var hmm = []; var lo = 0; //hmm =[]; var sliderNames = [] var dropprice1 = 0; var dropdownMult =0; var dropdownMult1 =0; var multislider = []; var totalnumber = 0; var sec; var sectionName =[]; var parts=[]; var comments = [] var paypalItemsArray = [] jQuery(parent_id + ' .itemCreated').each(function(){ var totalnumber1=[]; var sld = 1; var _sec = parseInt((jQuery(this).attr('id')).split("_")[1]); var sub = parseInt((jQuery(this).attr('id')).split("_")[2]); if(sec != _sec){ sec=_sec; multislider[sec] = []; hmm[sec] = []; sliderNames[sec] = [] } if(isNaN(hmm[sec][sub])) {hmm[sec][sub]= 0; sliderNames[sec][sub] = 0} if ('switchoption' == jQuery(this).attr('data-inputtype') ){ if (jQuery(this).is(':checked')){ hmm[sec][sub] += parseFloat(jQuery(this).attr('datainputprice')); const switched = { name: ""+jQuery(this).attr('name')+"", value:parseFloat(jQuery(this).attr('datainputprice')), unit:1, section: sec, subsection: sub, paypal_name: jQuery(this).attr('name'), scc_woo_commerce_product_id: jQuery(this).attr('scc_woo_commerce_product_id'), calculator_id: Number(jQuery(this).attr('calculator_id')) };
parts.push(switched);
} } else if ('dropdowninput' == jQuery(this).attr('data-inputtype')) { hmm[sec][sub] += parseFloat(getDropDownValue(this));// * parseInt(dropdownMult); // console.log(hmm, jQuery(this).find("option:selected").text(), "dropdown", jQuery(this).find("option:selected").val(),sec,sub); var title = jQuery(jQuery(this).find("option:selected")[0]).text()
if(jQuery(this).parent().parent().find('.ddlabel:first') && jQuery(this).parent().parent().find('.ddlabel:first')[0]){ if(title != 'Choose an option...'){ jQuery(jQuery(this).parent().parent().find('.ddlabel:first')[0]).text(title) } } if(jQuery(this).find("option:selected").val() != ""){ const switched={ name: "
", value:parseFloat(getDropDownValue(this)), unit: 1, section: sec, subsection: sub, paypal_name: jQuery(this).find("option:selected").text(), scc_woo_commerce_product_id: jQuery(this).find("option:selected").attr('scc_woo_commerce_product_id'), calculator_id: Number(jQuery(this).find("option:selected").attr('calculator_id'))
}; parts.push(switched); } } else if ('sliderinput' == jQuery(this).attr('data-inputtype')){ sliderId = '#' + jQuery(this).attr('data-slider-id'); totalnumber1 =jQuery(this).attr('data_range').split(","); var sliderunitprc = totalnumber1 [totalnumber1.length-1]; var slide_value = parseFloat(jQuery(this).attr('data-value')); speechBubble = jQuery(`${sliderId} > .tooltip.tooltip-main.top.in .scc-slider-speech-bubble`); var unitprice = sliderunitprc*slide_value; isPriceHintEnabled = jQuery(this).attr('data-show-pricehint') == 'true'; function isSliderHover() { return jQuery(sliderId).is(':hover'); } multislider[sec][sub]=slide_value;
for (k=0;k
", unit:slide_value, value: parseFloat(totalnumber1[k+2]), section: sec, subsection: sub, sliderInsubsection: true, paypal_name: jQuery(this).parent().parent().find('label:last').text(), scc_woo_commerce_product_id: jQuery(this).attr('scc_woo_commerce_product_id'), calculator_id: Number(jQuery(this).attr('id').split('_')[jQuery(this).attr('id').split('_').length -1]) }; if (isPriceHintEnabled && isSliderHover()) { roundedPrice = (switched.value * switched.unit).toFixed(2); speechBubble.text(currencySymbol(currencyLabel) + ' ' + priceCommaStyler(roundedPrice)).css('display', 'block').delay(3000).fadeOut('slow'); }; parts.push(switched); //price += multislider[j]*(xprice[j]+hmm[j]); break; } } } else if ('comment_input' == jQuery(this).attr('data-inputtype')){ if(jQuery(this) && jQuery(this).val() && jQuery(this).val().length > 0){ const comment = { name: "
", text: jQuery(this).val(), section: sec, subsection: sub, unit: 1, value: 0, comment: true, paypal_title: jQuery(this).parent().parent().find('label:last').text(), paypal_text: jQuery(this).val(), calculator_id: Number(jQuery(this).attr('calculator_id')) }
parts.push(comment); //comments.push(comment); }
} else if ('number_input' == jQuery(this).attr('data-inputtype')){ var unitValue =jQuery(this).attr('data-value'); const switched={ name: "
", unit:jQuery(this).val(), value: unitValue, section: sec, subsection: sub, numberInput: true, paypal_name: jQuery(this).parent().parent().find('label:last').text(), scc_woo_commerce_product_id: jQuery(this).attr('scc_woo_commerce_product_id'), calculator_id: Number(jQuery(this).attr('calculator_id')) }; parts.push(switched); hmm[sec][sub] = unitValue * jQuery(this).val()
} else if('scc_custom_math' == jQuery(this).attr('data-inputtype')) {
const switched={ name: '' + jQuery(this).attr('data-name') + '', unit: 1, value: jQuery(this).attr('data-value'), section: sec, subsection: sub, numberInput: true, paypal_name: '', custom_math: true, custom_math_type: jQuery(this).attr('data-math-type'), calculator_id: Number(jQuery(this).attr('calculator_id')), scc_woo_commerce_product_id: 0, show_detailed_list: jQuery(this).parent().parent().attr('data-show-detailed-list') ? jQuery(this).parent().parent().attr('data-show-detailed-list') : false };
parts.push(switched); hmm[sec][sub] = unitValue * jQuery(this).val() } else { var sld = parseFloat(jQuery(this).val()); } }); var _unit =1; var _section =9999999; var _usection =9999999; var calculator_id = 1;
for (var j = parts.length; j--;){ if(parts[j].section != _section || parts[j].subsection != _usection){ if(!parts[j].sliderInsubsection){ _section = parts[j].section; _usection = parts[j].subsection; if(parts[j].numberInput){
if(!isNaN(parseFloat(jQuery('#itemcreateds_'+_section+'_'+_usection+'_'+calculator_id).attr('data-value')))){ parts[j].unit = parts[j].unit * parseFloat(jQuery('#itemcreateds_'+_section+'_'+_usection+'_'+calculator_id).attr('data-value')); _unit = parseFloat(jQuery('#itemcreateds_'+_section+'_'+_usection+'_'+calculator_id).attr('data-value')) }else{ _unit = 1 }
}else{ parts[j].unit =parseFloat(jQuery('#itemcreateds_'+_section+'_'+_usection+'_'+calculator_id).attr('data-value')); _unit = parts[j].unit; } }
}else { var secn = parts[j].section; var subsecn = parts[j].subsection; //parts[j].unit = _unit; //_unit = parseFloat(jQuery('#itemcreateds_'+secn+'_'+subsecn).attr('data-value')); if(parts[j].numberInput){
if(!isNaN(parseFloat(jQuery('#itemcreateds_'+secn+'_'+subsecn+'_'+calculator_id).attr('data-value')))){ parts[j].unit = parts[j].unit * parseFloat(jQuery('#itemcreateds_'+secn+'_'+subsecn+'_'+calculator_id).attr('data-value')); _unit = parseFloat(jQuery('#itemcreateds_'+secn+'_'+subsecn+'_'+calculator_id).attr('data-value')) }else{ _unit = 1 }
}else{ parts[j].unit = parseFloat(jQuery('#itemcreateds_'+secn+'_'+subsecn+'_'+calculator_id).attr('data-value')) _unit = parts[j].unit; } } }
var executeMaths = true
for(var i=0; i < parts.length; i++) {
if(calculator_id != parts[i].calculator_id) {
executeMaths = false
}
}
if(executeMaths) {
priceObject = CreateTable_1(parts, comments);
price = priceObject.price
var scc_currency_conversion_rate = priceObject.scc_currency_conversion_rate
var scc_currency_conversion_label = priceObject.scc_currency_conversion_label
/*for(i =0; i
function currencyStyle(number){ switch (currencyStyleOption){ case 0: number = currencySymbol(currencyLabel) + " " + number break case 1: number = number + ' ' + currencyLabel break } return number } function currencySymbol(currency){ var currencySymbolLabel = '$'
switch(currency){ case 'ANG': currencySymbolLabel = 'ƒ' break case 'ILS': currencySymbolLabel = '₪' break case 'USD': currencySymbolLabel = '$' break case 'CAD': currencySymbolLabel = '$' break case 'EUR': currencySymbolLabel = '€' break case 'JPY': currencySymbolLabel = '¥' break case 'RUB': currencySymbolLabel = '₽' break case 'TRY': currencySymbolLabel = '₺' break case 'CHF': currencySymbolLabel = 'Fr.' break case 'SEK': currencySymbolLabel = 'kr' break case 'BRL': currencySymbolLabel = 'R$' break case 'CNY': currencySymbolLabel = '¥' break case 'AUD': currencySymbolLabel = 'A$' break case 'DKK': currencySymbolLabel = 'Kr.' break case 'HKD': currencySymbolLabel = 'HK$' break case 'GBP': currencySymbolLabel = '£' break case 'ZAR': currencySymbolLabel = 'R' break case 'ZMW': currencySymbolLabel = 'K' break case 'PKR': currencySymbolLabel = 'Rs' break case 'KRW': currencySymbolLabel = '₩' break case 'CFA': currencySymbolLabel = 'FCFA' break case 'IDR': currencySymbolLabel = 'Rp' break } return currencySymbolLabel } // currency Style function ends
// check If mandatory options are choosen jQuery('.btPayPalButtonCustom').click(function(e){ e.preventDefault(); var scc_mandatory = '';
jQuery('.mandatory_yes').each(function(){ jQuery(this).addClass('hehehehehehehe'); if(jQuery(this).val() ==''){ jQuery(this).parent().parent().find('.alert-danger').html('Please choose an option !'); jQuery(this).parent().parent().find('.alert-danger').css('display','block'); jQuery('html, body').animate({ scrollTop: jQuery(this).offset().top }, 1000); scc_mandatory = 'scc_remains'; if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) } checkIfParentIsAccordionAndOpenIt(this) } });
if (scc_mandatory == '') { if(Number(total) && Number(total) > 0){ jQuery("#paypal_form").submit(); jQuery("#paypal_form")[0].submit(); } }
});
function getDropDownValue($this){ price = jQuery($this).val(); if (! price) { return 0; } else return price; } function SCCOpenPopUpEmail_1(){ jQuery.getScript('https://www.meridianamedicalcenter.it/wp-content/plugins/stylish-cost-calculator-premium/assets/lib/bootstrap-3.3.5/dist/js/bootstrap.min.js', function(data) { var scc_mandatory = '';
jQuery('.mandatory_yes_1').each(function(){ if(jQuery(this).val() ==''){ jQuery(this).parent().parent().find('.alert-danger').html('Please choose an option !'); jQuery(this).parent().parent().find('.alert-danger').css('display','block'); jQuery('html, body').animate({ scrollTop: jQuery(this).offset().top }, 1000); if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) } checkIfParentIsAccordionAndOpenIt(this) scc_mandatory = 'scc_remains'; } }); if (scc_mandatory == '') { jQuery('#sccquoteModal').modal('show') jQuery('.modal-backdrop').each(function(){ jQuery(this).remove() }) } }) } jQuery('.scc-email-popup-close').click(function(e){ e.preventDefault(); jQuery('#sccquoteModal').modal('hide') jQuery('.scc-email-popup').removeClass('in'); })
function addCouponCodeModal_1(){ if(!coupon_1){ var minWidth = "500px" var titleFontSize = "35px" if( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)){ minWidth = "250px" titleFontSize = "15px"
}
var code=""
code += '
'; code += '
'; code += '
';
jQuery('#coupon_code_modal_container_1').html(code) jQuery('#coupon_code_modal_1').modal('show')
if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) }
jQuery('.modal-backdrop, fade, in:first').each(function(index, ob){ jQuery(ob).css('display', 'none') }) }
}
function checkCouponCode_1(){ jQuery('#button_check_coupon_1').html(' Checking...') jQuery.ajax( { url: rt_vars.rt_urlajax, type: 'GET', data: { action: 'sscCheckCoupon', coupon_code: jQuery('#coupon_code_1').val() }, success: function( data ){ if(typeof data === 'object'){ if(data.data){
if(data.data === false || data.data === 'false'){ jQuery('#coupon_code_error').html('This code is not valid.') if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) } }else if(typeof data.data === 'object'){ coupon_1 = data.data[0] jQuery('#coupon_code_modal_1').modal('hide') applyCouponDiscount(coupon_1) } } }else if(typeof data === 'string'){ if(data.length > 0){ var responseTemp = data.split('{"success":true,"data":')[data.split('{"success":true,"data":').length -1]
if(responseTemp.indexOf('false') == -1){ responseTemp = responseTemp.substring(1,responseTemp.length - 2) coupon_1 = JSON.parse(responseTemp)
jQuery('#coupon_code_modal_1').modal('hide') applyCouponDiscount(coupon_1) }else{
jQuery('#coupon_code_error').html('This code is not valid.') if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) } }
} }else if(!data){
} jQuery('#button_check_coupon').html('Check Coupon Code') }, error: function(errorThrown){ console.log(errorThrown); jQuery('#button_check_coupon').html('Check Coupon Code'); } }) } function applyCouponDiscount(coupon_1){ jQuery('.submitPrices').click(); }
function displayCouponDiscountInFrontEnd_1(price){ // substracting discount coupon if(!price || typeof price === 'undefined') { price = 0 } if(coupon_1){ var canDoDiscount = false if(Number(coupon_1.minspend) === -1 && Number(coupon_1.maxspend) === -1){ canDoDiscount = true }else{ if(Number(coupon_1.minspend) === -1 && Number(coupon_1.maxspend) != -1){ if(price <= coupon_1.maxspend){ canDoDiscount = true } }else if(Number(coupon_1.minspend) != -1 && Number(coupon_1.maxspend) === -1){ if(price >= coupon_1.minspend){ canDoDiscount = true } }else if(Number(coupon_1.minspend) != -1 && Number(coupon_1.minspend) != -1 ){ if(price >= Number(coupon_1.minspend) && price <= Number(coupon_1.maxspend)){ canDoDiscount = true } } } if(canDoDiscount){ if(Number(coupon_1.discountpercentage) != -1){ coupon_1.price_without_discount = price.toFixed(2) price = price.toFixed(2) - (price.toFixed(2) * (Number(coupon_1.discountpercentage)/100).toFixed(2)) coupon_1.discount_value_total = coupon_1.price_without_discount - price.toFixed(2) coupon_1.discount_value_total = Number(coupon_1.discount_value_total.toFixed(2)) } if(Number(coupon_1.discountvalue) != -1){ coupon_1.price_without_discount = price price = price < Number(coupon_1.discountvalue) ? 0 : price - Number(coupon_1.discountvalue) coupon_1.discount_value_total = Number(coupon_1.discountvalue) coupon_1.discount_value_total = Number(coupon_1.discount_value_total.toFixed(2)) } }else { coupon_1.price_without_discount = price coupon_1.discount_value_total = 0 } } //Applying Coupon Discount if(coupon_1){ jQuery('#coupon_info_container_1').css('display', 'block') if(canDoDiscount){ jQuery('#coupon_button_1').css('display', 'none') if(coupon_1.discountpercentage != -1.00){ jQuery('#coupon_info_discount_percentage_1').html('Discount percentage: ' + coupon_1.discountpercentage + '%') } if(coupon_1.discountvalue != -1.00){ if(currencyStyleOption === 0){ jQuery('#coupon_info_discount_value_1').html(currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon_1.discountvalue))
}else{ jQuery('#coupon_info_discount_value_1').html(priceCommaStyler(coupon_1.discountvalue) + ' ' + currencyLabel) } } }
if(Number(coupon_1.minspend) === -1.00 && Number(coupon_1.maxspend) === -1.00){ if(currencyStyleOption === 0){ jQuery('#coupon_info_spend_range_1').html('
Your discount has been applied correctly. -' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon_1.discount_value_total) + '
') }else{ jQuery('#coupon_info_spend_range_1').html('
Your discount has been applied correctly. -' + ' ' + priceCommaStyler(coupon_1.discount_value_total) + currencyLabel + '
') } }else{ if(Number(coupon_1.minspend) != -1.00 && Number(coupon_1.maxspend) != -1.00){
if(currencyStyleOption === 0){ jQuery('#coupon_info_spend_range_1').html(Number(coupon_1.price_without_discount) >= Number(coupon_1.minspend) && Number(coupon_1.maxspend) >= Number(coupon_1.price_without_discount) ? '
Your discount has been applied correctly. -' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon_1.discount_value_total) + '
': '
Your discount has not been applied because the total price has to be between ' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon_1.minspend) + ' and ' + currencySymbol(currencyLabel) + priceCommaStyler(coupon_1.maxspend) + '
') }else{ jQuery('#coupon_info_spend_range_1').html(Number(coupon_1.price_without_discount) >= Number(coupon_1.minspend) && Number(coupon_1.maxspend) >= Number(coupon_1.price_without_discount) ? '
Your discount has been applied correctly. -' + ' ' + priceCommaStyler(coupon_1.discount_value_total) + currencyLabel + '
': '
Your discount has not been applied because the total price has to be between ' + priceCommaStyler(coupon_1.minspend) + ' ' + currencyLabel + ' and ' + priceCommaStyler(coupon_1.maxspend) + ' ' + currencyLabel + '
') } }else if(Number(coupon_1.minspend) != -1.00 && Number(coupon_1.maxspend) === -1.00){ if(currencyStyleOption === 0){ jQuery('#coupon_info_spend_range_1').html(Number(coupon_1.price_without_discount) >= Number(coupon_1.minspend) ? '
Your discount has been applied correctly. -' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon_1.discount_value_total) + '
': '
Your discount has not been applied because the total price has to be higher than ' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon_1.minspend) + currencySymbol(currencyLabel) + '
') }else{ jQuery('#coupon_info_spend_range_1').html(Number(coupon_1.price_without_discount) >= Number(coupon_1.minspend) ? '
Your discount has been applied correctly. -' + ' ' + priceCommaStyler(coupon_1.discount_value_total) + currencyLabel + '
': '
Your discount has not been applied because the total price has to be higher than ' + priceCommaStyler(coupon_1.minspend) + ' ' + currencyLabel + '
') } }else if(Number(coupon_1.minspend) === -1.00 && Number(coupon_1.maxspend) != -1.00){ if(currencyStyleOption === 0){ jQuery('#coupon_info_spend_range_1').html(Number(coupon_1.maxspend) >= Number(coupon.price_without_discount) ? '
Your discount has been applied correctly. -' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon_1.discountvalue) + '
': '
Your discount has not been applied because the total price has to be lower than ' + currencySymbol(currencyLabel) + priceCommaStyler(coupon_1.maxspend) + '
') }else{ jQuery('#coupon_info_spend_range_1').html(Number(coupon_1.maxspend) >= Number(coupon.price_without_discount) ? '
Your discount has been applied correctly. -' + ' ' + priceCommaStyler(coupon_1.discountvalue) + currencyLabel + '
': '
Your discount has not been applied because the total price has to be lower than ' + priceCommaStyler(coupon_1.maxspend) + ' ' + currencyLabel + '
') } } } }
return price }
"; table_body += "
";
table_body += "