HEX
Server: Apache
System: Linux clpupre 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64
User: undanet (1000)
PHP: 7.4.3
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/undanet/www/wp-content/themes/panoramic-child/js/panoramic_child_scripts.js.bak
jQuery(document).ready(function($) {

    if( typeof panoramic_child_scripts_object != 'undefined' ) {
        $('.lang-item').each(function(){
            $(this).find('a').attr( 'href',  $(this).find('a').attr( 'href') + panoramic_child_scripts_object.getid )
        });
    }
      
})    

function sendemailPDF(elementid, namefile){
    
    var error = false;
    var errormessage = '';
    
    var mailto = jQuery('.send-message .email-send-message').val();
    var subject = jQuery('.send-message .subjet-send-message').val();
    var message = jQuery('.send-message .message-send-message').val();
    
    
    var element = document.getElementById(elementid);		
    html2pdf().from(element).set({
    filename: namefile,
        image: {
            type: 'jpeg',
            quality: 0.98
        },
        jsPDF: {orientation: 'portrait', unit: 'in', format: 'letter', compressPDF: true}
    }).save();	
    
    html2pdf().from(element).toPdf().output('datauristring').then(function (pdfAsString) {
        // The PDF has been converted to a Data URI string and passed to this function.
        // Use pdfAsString however you like (send as email, etc)! For instance:
        //console.log(pdfAsString);
    

        
        jQuery.ajax({
            type: "POST",
            url: "/wp-admin/admin-ajax.php",
            data: { action: 'send_email_with_pdf', fileDataURI: pdfAsString, namefile: namefile, mailto: mailto, subject: subject, message: message },
            success: function(response) {
                console.log(response.content);
            },
            fail: function(err) {
                console.log("There was an error: " + err);
            }
        });
        
    });

}

function downloadPDF(elementid, namefile){

    var element = document.getElementById(elementid);		
    html2pdf().from(element).set({
    filename: namefile,
        image: {
            type: 'jpeg',
            quality: 0.98
        },
        jsPDF: {orientation: 'portrait', unit: 'in', format: 'letter', compressPDF: true}
    }).save();	

}