Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: fileorder.js
$.fetchServiceData = function(srvcId, packPrice) { // has to be defined as a function, does not need to be inside a nested document ready function $('#dvLoader').ajaxStart(function() { $(this).show(); }).ajaxStop(function() { $(this).hide(); }); document.getElementById('packageId').value = srvcId; $.post(base_url+"page/ajxfileorder", { packId:srvcId, purpose:'getData' }, function(response){ if(response) { arrResponse = response.split('~'); if(Trim(arrResponse[3]) != '') { window.open(arrResponse[3], '_blank'); } document.getElementById('cldFrm').value = '0'; if(document.getElementById('service_Details2')) { $('#service_Details2').hide(); $('#serviceDetails2').show(); } $('#tblInfo').show(); if(arrResponse[0] != '') { $("#dvSN").html(arrResponse[0]); } if(arrResponse[1] != '') { $("#dvTT").html(arrResponse[1]); } if(arrResponse[2] != '') { $("#dvMR").html("<b>SERVICE DETAILS:</b><br />"+arrResponse[2]); } if(Trim(arrResponse[4]) != '') { $('#dvFeatures').html(Trim(arrResponse[4])); $('#dvFeatures').show(); } else { $('#dvFeatures').html(''); $('#dvFeatures').hide(); } if(arrResponse[5] != '') { $("#lblCustPrice").html($('#currSymbol').val()+arrResponse[5]); $("#lblCustPrice").show(); } if($('#orderForm').length) { if(window.innerWidth <= 960) { $('html, body').animate({ scrollTop: $('#orderForm').offset().top + 'px', }); } } } }); }; $(document).ready(function() { $(document).on('click', '#frmImeiBtn', function(event) { event.preventDefault(); if(validate() != false ) { $.confirm({ title: 'Confirm!', content: 'You agree with our terms & conditions?', buttons: { confirm: function () { $('#frmfile').submit(); }, cancel: function () { $.alert('Please contact with admin!'); setTimeout(function () { location.reload(); }, 2000); } } }); } }); if(orderForms==2) { //for new layout $(document).on('click', '.my_pack', function () { var ide = this.title; var val = $('#packageId').attr('details2', ide); /*var pricee= $(".my_pack").data('title'); console.log(pricee);*/ $('#packageId').val(ide); if (val != 0) { fetchData(); } }); } else { //for old layout $(document).on('change', '.my_pack', function() { $("#dvError").html("").hide(); var ide = this.value; var val = $('#packageId').val(ide); if(val != 0){ fetchData(); } }); } $("#categoryId").change(function() { setValue('0'); document.getElementById('frm').submit(); }); $("#frm").submit(function(){ return validate(); }); $("#rdFileType1").click(function(){ if(document.getElementById('rdFileType1').checked) { $("#dvSingleFile").show(); $("#dvZipFile").hide(); $("#dvBulkFiles").hide(); } }); $("#rdFileType2").click(function(){ if(document.getElementById('rdFileType2').checked) { $("#dvZipFile").show(); $("#dvSingleFile").hide(); $("#dvBulkFiles").hide(); } }); $("#rdFileType3").click(function(){ if(document.getElementById('rdFileType3').checked) { $("#dvBulkFiles").show(); $("#dvZipFile").hide(); $("#dvSingleFile").hide(); } }); }); function fetchData() { if($('#packageId').val() > 0) { /*console.log('here');*/ setValue('0'); $('#dvLoader').ajaxStart(function() { $(this).show(); }).ajaxStop(function() { $(this).hide(); }); $.post(base_url+"page/ajxfileorder", { packId:$("#packageId").val(), purpose:'getData' }, function(response){ if(response) { arrResponse = response.split('~'); if(Trim(arrResponse[3]) != '') { window.open(arrResponse[3], '_blank'); } document.getElementById('cldFrm').value = '0'; if(document.getElementById('service_Details2')) { $('#service_Details2').hide(); $('#serviceDetails2').show(); } $('#tblInfo').show(); $('#second_section').show(); $('#empty_section').hide(); if(arrResponse[0] != '') { $("#dvSN").html(arrResponse[0]); } if(arrResponse[1] != '') { $("#dvTT").html(arrResponse[1]); } if(arrResponse[2] != '') { $("#dvMR").html("<b>SERVICE DETAILS:</b><br />"+arrResponse[2]); } if(Trim(arrResponse[4]) != '') { $('#dvFeatures').html(Trim(arrResponse[4])); $('#dvFeatures').show(); } else { $('#dvFeatures').html(''); $('#dvFeatures').hide(); } if($("#packageId").val() != '0') { /*var vPr = $('.my_pack').attr('data-id');*/ if(arrResponse[5] != '') { //$("#lblCustPrice").html($('#currSymbol').val()+vPr+$('#currAbb').val()); $("#lblCustPrice").html($('#currSymbol').val()+arrResponse[5]); $("#lblCustPrice").show(); } } if(Trim(arrResponse[6]) == '1')// Terms of Conditions { $('#dvTOC input').attr('required', true); $('#dvTOC').show(); } else { document.getElementById('chkTOC').checked = false; $('#dvTOC').hide(); } if($('#orderForm').length) { if(window.innerWidth <= 960) { $('html, body').animate({ scrollTop: $('#orderForm').offset().top + 'px', }); } } } }); } } function validate() { var errors = ''; if ($("#ddType").val()=='1' && $("#categoryId").val()=='0') errors += "- Please select Category.<br />"; if ($("#packageId").val()=='0') errors += "- "+CUST_CODE_1+".<br />"; /*if ($("#txtFile").val()=='') errors += "- "+CUST_LBL_1+".<br />";*/ if ($("#txtFile").val()=='' && $("#txtZipFile").val()==''){ errors += "- "+CUST_LBL_10+".<br />"; errors += "- "+CUST_LBL_1+".<br />"; } /*if ($("#txtZipFile").val()=='') errors += "- "+CUST_LBL_10+".<br />";*/ /*if(document.getElementById("rdFileType1").checked) { if ($("#txtFile").val()=='') errors += "- "+CUST_LBL_1+".<br />"; } else if(document.getElementById("rdFileType2").checked) { if ($("#txtZipFile").val()=='') errors += "- "+CUST_LBL_10+".<br />"; } else if(document.getElementById("rdFileType3").checked) { if ($("#txtBulkFiles").val()=='') errors += "- "+CUST_LBL_11+".<br />"; }*/ if (errors=='') { $("#submitButton").attr("disabled", true); $("#submitButton").text('Please Wait...'); return true; } else { $("#dvError").html(errors); $("#dvError").show(); return false; } } function setValue(i) { if($("#packageId").val() != '0') { document.getElementById('cldFrm').value = i; } }