[section]

[row]

[col span__sm=”12″]

[ux_text text_align=”center”]

فصل باقتك علي مزاجك
اختار لتحديد سعرك بما يناسب ميزانيتك
Additional Features
Contact Form
Sliders/Banners
Scheduling/Booking System
Mailing List
Mobile Responsive
Shopping Cart/E-Commerce
Social Media Feeds
Addition work

 
Total 1
"+scc_jQuery(this).find("option:selected").attr('data-description')+"
", value:parseFloat(getDropDownValue(this)), unit: 1, section: sec, subsection: sub, paypal_name: scc_jQuery(this).find("option:selected").text() }; parts.push(switched); } } else if ('sliderinput' == scc_jQuery(this).attr('data-inputtype')){ totalnumber1 =scc_jQuery(this).attr('data_range').split(","); var isSlidingScale = Boolean(scc_jQuery(this).attr('data-is-sliding-scale') == 'true'); var sliderunitprc = totalnumber1 [totalnumber1.length-1]; var slide_value = parseFloat(scc_jQuery(this).attr('data-value')); var unitprice = sliderunitprc*slide_value; multislider[sec][sub]=slide_value; for (k=0;k
"+scc_jQuery(this).parent().parent().parent().find('label:last').text()+"
", unit:slide_value, value: parseFloat(totalnumber1[k+2]), section: sec, subsection: sub, sliderInsubsection: true, isSlidingScale: isSlidingScale, paypal_name: scc_jQuery(this).parent().parent().find('label:last').text()}; parts.push(switched); //price += multislider[j]*(xprice[j]+hmm[j]); break; } } } else if ('comment_input' == scc_jQuery(this).attr('data-inputtype')){ if(scc_jQuery(this) && scc_jQuery(this).val() && scc_jQuery(this).val().length > 0){ const comment = { name: "
"+scc_jQuery(this).parent().parent().find('label:last').text()+"
", text: scc_jQuery(this).val(), section: sec, subsection: sub, unit: 1, value: 0, comment: true, paypal_title: scc_jQuery(this).parent().parent().find('label:last').text(), paypal_text: scc_jQuery(this).val() } parts.push(comment); //comments.push(comment); } } else if ('number_input' == scc_jQuery(this).attr('data-inputtype')){ var unitValue =scc_jQuery(this).attr('data-value'); const switched={name: "
"+scc_jQuery(this).parent().parent().find('label:last').text()+"
", unit:scc_jQuery(this).val(), value: unitValue, section: sec, subsection: sub, numberInput: true, paypal_name: scc_jQuery(this).parent().parent().find('label:last').text()}; parts.push(switched); hmm[sec][sub] = unitValue * scc_jQuery(this).val() }else if('scc_custom_math' == scc_jQuery(this).attr('data-inputtype')) { const switched={ name: scc_jQuery(this).attr('data-name'), unit: 1, value: scc_jQuery(this).attr('data-value'), section: sec, subsection: sub, numberInput: true, paypal_name: '', custom_math: true, custom_math_type: scc_jQuery(this).attr('data-math-type'), show_detailed_list: scc_jQuery(this).parent().parent().attr('data-show-detailed-list') ? scc_jQuery(this).parent().parent().attr('data-show-detailed-list') : false }; parts.push(switched); hmm[sec][sub] = unitValue * scc_jQuery(this).val() } else { var sld = parseFloat(scc_jQuery(this).val()); } }); var _unit =1; var _section =9999999; var _usection =9999999; 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(scc_jQuery('#itemcreateds_'+_section+'_'+_usection).attr('data-value')))){ parts[j].unit = parts[j].unit * parseFloat(scc_jQuery('#itemcreateds_'+_section+'_'+_usection).attr('data-value')); _unit = parseFloat(scc_jQuery('#itemcreateds_'+_section+'_'+_usection).attr('data-value')) }else{ _unit = 1 } }else{ parts[j].unit =parseFloat(scc_jQuery('#itemcreateds_'+_section+'_'+_usection).attr('data-value')); _unit = parts[j].unit; } } }else { var secn = parts[j].section; var subsecn = parts[j].subsection; //parts[j].unit = _unit; //_unit = parseFloat(scc_jQuery('#itemcreateds_'+secn+'_'+subsecn).attr('data-value')); if(parts[j].numberInput){ if(!isNaN(parseFloat(scc_jQuery('#itemcreateds_'+secn+'_'+subsecn).attr('data-value')))){ parts[j].unit = parts[j].unit * parseFloat(scc_jQuery('#itemcreateds_'+secn+'_'+subsecn).attr('data-value')); _unit = parseFloat(scc_jQuery('#itemcreateds_'+secn+'_'+subsecn).attr('data-value')) }else{ _unit = 1 } }else{ parts[j].unit = parseFloat(scc_jQuery('#itemcreateds_'+secn+'_'+subsecn).attr('data-value')) _unit = parts[j].unit; } } } price = CreateTable(parts, comments); /*for(i =0; i 0){ itemsToAddPaypalForm += ' ' itemsToAddPaypalForm += ' ' itemsAdded++ // } total += (items[i].unit === null ? items[i].value : (items[i].value * items[i].unit)) } /* if(tax && tax > 0){ console.log('tax included!') itemsToAddPaypalForm += ' ' itemsToAddPaypalForm += ' ' total += tax } */ scc_jQuery('#paypal_form_add_items').html(itemsToAddPaypalForm) } //paypal ends // currency Style function starts var currencyStyleOption = 0; var currencyLabel = 'USD'; function currencyStyle(number){ switch (currencyStyleOption){ case 0: number = currencySymbol(currencyLabel) + number 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 'NOK': currencySymbolLabel = 'kr' 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 'RON': currencySymbolLabel = 'RON' break case '‎PKR': currencySymbolLabel = 'Rs' break case 'KRW': currencySymbolLabel = '₩' break case 'CFA': currencySymbolLabel = 'FCFA' break case 'PLN': currencySymbolLabel = 'zł' break case 'IDR': currencySymbolLabel = 'Rp' break default: currencySymbolLabel = currency || '$' } return currencySymbolLabel } // currency Style function ends // check If mandatory options are choosen document.addEventListener('DOMContentLoaded', (event) => { scc_jQuery('.btPayPalButtonCustom').click(function(e){ e.preventDefault(); var scc_mandatory = ''; scc_jQuery('.mandatory_yes').each(function(){ scc_jQuery(this).addClass('hehehehehehehe'); if(scc_jQuery(this).val() ==''){ scc_jQuery(this).parent().parent().find('.alert-danger').html('Please choose an option !'); scc_jQuery(this).parent().parent().find('.alert-danger').css('display','block'); scc_jQuery('html, body').animate({ scrollTop: scc_jQuery(this).offset().top }, 1000); scc_mandatory = 'scc_remains'; if(window.hasOwnProperty("translatorJson")){ initTranslationScriptSCC('body', {lang: "en", t: translatorJson}); } checkIfParentIsAccordionAndOpenIt(this) } }); // check if mandatory checkbox/button/switches are checked scc_jQuery('[data-mandatory=yes]').each((i,e) => { isNoneChecked = !(scc_jQuery('input', e).map((i,ee) => {return jQuery(ee).is(':checked')}).get().some(eee => eee == true)) if (isNoneChecked) { scc_jQuery(e).find('.alert-danger').html('Please choose an option !').css('display','block'); scc_jQuery(e).parent().find('.scc-accordion').click(); scc_jQuery('html, body').animate({ scrollTop: scc_jQuery(e).offset().top }, 1000); scc_mandatory = 'scc_remains'; } else { scc_jQuery(e).find('.alert-danger').hide(); // scc_mandatory == ''; } }) if (scc_mandatory == '') { if(Number(total) && Number(total) > 0){ scc_jQuery("#paypal_form").submit(); scc_jQuery("#paypal_form")[0].submit(); } } }); }); function getDropDownValue($this){ price = scc_jQuery($this).val(); if (! price) { return 0; } else return price; } function SCCOpenPopUpEmail(){ scc_jQuery.getScript('https://smarter-set.com/wp-content/plugins/stylish-cost-calculator/assets/lib/bootstrap-3.3.5/dist/js/bootstrap.min.js', function(data) { var scc_mandatory = ''; scc_jQuery('.mandatory_yes').each(function(){ if(scc_jQuery(this).val() ==''){ scc_jQuery(this).parent().parent().find('.alert-danger').html('Please choose an option !'); scc_jQuery(this).parent().parent().find('.alert-danger').css('display','block'); scc_jQuery('html, body').animate({ scrollTop: scc_jQuery(this).offset().top }, 1000); scc_mandatory = 'scc_remains'; if(window.hasOwnProperty("translatorJson")){ initTranslationScriptSCC('body', {lang: "en", t: translatorJson}); } checkIfParentIsAccordionAndOpenIt(this) } }); // check if mandatory checkbox/button/switches are checked scc_jQuery('[data-mandatory=yes]').each((i,e) => { isNoneChecked = !(scc_jQuery('input', e).map((i,ee) => {return jQuery(ee).is(':checked')}).get().some(eee => eee == true)) if (isNoneChecked) { scc_jQuery(e).find('.alert-danger').html('Please choose an option !').css('display','block'); scc_jQuery(e).parent().find('.scc-accordion').click(); scc_jQuery('html, body').animate({ scrollTop: scc_jQuery(e).offset().top }, 1000); scc_mandatory = 'scc_remains'; } else { scc_jQuery(e).find('.alert-danger').hide(); // scc_mandatory == ''; } }) if (scc_mandatory == '') { scc_jQuery('#sccquoteModal').modal('show') scc_jQuery('.modal-backdrop').each(function(){ scc_jQuery(this).remove() }) } }) } document.addEventListener('DOMContentLoaded', (event) => { scc_jQuery('.scc-email-popup-close').click(function(e){ e.preventDefault(); scc_jQuery('#sccquoteModal').modal('hide') scc_jQuery('.scc-email-popup').removeClass('in'); }) }); function addCouponCodeModal(){ if(!coupon){ 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" console.log('Im mobile') } var code="" code += ''; scc_jQuery('#coupon_code_modal_container').html(code) scc_jQuery('#coupon_code_modal').modal('show') if(window.hasOwnProperty("translatorJson")){ initTranslationScriptSCC('body', {lang: "en", t: translatorJson}); } scc_jQuery('.modal-backdrop, fade, in:first').each(function(index, ob){ scc_jQuery(ob).css('display', 'none') }) } } function checkCouponCode(){ scc_jQuery('#button_check_coupon').html(' Checking...') scc_jQuery.ajax( { url: rt_vars.rt_urlajax, type: 'GET', data: { action: 'sscCheckCoupon', coupon_code: scc_jQuery('#coupon_code').val() }, success: function( data ){ if(typeof data === 'object'){ if(data.data){ if(data.data === false || data.data === 'false'){ scc_jQuery('#coupon_code_error').html('This code is not valid') if(window.hasOwnProperty("translatorJson")){ initTranslationScriptSCC('body', {lang: "en", t: translatorJson}); } }else if(typeof data.data === 'object'){ coupon = data.data[0] scc_jQuery('#coupon_code_modal').modal('hide') applyCouponDiscount(coupon) } } }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 = JSON.parse(responseTemp) scc_jQuery('#coupon_code_modal').modal('hide') applyCouponDiscount(coupon) }else{ scc_jQuery('#coupon_code_error').html('This code is not valid.') if(window.hasOwnProperty("translatorJson")){ initTranslationScriptSCC('body', {lang: "en", t: translatorJson}); } } } }else if(!data){ } scc_jQuery('#button_check_coupon').html('Check Coupon Code') }, error: function(errorThrown){ console.log(errorThrown); scc_jQuery('#button_check_coupon').html('Check Coupon Code'); } }) } function applyCouponDiscount(coupon){ scc_jQuery('.submitPrices').click(); } function displayCouponDiscountInFrontEnd(price){ // substracting discount coupon if(!price || typeof price === 'undefined') { price = 0 } if(coupon){ var canDoDiscount = false if(Number(coupon.minspend) === -1 && Number(coupon.maxspend) === -1){ canDoDiscount = true }else{ if(Number(coupon.minspend) === -1 && Number(coupon.maxspend) != -1){ if(price = coupon.minspend){ canDoDiscount = true } }else if(Number(coupon.minspend) != -1 && Number(coupon.minspend) != -1 ){ if(price >= Number(coupon.minspend) && price Discount percentage: ' + coupon.discountpercentage + '%') } if(coupon.discountvalue != -1.00){ if(currencyStyleOption === 0){ scc_jQuery('#coupon_info_discount_value').html(currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.discountvalue)) }else{ scc_jQuery('#coupon_info_discount_value').html(priceCommaStyler(coupon.discountvalue) + ' ' + currencyLabel) } } } if(Number(coupon.minspend) === -1.00 && Number(coupon.maxspend) === -1.00){ if(currencyStyleOption === 0){ scc_jQuery('#coupon_info_spend_range').html('

Your discount has been applied correctly. -' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.discount_value_total) + '

') }else{ scc_jQuery('#coupon_info_spend_range').html('

Your discount has been applied correctly. -' + ' ' + priceCommaStyler(coupon.discount_value_total) + currencyLabel + '

') } }else{ if(Number(coupon.minspend) != -1.00 && Number(coupon.maxspend) != -1.00){ if(currencyStyleOption === 0){ scc_jQuery('#coupon_info_spend_range').html(Number(coupon.price_without_discount) >= Number(coupon.minspend) && Number(coupon.maxspend) >= Number(coupon.price_without_discount) ? '

Your discount has been applied correctly. -' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.discount_value_total) + '

': '

Your discount has not been applied because the total price has to be between ' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.minspend) + ' and ' + currencySymbol(currencyLabel) + priceCommaStyler(coupon.maxspend) + '

') }else{ scc_jQuery('#coupon_info_spend_range').html(Number(coupon.price_without_discount) >= Number(coupon.minspend) && Number(coupon.maxspend) >= Number(coupon.price_without_discount) ? '

Your discount has been applied correctly. -' + ' ' + priceCommaStyler(coupon.discount_value_total) + currencyLabel + '

': '

Your discount has not been applied because the total price has to be between ' + priceCommaStyler(coupon.minspend) + ' ' + currencyLabel + ' and ' + priceCommaStyler(coupon.maxspend) + ' ' + currencyLabel + '

') } }else if(Number(coupon.minspend) != -1.00 && Number(coupon.maxspend) === -1.00){ if(currencyStyleOption === 0){ scc_jQuery('#coupon_info_spend_range').html(Number(coupon.price_without_discount) >= Number(coupon.minspend) ? '

Your discount has been applied correctly. -' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.discount_value_total) + '

': '

Your discount has not been applied because the total price has to be higher than ' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.minspend) + currencySymbol(currencyLabel) + '

') }else{ scc_jQuery('#coupon_info_spend_range').html(Number(coupon.price_without_discount) >= Number(coupon.minspend) ? '

Your discount has been applied correctly. -' + ' ' + priceCommaStyler(coupon.discount_value_total) + currencyLabel + '

': '

Your discount has not been applied because the total price has to be higher than ' + priceCommaStyler(coupon.minspend) + ' ' + currencyLabel + '

') } }else if(Number(coupon.minspend) === -1.00 && Number(coupon.maxspend) != -1.00){ if(currencyStyleOption === 0){ scc_jQuery('#coupon_info_spend_range').html(Number(coupon.maxspend) >= Number(coupon.price_without_discount) ? '

Your discount has been applied correctly. -' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.discountvalue) + '

': '

Your discount has not been applied because the total price has to be lower than ' + currencySymbol(currencyLabel) + priceCommaStyler(coupon.maxspend) + '

') }else{ scc_jQuery('#coupon_info_spend_range').html(Number(coupon.maxspend) >= Number(coupon.price_without_discount) ? '

Your discount has been applied correctly. -' + ' ' + priceCommaStyler(coupon.discountvalue) + currencyLabel + '

': '

Your discount has not been applied because the total price has to be lower than ' + priceCommaStyler(coupon.maxspend) + ' ' + currencyLabel + '

') } } } } return price }
[/ux_text]

[/col]

[/row]

[/section]

16/04/21
Website Designer
Description
Quantity
Unit Price
Price
`; 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 = 'USD'; var lastTitle = '' var currentSubsection = -1 var sections = [] var section = [] var subsection = [] for(var i=0;i 0 || parts[i].value 0) || parts[i].comment) { if(parts[i].value == 0.001){ parts[i].value = 0 } if(parts[i].subsection != currentSubsection) { section.push(subsection) subsection = [] currentSubsection = parts[i].subsection } if(lastTitle != currentTitle){ if(lastTitle != '') { sections.push(section) section = [] } table_body+="
"; table_body+=germanCharactersInverseFrontEnd("
فصل باقتك علي مزاجك
"); height +=6; lastTitle = currentTitle; var jsonPDFrowSection = { type: "section_title", section_title: currentTitle } jsonPDF.rows.push(jsonPDFrowSection) } if(isNaN(parts[i].unit)){ parts[i].unit = 1; } var jsonPDFrow = {} var elementName = "" if(scc_jQuery(parts[i].name).hasClass('row-fluid Product-Titles-Summary-Window')){ if(scc_jQuery(parts[i].name).children().length == 2) { jsonPDFrow = { type: "element_dropdown", attr: { name: scc_jQuery(parts[i].name).find('.span2').text().trim(), description: scc_jQuery(parts[i].name).find('.product-desc-summary-scc').text(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(!parts[i].comment){ jsonPDFrow = { type: "element", attr: { name: scc_jQuery(parts[i].name).find('.span2').text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value, isSlidingScale: parts[i].isSlidingScale, } } } } } else { if(scc_jQuery(parts[i].name).hasClass('span2')){ jsonPDFrow = { type: "element", attr: { name: scc_jQuery(parts[i].name).text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(parts[i].custom_math) { jsonPDFrow = { type: "custom_math", attr: { value_with_currency: priceCommaStyler(parts[i].value), value: parts[i].value, type: parts[i].custom_math_type, name: scc_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: parts[i].value, unit_price: "", total_price: "" } } } } } if(parts[i].custom_math){ /* adding currency in frontend custom math: */ scc_jQuery('.scc_custom_math_value_front_end').each(function(index, ob){ scc_jQuery(ob).text() scc_jQuery(ob).text((priceCommaStyler(parts[i].value))) }) /* CUSTOM MATH */ 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 += "
"+parts[i].name+"
"; table_body += "
"; table_body += "
" + ( (parts[i].custom_math_type == '%') ? percentType : notPercentTypeWithCurrency ) + "
"; //table_body += "
" table_body += "
" + ( (parts[i].custom_math_type == '%') ? '' : '' ) + "
"; table_body += "
" } }else { if(parts[i].comment){ table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
" + parts[i].text + "
"; table_body += "
" var jsonDPDFcomment = { type: "comment", attr: { title: scc_jQuery(parts[i].name).find('.span2').text(), comment: parts[i].text } } jsonPDF.rows.push(jsonDPDFcomment) }else { table_body+="
"; table_body+="
"+parts[i].name+"
"; // table_body+="
"+parts[i].value+" USD
"; table_body+="
"+parts[i].unit+"
"; //Quantity for all items table_body+="
  "+priceCommaStyler(parts[i].value) + "
"; //Unit value for all items table_body+="
  "+priceCommaStyler( ( !(parts[i].isSlidingScale) ? parts[i].unit * parts[i].value : parts[i].value ).toFixed(2) )+"
"; // Price for all items jsonPDFrow.attr["unit_price"] = parts[i].value jsonPDFrow.attr["total_price"] = currencyStyle(priceCommaStyler((!(parts[i].isSlidingScale) ? parts[i].unit * parts[i].value : parts[i].value).toFixed(2))) } } jsonPDF.rows.push(jsonPDFrow) subsection.push(jsonPDFrow) table_body+="
"; // totalPrice +=(parts[i].unit*parts[i].value); height +=6; }else{ } } } section.push(subsection) sections.push(section) /* START - CUSTOM MATH CALCULATOR */ for(var i = 0; i 0 || parts[i].value 0) || parts[i].comment) { if(parts[i].value == 0.001){ parts[i].value = 0 } if(parts[i].subsection != currentSubsection) { section.push(subsection) subsection = [] currentSubsection = parts[i].subsection } if(lastTitle != currentTitle){ if(lastTitle != '') { sections.push(section) section = [] } table_body+="
"; table_body+=germanCharactersInverseFrontEnd("
Additional Features
"); height +=6; lastTitle = currentTitle; var jsonPDFrowSection = { type: "section_title", section_title: currentTitle } jsonPDF.rows.push(jsonPDFrowSection) } if(isNaN(parts[i].unit)){ parts[i].unit = 1; } var jsonPDFrow = {} var elementName = "" if(scc_jQuery(parts[i].name).hasClass('row-fluid Product-Titles-Summary-Window')){ if(scc_jQuery(parts[i].name).children().length == 2) { jsonPDFrow = { type: "element_dropdown", attr: { name: scc_jQuery(parts[i].name).find('.span2').text().trim(), description: scc_jQuery(parts[i].name).find('.product-desc-summary-scc').text(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(!parts[i].comment){ jsonPDFrow = { type: "element", attr: { name: scc_jQuery(parts[i].name).find('.span2').text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value, isSlidingScale: parts[i].isSlidingScale, } } } } } else { if(scc_jQuery(parts[i].name).hasClass('span2')){ jsonPDFrow = { type: "element", attr: { name: scc_jQuery(parts[i].name).text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(parts[i].custom_math) { jsonPDFrow = { type: "custom_math", attr: { value_with_currency: priceCommaStyler(parts[i].value), value: parts[i].value, type: parts[i].custom_math_type, name: scc_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: parts[i].value, unit_price: "", total_price: "" } } } } } if(parts[i].custom_math){ /* adding currency in frontend custom math: */ scc_jQuery('.scc_custom_math_value_front_end').each(function(index, ob){ scc_jQuery(ob).text() scc_jQuery(ob).text((priceCommaStyler(parts[i].value))) }) /* CUSTOM MATH */ 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 += "
"+parts[i].name+"
"; table_body += "
"; table_body += "
" + ( (parts[i].custom_math_type == '%') ? percentType : notPercentTypeWithCurrency ) + "
"; //table_body += "
" table_body += "
" + ( (parts[i].custom_math_type == '%') ? '' : '' ) + "
"; table_body += "
" } }else { if(parts[i].comment){ table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
" + parts[i].text + "
"; table_body += "
" var jsonDPDFcomment = { type: "comment", attr: { title: scc_jQuery(parts[i].name).find('.span2').text(), comment: parts[i].text } } jsonPDF.rows.push(jsonDPDFcomment) }else { table_body+="
"; table_body+="
"+parts[i].name+"
"; // table_body+="
"+parts[i].value+" USD
"; table_body+="
"+parts[i].unit+"
"; //Quantity for all items table_body+="
  "+priceCommaStyler(parts[i].value) + "
"; //Unit value for all items table_body+="
  "+priceCommaStyler( ( !(parts[i].isSlidingScale) ? parts[i].unit * parts[i].value : parts[i].value ).toFixed(2) )+"
"; // Price for all items jsonPDFrow.attr["unit_price"] = parts[i].value jsonPDFrow.attr["total_price"] = currencyStyle(priceCommaStyler((!(parts[i].isSlidingScale) ? parts[i].unit * parts[i].value : parts[i].value).toFixed(2))) } } jsonPDF.rows.push(jsonPDFrow) subsection.push(jsonPDFrow) table_body+="
"; // totalPrice +=(parts[i].unit*parts[i].value); height +=6; }else{ } } } section.push(subsection) sections.push(section) /* START - CUSTOM MATH CALCULATOR */ for(var i = 0; i 0 || parts[i].value 0) || parts[i].comment) { if(parts[i].value == 0.001){ parts[i].value = 0 } if(parts[i].subsection != currentSubsection) { section.push(subsection) subsection = [] currentSubsection = parts[i].subsection } if(lastTitle != currentTitle){ if(lastTitle != '') { sections.push(section) section = [] } table_body+="
"; table_body+=germanCharactersInverseFrontEnd("
Addition work
"); height +=6; lastTitle = currentTitle; var jsonPDFrowSection = { type: "section_title", section_title: currentTitle } jsonPDF.rows.push(jsonPDFrowSection) } if(isNaN(parts[i].unit)){ parts[i].unit = 1; } var jsonPDFrow = {} var elementName = "" if(scc_jQuery(parts[i].name).hasClass('row-fluid Product-Titles-Summary-Window')){ if(scc_jQuery(parts[i].name).children().length == 2) { jsonPDFrow = { type: "element_dropdown", attr: { name: scc_jQuery(parts[i].name).find('.span2').text().trim(), description: scc_jQuery(parts[i].name).find('.product-desc-summary-scc').text(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(!parts[i].comment){ jsonPDFrow = { type: "element", attr: { name: scc_jQuery(parts[i].name).find('.span2').text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value, isSlidingScale: parts[i].isSlidingScale, } } } } } else { if(scc_jQuery(parts[i].name).hasClass('span2')){ jsonPDFrow = { type: "element", attr: { name: scc_jQuery(parts[i].name).text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(parts[i].custom_math) { jsonPDFrow = { type: "custom_math", attr: { value_with_currency: priceCommaStyler(parts[i].value), value: parts[i].value, type: parts[i].custom_math_type, name: scc_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: parts[i].value, unit_price: "", total_price: "" } } } } } if(parts[i].custom_math){ /* adding currency in frontend custom math: */ scc_jQuery('.scc_custom_math_value_front_end').each(function(index, ob){ scc_jQuery(ob).text() scc_jQuery(ob).text((priceCommaStyler(parts[i].value))) }) /* CUSTOM MATH */ 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 += "
"+parts[i].name+"
"; table_body += "
"; table_body += "
" + ( (parts[i].custom_math_type == '%') ? percentType : notPercentTypeWithCurrency ) + "
"; //table_body += "
" table_body += "
" + ( (parts[i].custom_math_type == '%') ? '' : '' ) + "
"; table_body += "
" } }else { if(parts[i].comment){ table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
" + parts[i].text + "
"; table_body += "
" var jsonDPDFcomment = { type: "comment", attr: { title: scc_jQuery(parts[i].name).find('.span2').text(), comment: parts[i].text } } jsonPDF.rows.push(jsonDPDFcomment) }else { table_body+="
"; table_body+="
"+parts[i].name+"
"; // table_body+="
"+parts[i].value+" USD
"; table_body+="
"+parts[i].unit+"
"; //Quantity for all items table_body+="
  "+priceCommaStyler(parts[i].value) + "
"; //Unit value for all items table_body+="
  "+priceCommaStyler( ( !(parts[i].isSlidingScale) ? parts[i].unit * parts[i].value : parts[i].value ).toFixed(2) )+"
"; // Price for all items jsonPDFrow.attr["unit_price"] = parts[i].value jsonPDFrow.attr["total_price"] = currencyStyle(priceCommaStyler((!(parts[i].isSlidingScale) ? parts[i].unit * parts[i].value : parts[i].value).toFixed(2))) } } jsonPDF.rows.push(jsonPDFrow) subsection.push(jsonPDFrow) table_body+="
"; // totalPrice +=(parts[i].unit*parts[i].value); height +=6; }else{ } } } section.push(subsection) sections.push(section) /* START - CUSTOM MATH CALCULATOR */ for(var i = 0; i 0){ table_body +="
" table_body +="
" for(var i=0; i" table_body += "
"+comments[i].title+"
"; table_body += "
" + comments[i].text + "
"; table_body += "
" table_body += "" var jsonDPDFcomment = { type: "comment", attr: { title: scc_jQuery(comments[i].title).find('.span2').text(), comment: comments[i].text } } jsonPDF.rows.push(jsonDPDFcomment) } // table_body +="
" } subTotal = displayCouponDiscountInFrontEnd(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(coupon){ table_body+="
"; if(Number(coupon.discountpercentage) != -1){ var jsonPDFcoupon = { type: "coupon", attr: { title: "Coupon Discount " + coupon.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.discountpercentage + "%", discount_price: "" } } } } table_body+="
Coupon Discount " + coupon.discountpercentage + "%
"; jsonPDFcoupon.attr["discount_price"] = "-" + currencyStyle(priceCommaStyler(coupon.discount_value_total.toFixed(2))) +"" table_body+="
-" + priceCommaStyler(coupon.discount_value_total.toFixed(2)) +" USD
"; jsonPDF.rows.push(jsonPDFcoupon) } if(Number(coupon.discountvalue) != -1){ var jsonPDFcoupon = { type: "coupon", attr: { title: "", discount_price: "" } } jsonPDFcoupon.attr["title"] = "Coupon Discount " + currencyStyle(priceCommaStyler(Number(coupon.discountvalue).toFixed(2))) jsonPDFcoupon.attr["discount_price"] = "-" + currencyStyle(priceCommaStyler(coupon.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.discountvalue).toFixed(2))) } } table_body+="
Coupon Discount " + priceCommaStyler(Number(coupon.discountvalue).toFixed(2)) + " USD
"; table_body+="
-" + priceCommaStyler(coupon.discount_value_total.toFixed(2)) +" USD
"; jsonPDF.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: "Total Price", price: "" } } table_body+="
Total Price
"; jsonPDFtotal.attr["price"] = currencyStyle(priceCommaStyler(finalTotal.toFixed(2))) table_body+="
" + priceCommaStyler(finalTotal.toFixed(2)) +" USD
"; jsonPDF.rows.push(jsonPDFtotal) table_body+="
"; table_body+="
"; /* table_body+="
Issue On: ".date('m/d/Y H:i')."
"; */ var xheight = 42+height - 100; if (xheight "; // table_body+="
" // table_body+="
"; // table_body+="
"; // table_body+="
"; // table_body+="
"; // table_body+="
"; // table_body+="
"; table_body+="
"; table_body+=""; scc_jQuery('#sccTale_price').html(table_body); if(window.hasOwnProperty("translatorJson")){ initTranslationScriptSCC('body', {lang: "en", t: translatorJson}); } scc_jQuery('body').find('.Description').each(function(index, ob){ jsonPDF.description = scc_jQuery(ob).text() }) scc_jQuery('body').find('.Quantity').each(function(index, ob){ jsonPDF.quantity = scc_jQuery(ob).text() }) scc_jQuery('body').find('.Unit').each(function(index, ob){ jsonPDF.unit = scc_jQuery(ob).text() }) scc_jQuery('body').find('.Price').each(function(index, ob){ jsonPDF.price = scc_jQuery(ob).text() }) scc_jQuery('body').find('.subtotal_tax_for_pdf').each(function(index, ob){ for(var i= 0; 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; } return parseFloat(price).toLocaleString(navigator.languages[0]); } 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(enable){ if(enable ==0){ scc_jQuery('.scc-alert').remove(); return; } $ajaxQuery= { url: rt_vars.rt_urlajax, type: 'POST', xhrFields: { responseType: '' }, data: { action: 'sccSendPDF', payload: Base64.encode(JSON.stringify(jsonPDF)), tableTitle, }, success: function(b64){ const linkSource = `data:application/pdf;base64,${b64}`; const downloadLink = document.createElement("a"); const fileName = "quote.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); } } scc_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){ scc_jQuery("#myModalSCCEmailQuote").modal(); scc_jQuery('.modal-backdrop').each(function(){ scc_jQuery(this).removeClass('modal-backdrop') }) return; } console.log("scc_jQuery('#sscemailAddress').val().length", scc_jQuery('#sscemailAddress').val().length) if(!scc_jQuery('#sscemailAddress') || !scc_jQuery('#sscemailAddress').val() || !scc_jQuery('#sscemailAddress').val().includes('@') || !scc_jQuery('#sscemailAddress').val().includes('.') || scc_jQuery('#sscemailAddress').val().includes('#') || scc_jQuery('#sscemailAddress').val().length 0){ title = titleFromDatabase } var email = scc_jQuery('#sscemailAddress').val() var user = scc_jQuery('#sscuserAddress').val() var phone = scc_jQuery('#sscuserPhone').val(); bar.setValue(0.90); scc_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 = /*@[email protected]*/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)), email_to: email, user_to: user, title: title, phone: phone, ipaddress: ipaddress, browserInfo: browserInfo, device: isMobile }, success: function(data) { bar.setValue(1); ClosePopup_scc2() setTimeout(() => { removeSendEmailProgress() scc_jQuery('body').css({ overflow: 'visible' }); // restore header and footer's initial display property value scc_jQuery('header').each(function () { var initialState = jQuery(this).data('scc-headerState'); scc_jQuery(this).css({display: initialState}); }); scc_jQuery('footer').each(function () { var initialState = jQuery(this).data('scc-footerState'); scc_jQuery(this).css({display: initialState}); }); }, 1000); scc_jQuery('#statusMsg').html(' Thank you, '+user+'. Your quote has been sent to '+email+''); } } scc_jQuery.ajax( $fragment_refresh ) }) .fail(function() { $fragment_refresh={ url: rt_vars.rt_urlajax, type: 'POST', data: { action: 'sccSendEmail', payload: Base64.encode(JSON.stringify(jsonPDF)), 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() scc_jQuery('body').css({ overflow: 'visible' }); // restore header and footer's initial display property value scc_jQuery('header').each(function () { var initialState = jQuery(this).data('scc-headerState'); scc_jQuery(this).css({display: initialState}); }); scc_jQuery('footer').each(function () { var initialState = jQuery(this).data('scc-footerState'); scc_jQuery(this).css({display: initialState}); }); }, 1000); scc_jQuery('#statusMsg').html(' Thank you, '+user+'. Your quote has been sent to '+email+''); } } scc_jQuery.ajax( $fragment_refresh ) }) scc_jQuery('.scc-email-popup-close').click(); setTimeout(function(){scc_jQuery('#sccidsent').show();},600); } function check(doc,title, clone, currentScroll, bar){ scc_jQuery.getJSON('https://httpbin.org/ip', function(data) { var titleFromDatabase = ""; if(titleFromDatabase && titleFromDatabase.length > 0){ title = titleFromDatabase } var email = scc_jQuery('#sscemailAddress').val() var user = scc_jQuery('#sscuserAddress').val() var phone = scc_jQuery('#sscuserPhone').val(); bar.setValue(0.90); var pdf = btoa(doc.output()); scc_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 = /*@[email protected]*/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)), email_to: email, user_to: user, title: title, phone: phone, ipaddress: ipaddress, browserInfo: browserInfo, device: isMobile }, success: function(data) { bar.setValue(1); ClosePopup_scc2(); document.body.removeChild(clone); setTimeout(() => { removeSendEmailProgress() scc_jQuery('body').css({ overflow: 'visible' }); // restore header and footer's initial display property value scc_jQuery('header').each(function () { var initialState = jQuery(this).data('scc-headerState'); scc_jQuery(this).css({display: initialState}); }); scc_jQuery('footer').each(function () { var initialState = jQuery(this).data('scc-footerState'); scc_jQuery(this).css({display: initialState}); }); }, 1000); scc_jQuery('#statusMsg').html(' Thank you, '+user+'. Your quote has been sent to '+email+''); } } scc_jQuery.ajax( $fragment_refresh ) }) .fail(function() { $fragment_refresh={ url: rt_vars.rt_urlajax, type: 'POST', data: { action: 'sccSendEmail', payload: Base64.encode(JSON.stringify(jsonPDF)), email_to: email, user_to: user, title: title, phone: phone, ipaddress: '', browserInfo: browserInfo, device: isMobile }, success: function(data) { // scc_jQuery('#scc_sending_email_progress_container').css('display', 'none') updateSendEmailProgress(100) ClosePopup_scc2(); document.body.removeChild(clone); setTimeout(() => { removeSendEmailProgress() scc_jQuery('body').css({ overflow: 'visible' }); // restore header and footer's initial display property value scc_jQuery('header').each(function () { var initialState = jQuery(this).data('scc-headerState'); scc_jQuery(this).css({display: initialState}); }); scc_jQuery('footer').each(function () { var initialState = jQuery(this).data('scc-footerState'); scc_jQuery(this).css({display: initialState}); }); }, 1000); scc_jQuery('#statusMsg').html(' Thank you, '+user+'. Your quote has been sent to '+email+''); } } scc_jQuery.ajax( $fragment_refresh ) }) } PrintDoc = function(enable){ if(enable === 0){ scc_jQuery('.scc-alert').remove(); scc_jQuery('body').find('.scc-detailed-list-head').each(function(index, ob){ scc_jQuery(ob).html(``); }) return; } scc_jQuery('.scc-buttons-visibility').each(function(index, ob){ scc_jQuery(ob).css('display', 'none') }) scc_jQuery('.Section-Title-Summary-Window').each(function(index, ob){ scc_jQuery(ob).css('margin-left','15px') }) scc_jQuery('.comments-printing-improvement').each(function(index, ob){ scc_jQuery(ob).css('padding-left', 10) }) //scc_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; scc_jQuery('.Section-Title-Summary-Window').each(function(index, ob){ scc_jQuery(ob).css('margin-left:5px') }) scc_jQuery('.scc-buttons-visibility').each(function(index, ob){ scc_jQuery(ob).css('display', 'block') }) scc_jQuery('.comments-printing-improvement').each(function(index, ob){ scc_jQuery(ob).css('padding-left', 0) }) //scc_jQuery('#scc-summary-view-header').css('background-color', '#F1F1F1') } function updateSendEmailProgress(value){ var elem = document.getElementById("myBar_scc"); elem.innerHTML = value + "%"; //scc_jQuery('#scc_sendemail_progress_value').html(value + '%') } function removeSendEmailProgress(){ scc_jQuery('#scc_send_email_progress_modal').modal('hide') scc_jQuery('#scc_sending_email_progress_container').html('') scc_jQuery('#scc_send_email_progress_modal').modal('hide') scc_jQuery('#scc_send_email_progress_modal').modal('hide') setTimeout(() => { scc_jQuery('#scc_send_email_progress_modal').remove() scc_jQuery('.modal-backdrop').each((index, element) => { scc_jQuery('#preview_modal').modal('hide') element.remove() scc_jQuery(element).remove() setTimeout(() => { scc_jQuery('#scc_send_email_progress_modal').modal('hide') scc_jQuery('#scc_send_email_progress_modal').modal('hide') }, 1000); }); }, 1000); } function createSendEmailModal(){ var code = '' code += '' scc_jQuery('#scc_sending_email_progress_container').html(code) scc_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)){ scc_jQuery('#scc_send_email_progress_modal').css('left', 80) scc_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?1:p;}, setIndeterminate:function(i){this.indeterminate=i;}, setText:function(t){this.text.innerHTML=t;} }