$(document).ready(function() { $( "#processingDiv" ).dialog( "destroy" ); $( "#processingDiv" ).dialog({ closeOnEscape: false, autoOpen: false, resizable: false, height:70, width:240, dialogClass: 'noTitleStuff', modal: true, open: function(event, ui) { jQuery('.ui-dialog-titlebar-close').hide(); } }); $( "#dialog:ui-dialog" ).dialog( "destroy" ); $( "#dialog-confirm" ).dialog({ autoOpen: false, resizable: false, height:240, modal: true, position: { my: "center top", at: "center bottom", of: "#siteHeader_div" }, buttons: [{ text:"OK", click: function() { $("#NO_PRODUCTS_OK").val('true'); $( this ).dialog( "close" ); } }, { text: "Cancel", click: function() { $('#tabs').tabs('select', '#step2') $("#NO_PRODUCTS_OK").val('false'); $( this ).dialog( "close" );} }] }); $( "#dialog-result" ).dialog({ closeOnEscape: false, autoOpen: false, resizable: false, height:540, width:540, modal: true, open: function(event, ui) { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [{ text:"OK", click: function() { $("#NO_PRODUCTS_OK").val('true'); $( this ).dialog( "close" ); } }, { text: "Cancel", click: function() { $('#tabs').tabs('select', '#step2') $("#NO_PRODUCTS_OK").val('false'); $( this ).dialog( "close" );} }] }); }); function redirectToStatement() { var statmentUrl = "https://reservation.eventzen.com/CommTechEast2020/scanners/scannerRentalStatement3.php?EXHIBITOR_ID="+$("#RESULT_COMPANY_ID").html()+'&lang='+$('#exhLang').val(); window.location.href=statmentUrl; // adminRedirectToStatement(); } function adminRedirectToStatement() { //statementUrl = '../scanners/scannerRentalStatement3.php?EXHIBITOR_ID='+ $('#admin_exh_hd_id').val(); // alert("admin redir"); // statementUrl = '../scanners/scannerRentalStatement3.php?EXHIBITOR_ID='+ $('#admin_exh_hd_id').val()+'&lang='+$('#exhLang').val(); window.open("https://reservation.eventzen.com/CommTechEast2020/scanners/scannerRentalStatement3.php?EXHIBITOR_ID="+$("#RESULT_COMPANY_ID").html()+'&lang='+$('#exhLang').val(), 'Statement', 'scrollbars=yes,menubar=yes,resizable=yes'); //window.location.href="https://reservation.eventzen.com/CommTechEast2020/scanners/scannerRentalStatement3.php?EXHIBITOR_ID="+$("#RESULT_COMPANY_ID").html()."&LANG=".$('#exhLang').val(ci.find("LANG").text()); } function showFormErrorDialog() { var formErrorsBtns = []; formErrorsBtns= [ { text: "Continue", click: function() { $(this).dialog("close"); ; } } ]; /* var formErrorsBtns= [ { text: "Continue", click: function() { $(this).dialog("close"); $('#scannerForm').submit(); } ]; */ //$( "#dialog-confirm" ).dialog('open'); $( "#dialog-confirm" ).dialog('option','title','Incomplete form!'); $( "#dialog-confirm" ).dialog( "option", "buttons", formErrorsBtns ); $( "#dialog-confirm" ).html('Error: please solve for message in yellow.'); $( "#dialog-confirm" ).dialog('open'); } function submitDialog() { //alert(htmlMsg); var ok =false; var submitConfirmBtns = []; submitConfirmBtns= [ { text: "Ok", click: function() { $(this).dialog("close"); submitConfirmed = true; $('#scannerForm').submit(); } }, { text: "Cancel", click: function() { $(this).dialog("close"); } } ]; $( "#dialog-confirm" ).dialog('option','title','Confirm Submit'); $( "#dialog-confirm" ).dialog( "option", "buttons",submitConfirmBtns ); $( "#dialog-confirm" ).html('Submit your selection?'); $( "#dialog-confirm" ).dialog('open'); } function validateStep(tabID) { var tabValid =true; var required; var value; $('[name="SC_PKG"]').valid(); for (var i in validator.settings.rules) { var mySelector; if (!($("#"+i).attr("type") === undefined ) ) { mySelector = "#"+i; } else { mySelector = '[name="' + i +'"]'; } required = validator.settings.rules[i].required; value = $(mySelector).val(); if ($(mySelector).parents("#step"+tabID).length == 1) { if ( ($(mySelector).valid() == false) && ( (required) || ( (!required) && (value !="") ) ) ) { tabValid = false; //break; } } } return tabValid; } function validateStep2() { var valid = true; if ( $('[name="LQ_PRODUCTS_ARRAY[]"]').length < 1) { //dialog here var dialogBtns = $( "#dialog-confirm" ).dialog( "option", "buttons" ); dialogBtns[0].text='OK'; var noProductsBtns= [ { text: "Skip qualifiers", click: function() { $(this).dialog("close"); } }, { text: "Enter qualifiers", click: function() { $('#tabs').tabs('select', 1); $(this).dialog("close"); } } ]; $( "#dialog-confirm" ).dialog( "option", "buttons",noProductsBtns ); $( "#dialog-confirm" ).html("No lead qualifiers were entered. Do you wish to skip this, or enter some qualifiers?"); $( "#dialog-confirm" ).dialog('option','title','Lead Qualifiers not completed '); $( "#dialog-confirm" ).dialog('open'); //alert("Enter Products or pay"); valid= NO_PRODUCTS; //alert(valid); } } function submitResultDialog(result) { var successResultBtns= [ { text: "Show me the invoice", click: function() { redirectToStatement(); // $(this).dialog("close"); } } ]; var failResultBtns= [ { text: "Retry", click: function() { $('#CC_RETRY').val('TRUE'); $(this).dialog("close"); } } ]; var dialogTitle; $( "#RESULT_MESSAGE").css('background-color', 'white'); if (result['RESULT'] == 'SUCCESS') { $( "#error_result").hide(); $("#no_error_result").show(); $( "#dialog-result" ).dialog( "option", "buttons", successResultBtns ); $( "#RESULT_MESSAGE").html("Your order has been reserved. Thank you."); $("#Exh_hd_ID").val(result['COMPANY_ID']); $("#RESULT_COMPANY_ID").html(result['COMPANY_ID']); $("#RESULT_COMPANY_NAME").html($("#company").val()); $("#RESULT_PACKAGE_ID").html(result['PACKAGE_ID']); $("#RESULT_EMAIL").html($("#email").val()); $("#RESULT_SUB_TOTAL").html(result['SUB_TOTAL']); $("#RESULT_TAX1").html(result['TAX1']); $("#RESULT_TAX2").html(result['TAX2']); $("#RESULT_TOTAL").html(result['TOTAL']); $("#RESULT_AMOUNT_PAYED").html(result['AMOUNT_PAYED']); $("#RESULT_AMOUNT_DUE").html(result['AMOUNT_DUE']); $("#RESULT_ADD_SERV").html(result['ADD_SERV']); $("#RESULT_PAYMENT_METHOD").html(result['PAYMENT_METHOD']); $("#RESULT_TRANSACTION_DATE").html(result['TRANSACTION_DATE']); $("#RESULT_STATEMENT_ID").html(result['STATEMENT_ID']); //debugger; $("#RESULT_CC_AUTH_CODE").html(result['CC_TRANSACTION_DATA']['CC_AUTH_CODE']); dialogTitle ='Order Completed'; } else if (result['RESULT'] == 'ERROR') { $( "#error_result").show(); $("#no_error_result").hide(); $( "#error_title").html("System error"); $( "#error_message").html("An unexpected condition has occurred, please contact support 1-888-777-8613 ext. 11"); $( "#dialog-result" ).dialog( "option", "buttons", failResultBtns ); dialogTitle = "Submit Error"; } else if (result['RESULT'] == 'SERVER_ERROR') { $( "#error_result").show(); $("#no_error_result").hide(); $( "#error_title").html("Server Error"); $( "#error_message").html(result['ERROR_MESSAGE']); $( "#dialog-result" ).dialog( "option", "buttons", failResultBtns ); dialogTitle = "An error submitting has occurred please contact support 1-888-777-8613 ext. 11"; } else { // alert(result['RESULT'] ); $("#RESULT_COMPANY_ID").html(result['COMPANY_ID']); $("#RESULT_COMPANY_NAME").html($("#company").val()); $("#RESULT_PACKAGE_ID").html(result['PACKAGE_ID']); $("#RESULT_EMAIL").html($("#email").val()); $("#RESULT_SUB_TOTAL").html(result['SUB_TOTAL']); $("#RESULT_TAX1").html(result['TAX1']); $("#RESULT_TAX2").html(result['TAX2']); $("#RESULT_TOTAL").html(result['TOTAL']); $("#RESULT_AMOUNT_PAYED").html(result['AMOUNT_PAYED']); $("#RESULT_AMOUNT_DUE").html(result['AMOUNT_DUE']); $("#RESULT_ADD_SERV").html(result['ADD_SERV']); $("#RESULT_PAYMENT_METHOD").html(result['PAYMENT_METHOD']); $("#RESULT_TRANSACTION_DATE").html(result['TRANSACTION_DATE']); $("#RESULT_STATEMENT_ID").html(result['STATEMENT_ID']); //debugger; $("#RESULT_CC_AUTH_CODE").html(result['CC_TRANSACTION_DATA']['CC_AUTH_CODE']); $("#error_result").hide(); $("#no_error_result").show(); $( "#dialog-result" ).dialog( "option", "buttons", failResultBtns ); $( "#RESULT_MESSAGE").css('background-color', 'red'); $( "#RESULT_MESSAGE").html(result['CC_TRANSACTION_DATA']['CC_STATUS']); dialogTitle ='Payment Transaction Refused' } //$("#RESULT_COMPANY_ID" ).html("IT WORKED"); //$( "#dialog-result" ).html('SUCCESS'); $( "#dialog-result").dialog('option','title',dialogTitle); $( "#dialog-result" ).dialog('open'); }