// JavaScript Document // ************** Make the URL ********************** function getRedirectUrlJs(cont,page,param) { //getRedirectUrlJs('MAIN_CONSOLE_ROOT','index','id@2@@name@chanchal'); if (param === undefined) { param = ''; } var result = ""; var dataArr = '&cont='+cont+'&page='+page+'¶m='+param; $.ajax({ type : "GET", global: false, url : main_console_root+"ajax/pageQuerySave.php?mod=GetUrlPath"+dataArr, async : false, success:function(msg) { result = msg; } }); return result; } // ************** Display Alret Msg *************** function getDisplayAlertMsg(displayMsg) { console.log(displayMsg); var dataArr = displayMsg.split('@@@@'); var msg_color = dataArr[0]; var msg_content = dataArr[1]; var msg_image = main_root+'image/success.png'; if(msg_color != 'success') { msg_image = main_root+'image/failed.png'; } $.gritter.add({ //title : msg_color, text : msg_content, image : msg_image, time: '1000', sticky: false, }); } // Display the Browse Images function displayBrowseImage(fieldName,divBrowseId) { if(divBrowseId === undefined) { divBrowseId = 'browseImages'; } var input = document.getElementById(fieldName); var dvPreview = $("#"+divBrowseId); dvPreview.html(""); // Constant Define In constantJavascriptDefine File var regex = new RegExp(IMAGE_REGEX); for (var i=0; i"); img.attr("style", "height:100px;width: 100px;padding: 5px;"); img.attr("src", e.target.result); dvPreview.append(img); } reader.readAsDataURL(input.files[i]); } else { var alertMSG = "warning@@@@"+name + " is not a valid image file."; getDisplayAlertMsg(alertMSG); dvPreview.html(""); } } } // Display the Browse Images function displayBrowseXlsImage(fieldName,divBrowseId) { if(divBrowseId === undefined) { divBrowseId = 'browseImages'; } var input = document.getElementById(fieldName); var dvPreview = $("#"+divBrowseId); dvPreview.html(""); // Constant Define In constantJavascriptDefine File var regex = new RegExp(IMAGE_REGEX); for (var i=0; i"); img.attr("style", "height:100px;width: 100px;padding: 5px;"); img.attr("src", e.target.result); dvPreview.append(img); } reader.readAsDataURL(input.files[i]); } else { var alertMSG = "warning@@@@"+name + " is not a valid image file."; getDisplayAlertMsg(alertMSG); dvPreview.html(""); } } } function permissionDeniedMsg() { var alertMSG = "warning@@@@Permission Denied"; getDisplayAlertMsg(alertMSG); } // ************** Remove Page Query *************** function removePageQuery(pageName) { if(pageName !='') { $.ajax({ type : "GET", url : main_console_root+"ajax/pageQuerySave.php?mod=RemoveQuery&page="+pageName, async : false, success:function(msg) { } }); } } // Displaye Large Image function viewLargeImage(title,imagePath) { var message = ''; message += ""; message += '
'; message += ''; message += '
'; eModal.alert(message, title); } function printOutContent(output) { var popupWin = window.open('','_blank','width=400,height=600'); popupWin.document.open(); popupWin.document.write('' + output + ''); popupWin.document.close(); } // ********************** Export File ********************** // Get the Product List For Discount tag function getDownloadReport(report_name) { if(report_name === undefined) { report_name = ''; } if(report_name !='') { var redirectPath = main_console_root+"module/transaction/download_file.php?report_name="+report_name window.setTimeout(function(){ window.location = redirectPath;}); } } // Enable/ Active the Records // 1 For Enable/ Active Records function enableRecords(mod_action) { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { listArr[i] = $(this).val(); i++; }); if(listArr.length >0 ) { $.ajax({ type : "GET", url : main_console_root+"ajax/disable_records.php?status=1&mod="+mod_action+'&listArr='+listArr, async : false, success:function(result) { if(result > 0) { var alertMSG = "success@@@@Record Enable Successfully"; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+result; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } // Disable/ Deactive the Records // 0 For Disable/ Deactive Records function disableRecords(mod_action) { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { listArr[i] = $(this).val(); i++; }); if(listArr.length >0 ) { var confirmMSG = 'Are you confirm to Disable'; if(mod_action == 'ProductMaster') { confirmMSG = 'Are you confirm to disable, Business Product Also disable'; } return eModal.confirm(confirmMSG, ' '+PROJECT_SITE_NAME+' Message') .then(function () { $.ajax({ type : "GET", url : main_console_root+"ajax/disable_records.php?status=0&mod="+mod_action+'&listArr='+listArr, async : false, success:function(result) { if(result > 0) { var alertMSG = "success@@@@Record Disable Successfully"; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+result; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); }); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } function getDisableReasonBoxModal(mod_action) { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { var id = $(this).val(); listArr[i] = id; i++; }); if(listArr.length >0 ) { var options = { url: main_console_root+"modal/approval_deny_modal.php?modeType=denyReasonBox&mod_action="+mod_action+'&disableIdList='+listArr, title :'Disable Reason', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true, click: validateDisableReasonBox } ], }; return eModal.ajax(options); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } function validateDisableReasonBox() { var counter = 1; var mod_action = $("#denyReasonBoxForm #mod_action").val(); var denyIdList = $("#denyReasonBoxForm #denyIdList").val(); var denyComment = $("#denyReasonBoxForm #denyComment").val(); if(denyComment == "") { $("#denyReasonBoxForm #denyComment_EBox").html('Please Enter Comment'); counter = 0; } else if(parseInt(denyComment.length) < 20) { $("#denyReasonBoxForm #denyComment_EBox").html('Please Enter Comment Greater Than 20 Characters'); counter = 0; } if(counter == 0) { return false; } else { var dataArr = '&mod='+mod_action+'&denyComment='+denyComment+'&listArr='+disableIdList $.ajax({ type : "GET", url : main_console_root+"ajax/disable_records.php?status=0"+dataArr, async : false, success:function(result) { if(result > 0) { var alertMSG = "success@@@@Record Disable Successfully"; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+result; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } // Delete the Records function deleteRecords(mod_action) { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { listArr[i] = $(this).val(); i++; }); if(listArr.length >0 ) { var confirmMSG = 'Are you confirm to delete'; if(mod_action == 'ProductMaster' || mod_action == 'ProductApproval') { confirmMSG = 'Are you confirm to delete, Business Product Also delete'; } return eModal.confirm(confirmMSG, ' '+PROJECT_SITE_NAME+' Message') .then(function () { $.ajax({ type : "GET", url : main_console_root+"ajax/delete_records.php?mod="+mod_action+'&listArr='+listArr, async : false, success:function(result) { if(result > 0) { var alertMSG = "success@@@@Record Delete Successfully"; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+result; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); }); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } // Approved Records // 1 For Approved function approvedRecords(mod_action) { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { listArr[i] = $(this).val(); i++; }); if(listArr.length >0 ) { console.log(main_console_root+"ajax/approval_records.php?status=1&mod="+mod_action+'&listArr='+listArr); $.ajax({ type : "GET", url : main_console_root+"ajax/approval_records.php?status=1&mod="+mod_action+'&listArr='+listArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } // DisApproved / Deactive the Records With Confirm Msg function disapprovedRecords(mod_action) { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { listArr[i] = $(this).val(); i++; }); if(listArr.length >0 ) { var confirmMSG = 'Are you confirm to Deny'; if(mod_action == 'ProductApproval') { confirmMSG = 'Are you confirm to Deny, Business Product Also Disable'; } return eModal.confirm(confirmMSG, ' '+PROJECT_SITE_NAME+' Message') .then(function () { //alert(main_console_root+"ajax/approval_records.php?status=2&mod="+mod_action+'&listArr='+listArr); $.ajax({ type : "GET", url : main_console_root+"ajax/approval_records.php?status=2&mod="+mod_action+'&listArr='+listArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { output = 1; var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); }); } } // Records Archive With Reason Comment function denyRecordsReasonBox(mod_action) { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { var id = $(this).val(); listArr[i] = id; i++; }); if(listArr.length >0 ) { var options = { url: main_console_root+"modal/approval_deny_modal.php?modeType=denyReasonBox&mod_action="+mod_action+'&denyIdList='+listArr, title :'Deny Reason', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true, click: validateDenyReasonBox } ], }; return eModal.ajax(options); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } // Validate Deny With Reason Comment function validateDenyReasonBox() { var counter = 1; var mod_action = $("#denyReasonBoxForm #mod_action").val(); var denyIdList = $("#denyReasonBoxForm #denyIdList").val(); var denyComment = $("#denyReasonBoxForm #denyComment").val(); if(denyComment == "") { $("#denyReasonBoxForm #denyComment_EBox").html('Please Enter Comment'); counter = 0; } else if(parseInt(denyComment.length) < 20) { $("#denyReasonBoxForm #denyComment_EBox").html('Please Enter Comment Greater Than 20 Characters'); counter = 0; } if(counter == 0) { return false; } else { var output = 0; var dataArr = '&mod='+mod_action+'&denyComment='+denyComment+'&listArr='+denyIdList $.ajax({ type : "GET", url : main_console_root+"ajax/approval_records.php?status=2"+dataArr, global: false, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { output = 1; var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } // Records Archive With Reason List Modal function archiveDenyReasonlistModal(mod_action) { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { var id = $(this).val(); listArr[i] = id; i++; }); if(listArr.length >0 ) { var options = { url: main_console_root+"modal/approval_deny_modal.php?modeType=DenyReasonList&mod_action="+mod_action+'&denyIdList='+listArr, title :'Archive Reason', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true, click: validateDenyReasonlistModal } ], }; return eModal.ajax(options); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } // validate Archive With Reason List Modal function validateDenyReasonlistModal() { var counter = 1; var formName = '#denyReasonListForm'; var mod_action = $(formName +" #mod_action").val(); var denyIdList = $(formName +" #denyIdList").val(); var denyReason = $(formName +" #denyReason").val(); var denyComment = $(formName +" #denyComment").val(); if(denyReason == "") { $(formName +" #denyReason_EBox").html('Please Select Deny Reason'); counter = 0; } if(denyComment == "") { $(formName +" #denyComment_EBox").html('Please Enter Comment'); counter = 0; } else if(parseInt(denyComment.length) < 20) { $(formName +" #denyComment_EBox").html('Please Enter Comment Greater Than 20 Characters'); counter = 0; } if(counter == 0) { return false; } else { var dataArr = '&mod='+mod_action+'&denyReason='+denyReason+'&denyComment='+denyComment+'&listArr='+denyIdList $.ajax({ type : "GET", url : main_console_root+"ajax/approval_records.php?status=2"+dataArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } //Get the Active State List of Country function getActiveStateList(country_id) { $.ajax({ type: "GET", url : main_console_root+"ajax/getDropDownOption.php?id="+country_id+'&mod=stateList', async : false, success : function(response){ $('#statediv').html(response); } }); var state_id = ''; getActiveCityList(state_id); } //Get the Active City List of State function getActiveCityList(state_id) { $.ajax({ type: "GET", url : main_console_root+"ajax/getDropDownOption.php?id="+state_id+'&mod=cityList', async : false, success : function(response){ $('#citydiv').html(response); } }); var city_id = ''; getActiveAreaList(city_id); } //Get the Active Area List of City function getActiveAreaList(city_id) { $.ajax({ type: "GET", url : main_console_root+"ajax/getDropDownOption.php?id="+city_id+'&mod=areaList', async : false, success : function(response) { $('#areadiv').html(response); } }); } //Get the Active Area List of City function getSubCategoryList(parent_id) { $.ajax({ type: "GET", url : main_console_root+"ajax/getDropDownOption.php?id="+parent_id+'&mod=SubCategory', async : false, success : function(response){ $('#subCatediv').html(response); } }); } // Check Mobile Format function checkMobileFormat(mobile) { var msg = true; var mobileRegex = /^[0-9]+$/; if(!mobileRegex.test(mobile)) { msg = "Please enter a valid Mobile Number"; } else if(isNaN(mobile)) { msg = "Please enter only digits. ";} else if(CONST_MOBILE_LENGTH !=0 && mobile.length != CONST_MOBILE_LENGTH){ msg = "Mobile must have 10 digits "; } return msg; } // Check Email Format function checkEmailFormat(email) { var msg = true; var emailRegex = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/; if(!emailRegex.test(email)) { msg = "Please enter a valid Email-ID"; } return msg; } function checkPasswordFormat(password) { var msg = true; var digitRegex = /^(?=.*\d)/; var lowercaseRegex = /^(?=.*[a-z])/; var specialcaseRegex = /^(?=.*[!@#$%^&*])/; if(password == '') { msg = "Please enter a valid Mobile Number"; } else if(password.length < '7' ) { msg = 'Password length must be 7 characters'; } else if(!digitRegex.test(password)) { msg = 'Password must contain at least one digit';} else if(!lowercaseRegex.test(password)) { msg = 'Password must contain at least one lowercase letter';} else if(!specialcaseRegex.test(password)) { msg = 'Password must contain at least one Special character';} return msg; } //*************************** Add IP Address ( White and Blocked)*************************** function addIpAddressModal(mod_action) { var mod_action = mod_action.toLowerCase(); if(mod_action != 'white') { var title_msg = 'Blocked IP Address'; } else { var title_msg = 'Allowed IP Address'; } var options = { url: main_console_root+"modal/ip_address_modal.php?modeType=ipAddressModal&mod_action="+mod_action, title : title_msg, size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true, click: validateAddIPAddress } ], }; return eModal.ajax(options); } function validateAddIPAddress() { var counter = 1; var ipAddressRegex = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/; var ip_address = $("#ipAddressModalForm #ip_address").val(); var mod_action = $("#ipAddressModalForm #mod_action").val(); mod_action = mod_action.toLowerCase(); if(ip_address == '') { $("#ipAddressModalForm #ip_address_EBox").html('Please Enter IP Address'); counter = 0; } else if(!ipAddressRegex.test(ip_address)) { $("#ipAddressModalForm #ip_address_EBox").html("Please Enter Valid IP Address"); counter = 0; } if(counter == 0) { return false; } else { // Function Call to Add the Ip Address API var result = addIpAddrss(mod_action,ip_address); var resultArr = result.split('@@@@'); var modalFlag = resultArr[0]; var msg_content = resultArr[1]; if(parseInt(modalFlag) == 0) { $("#ipAddressModalForm #ip_address_EBox").html(msg_content); return false; } else { addIpAddressOTPModal(mod_action,ip_address); } } } function addIpAddrss(mod_action,ip_address) { var result = ''; $.ajax({ type : "GET", global: false, url : main_console_root+"modal/ip_address_modal.php?modeType=addIpAddress&mod_action="+mod_action+'&ip_address='+ip_address, async : false, success:function(response) { result = response; } }); return result; } function addIpAddressOTPModal(mod_action,ip_address) { var mod_action = mod_action.toLowerCase(); if(mod_action != 'white') { var title_msg = 'Blocked IP Address'; } else { var title_msg = 'Allowed IP Address'; } var dataArr = '&mod_action='+mod_action+'&ip_address='+ip_address var options = { url: main_console_root+"modal/ip_address_modal.php?modeType=addIpOtpModal"+dataArr, title : title_msg, size: eModal.size.lgs, buttons: [ {text: 'Resend', style: 'warning ', close: true, click: resendAddIpOTP }, {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true, click: validateAddIPAddressOtp } ], }; return eModal.ajax(options); } function resendAddIpOTP() { var ip_address = $("#ipOtpModalForm #ip_address").val(); var mod_action = $("#ipOtpModalForm #mod_action").val(); var result = addIpAddrss(mod_action,ip_address); var resultArr = result.split('@@@@'); var modalFlag = resultArr[0]; var msg_content = resultArr[1]; if(parseInt(modalFlag) != 1) { $("#ipOtpModalForm #ip_otp_EBox").html(msg_content); return false; } else { addIpAddressOTPModal(mod_action,ip_address); } } function validateAddIPAddressOtp() { var counter = 1; var ip_address = $("#ipOtpModalForm #ip_address").val(); var mod_action = $("#ipOtpModalForm #mod_action").val(); var ip_otp = $("#ipOtpModalForm #ip_otp").val(); if(ip_otp == '') { $("#ipOtpModalForm #ip_otp_EBox").html('Please Enter IP Address OTP'); counter = 0; } if(counter == 0) { return false; } else { // Function Call to Add the Ip Address API var result = addIpOTPVerify(mod_action,ip_address,ip_otp); var resultArr = result.split('@@@@'); var modalFlag = resultArr[0]; var msg_content = resultArr[1]; if(parseInt(modalFlag) == 0) { $("#ipOtpModalForm #ip_otp_EBox").html(msg_content); return false; } else { var alertMSG = "success@@@@"+msg_content; getDisplayAlertMsg(alertMSG); window.setTimeout(function(){ location.reload(); }, 1000); } } } function addIpOTPVerify(mod_action,ip_address,otp) { var result = ''; $.ajax({ type : "GET", global: false, url : main_console_root+"modal/ip_address_modal.php?modeType=addIpOtpVerify&mod_action="+mod_action+'&ip_address='+ip_address+'&otp='+otp, async : false, success:function(response) { result = response; } }); return result; } //*************************** Delete IP Address ( White and Blocked)*************************** function delIpAddressModal(mod_action,ip_address) { // Function Call to Add the Ip Address API var result = delIpAddrss(mod_action,ip_address); var resultArr = result.split('@@@@'); var modalFlag = resultArr[0]; var msg_content = resultArr[1]; if(parseInt(modalFlag) == 0) { var alertMSG = "warning@@@@"+msg_content; getDisplayAlertMsg(alertMSG); } else { delIpAddressOTPModal(mod_action,ip_address); } } function delIpAddrss(mod_action,ip_address) { var result = ''; $.ajax({ type : "GET", global: false, url : main_console_root+"modal/ip_address_modal.php?modeType=delIpAddress&mod_action="+mod_action+'&ip_address='+ip_address, async : false, success:function(response) { result = response; } }); return result; } function delIpAddressOTPModal(mod_action,ip_address) { var mod_action = mod_action.toLowerCase(); if(mod_action != 'white') { var title_msg = 'Delete Blocked IP Address'; } else { var title_msg = 'Delete Allowed IP Address'; } var dataArr = '&mod_action='+mod_action+'&ip_address='+ip_address var options = { url: main_console_root+"modal/ip_address_modal.php?modeType=delIpOtpModal"+dataArr, title : title_msg, size: eModal.size.lgs, buttons: [ {text: 'Resend', style: 'warning ', close: true, click: resendDelIpOTP }, {text: 'Close', style: 'default ', close: true }, {text: 'Delete', style: 'primary ', close: true, click: validateDelIPAddressOtp } ], }; return eModal.ajax(options); } function resendDelIpOTP() { var ip_address = $("#ipOtpModalForm #ip_address").val(); var mod_action = $("#ipOtpModalForm #mod_action").val(); var result = delIpAddrss(mod_action,ip_address); var resultArr = result.split('@@@@'); var modalFlag = resultArr[0]; var msg_content = resultArr[1]; if(parseInt(modalFlag) != 1) { $("#ipOtpModalForm #ip_otp_EBox").html(msg_content); return false; } else { delIpAddressOTPModal(mod_action,ip_address); } } function validateDelIPAddressOtp() { var counter = 1; var ip_address = $("#ipOtpModalForm #ip_address").val(); var mod_action = $("#ipOtpModalForm #mod_action").val(); var ip_otp = $("#ipOtpModalForm #ip_otp").val(); if(ip_otp == '') { $("#ipOtpModalForm #ip_otp_EBox").html('Please Enter IP Address OTP'); counter = 0; } if(counter == 0) { return false; } else { // Function Call to Add the Ip Address API var result = delIpOTPVerify(mod_action,ip_address,ip_otp); var resultArr = result.split('@@@@'); var modalFlag = resultArr[0]; var msg_content = resultArr[1]; if(parseInt(modalFlag) == 0) { $("#ipOtpModalForm #ip_otp_EBox").html(msg_content); return false; } else { var alertMSG = "success@@@@"+msg_content; getDisplayAlertMsg(alertMSG); window.setTimeout(function(){ location.reload(); }, 1000); } } } function delIpOTPVerify(mod_action,ip_address,otp) { var result = ''; $.ajax({ type : "GET", global: false, url : main_console_root+"modal/ip_address_modal.php?modeType=delIpOTPVerify&mod_action="+mod_action+'&ip_address='+ip_address+'&otp='+otp, async : false, success:function(response) { result = response; } }); return result; } //*************************** Admin User *************************** // User Details Modal function viewAdminUserDetail(user_id) { var options = { url: main_console_root+"modal/admin_detail_modal.php?modeType=UserDetails&user_id="+user_id, title :'User Information', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } // ********************** HSN Code List ********************* function viewHsnCodeDescription(hsn_id) { var options = { url: main_console_root+"modal/master_detail_modal.php?modeType=HsnCodeDescription&hsn_id="+hsn_id, title :'HSN Code Details', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function downloadHsnCodeFile() { $.ajax({ type: "GET", url : main_console_root+"ajax/master_list_detail.php?mod=downloadHsnCodeList", async : false, success : function(result) { var dataArr = result.split('@@@@'); var filePath = dataArr[0]; var filename = dataArr[1]; var element = document.createElement('a'); element.setAttribute('href', filePath); element.setAttribute('download',filename); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); } }); } function uploadHsnCodeFile() { var redirectPath = getRedirectUrlJs('MAIN_CONSOLE_ROOT','module/master/master_hsn_code_upload'); window.setTimeout(function(){ window.location = redirectPath;}); } // ********************** Marketing Campaign ********************* function viewCampaignDetail(campaign_id) { var options = { url: main_console_root+"modal/admin_detail_modal.php?modeType=viewCampaignDetail&campaign_id="+campaign_id, title :'Campaign Detail', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function downloadExcelListFile(fileType) { var options = { url: main_console_root+"ajax/import_export_detail.php?mod=downloadExcelColumnModel&fileType="+fileType, title :'Excel Column Lists', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Download', style: 'success ', close: true,click: validateDownloadExcelColumn } ], }; return eModal.ajax(options); } function validateDownloadExcelColumn() { var columnList = new Array(); var i=0; $.each($("input[name='excelColumn']:checked",'#excelColumnForm'), function() { columnList[i] = $(this).val(); i++; }); var fileType = $('#excelColumnForm #fileType').val(); if(columnList.length >0 ) { var dataArr = '&columnList='+columnList; console.log(main_console_root+"ajax/import_export_detail.php?mod="+fileType+dataArr); $.ajax({ type : "GET", url : main_console_root+"ajax/import_export_detail.php?mod="+fileType+dataArr, async : false, success:function(result) { var dataArr = result.split('@@@@'); var filePath = dataArr[0]; var filename = dataArr[1]; var element = document.createElement('a'); element.setAttribute('href', filePath); element.setAttribute('download',filename); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); } }); window.setTimeout(function(){ location.reload(); }, 1000); } else { $("#excelColumnForm #columnExcel_EBox").html('Please Select Atleast One Column'); } }// JavaScript Document // ********************** Business Type ********************** function viewBusinessDetails(business_id) { var options = { url: main_console_root+"modal/business_type_modal.php?modeType=BusinessTypeDetail&business_id="+business_id, title :'Business Type Details', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function businessTypeMetaTagModal(businessType) { var options = { url: main_console_root+"modal/business_type_modal.php?modeType=businessMetaTag&businessType="+businessType, title :'Business Type Meta Tag', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Update', style: 'success ', close: true,click: ValidateBusinessMetaTag } ], }; return eModal.ajax(options); } function ValidateBusinessMetaTag() { var counter = 1; var formName = '#businessMetaTagForm'; var businessType = $(formName+" #businessType").val(); var metaTag = $(formName+" #metaTag").val(); if(metaTag !='') { var metaTagArr = metaTag.split('#'); } else { var metaTagArr = '';} var dataArr = '&businessType='+businessType+'&metaTag='+metaTagArr //alert(main_console_root+"ajax/business_type_detail.php?mod=updateBusinessMetaTag"+dataArr); $.ajax({ type : "GET", url : main_console_root+"ajax/business_type_detail.php?mod=updateBusinessMetaTag"+dataArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { eModal.close(); var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { eModal.close(); var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); } // ********************** Category ********************** // Get the parent Category Child List function getSubCategoryIdList(parent_id) { var childList = ''; $.ajax({ type: "GET", url : main_console_root+"ajax/master_list_detail.php?mod=SubCategory&parent_id="+parent_id, async : false, success : function(response) { childList = response; } }); return childList; } // Get the Parent Id For child Id function getMainCategoryId(child_id) { var parent_id = ''; $.ajax({ type: "GET", url : main_console_root+"ajax/master_list_detail.php?mod=ParentCategory&child_id="+child_id, async : false, success : function(response) { parent_id = response; } }); return parent_id; } // ********************** Business Type category ********************* function viewBizTypeProductCategory(business_type) { var options = { url: main_console_root+"modal/business_type_modal.php?modeType=ProductCategoryTag&id="+business_type, title :'Product Catgory Tagging', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } // ********************** Preference Field ********************* function viewBizTypePreferenceField(business_type,name) { var options = { url : main_console_root+"modal/business_type_modal.php?modeType=PreferenceFieldTag&id="+business_type, title :name +' : Preference Field Tagged', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function bizPreferenceCopyModel(bizType) { var options = { url: main_console_root+"modal/business_type_modal.php?modeType=preferenceFieldCopyModel&bizType="+bizType, title :'Prefernce Field Tag', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Update', style: 'success ', close: true,click: ValidateBizPreferenceDuplicate } ], }; return eModal.ajax(options); } function ValidateBizPreferenceDuplicate() { var counter = 1; var formName = '#preFieldTagForm'; var bizType = $(formName+" #bizType").val(); var copyBizType = $('input[name=copyBizType]:checked', formName).val(); if(copyBizType === undefined && copyBizType =='') { $(formName +" #preFieldTag_EBox").html('Please Select Any One'); return false; } else { var dataArr = '&bizType='+bizType+'©BizType='+copyBizType console.log(main_console_root+"ajax/business_type_detail.php?mod=updateBizPreferenceTag"+dataArr); $.ajax({ type : "GET", url : main_console_root+"ajax/business_type_detail.php?mod=updateBizPreferenceTag"+dataArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { eModal.close(); var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { eModal.close(); var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } // ********************** Wizard Tag List ********************* function viewBizTypeWizardStep(business_type,name) { var options = { url : main_console_root+"modal/business_type_modal.php?modeType=WizardStepTag&id="+business_type, title :name+' : Wizard Step Tagged', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function viewBizTypeConfigurationStep(business_type,name) { var options = { url : main_console_root+"modal/business_type_modal.php?modeType=configurationStepTag&id="+business_type, title :name+' : Configuration Step Tagged', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function getWizardStepPageList(groupName,divPlaceStoreId) { $.ajax({ type: "GET", url : main_console_root+"ajax/preference_field.php?mod=wizardStepPage&groupName="+groupName, async : false, success : function(response) { $('#'+divPlaceStoreId).html(response); } }); } //*************************** Brand Image ************************** function viewBrandImageDenyReason(brandImageId) { var options = { url: main_console_root+"modal/approval_deny_modal.php?modeType=ViewBrandImageDeny&brandImageId="+brandImageId, title :'Brand Deny Reason', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function brandImageRemove(brand_id,image_id) { var confirmMSG = 'Are you confirm to Remove Image'; return eModal.confirm(confirmMSG, ' '+PROJECT_SITE_NAME+' Message') .then(function () { $.ajax({ type: "GET", url : main_console_root+"ajax/master_list_detail.php?mod=BrandImageRemove&brand_id="+brand_id+'&image_id='+image_id, async : false, success : function(response) { } }); window.setTimeout(function(){ location.reload(); }); }); } function viewBrandImageModel(brand_id) { console.log(main_console_root+"modal/business_type_modal.php?modeType=viewBrandImageList&id="+brand_id); var options = { url: main_console_root+"modal/business_type_modal.php?modeType=viewBrandImageList&id="+brand_id, title :'Brand Image Tagging', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'success ', close: true } ], }; return eModal.ajax(options); } function tagBrandImageBizWise(brand_id) { console.log(main_console_root+"modal/business_type_modal.php?modeType=BrandImageTagging&id="+brand_id); var options = { url: main_console_root+"modal/business_type_modal.php?modeType=BrandImageTagging&id="+brand_id, title :'Brand Image Tagging', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'success ', close: true, click: validateBrandImageTag } ], }; return eModal.ajax(options); } function validateBrandImageTag() { var counter = 1; var brand_id = $("#brandImageTagForm #brand_id").val(); var defaultImage = $('input[name=defaultImage]:checked', '#brandImageTagForm').val() if(defaultImage == "" || defaultImage === undefined ) { $("#brandImageTagForm #defaultImage_EBox").html('Please Select Any One For Default'); counter = 0; } var bizTypeArr = new Array(); var listArr = new Array(); var i=0; $.each($("input[name='imageIdArr[]']"),function(index) { var image_id = $("input[name='imageIdArr[]']").eq(index).val(); var bizTypeImage = $("#brandImageTagForm #businessType_"+image_id).val(); if(bizTypeArr.length >0 ) { var k=0; for (k=0; k < bizTypeArr.length; k++) { if (bizTypeArr[k] == bizTypeImage) { $("#brandImageTagForm #businessType_"+image_id).addClass("field-error"); counter = 0; } } } if(bizTypeImage != '') { bizTypeArr[i] = bizTypeImage; } listArr[i] = image_id+"@@"+bizTypeImage; i++; }); if(counter == 0) { return false; } else { var dataArr = '&brand_id='+brand_id+'&defaultImage='+defaultImage+'&listArr='+listArr; $.ajax({ type: "GET", url : main_console_root+"ajax/master_list_detail.php?mod=BrandImageTagged"+dataArr, async : false, success : function(response) { var alertMSG = "success@@@@Brand Image Tagged Successfully"; getDisplayAlertMsg(alertMSG); } }); } }// JavaScript Document //*************************** SMS / Email Function *************************** function copyTemplateParameter(paramNameId) { var param_name = $("#"+paramNameId).val(); var $temp = $(""); $("body").append($temp); $temp.val(param_name).select(); document.execCommand("Copy"); $temp.remove(); } function getParamenterList(groupName,divPlaceStoreId) { $.ajax({ type: "GET", url : main_console_root+"ajax/comm_template.php?mod=ParameterDropDownList&groupName="+groupName, async : false, success : function(response){ $('#'+divPlaceStoreId).html(response); } }); } // Get the Parameter New Row for the Tempalte function getParameterNewRow(paramCount) { if(isNaN(paramCount)){ paramCount = '0'; } var paramGroupArr = document.getElementsByName("paramGroupArr[]"); var paramNameArr = document.getElementsByName("paramNameArr[]"); var paramArr = new Array(); for(var i= 0; i< paramGroupArr.length; i++) { var j = i+1; var pGroup = $("#paramGroup_"+j).val(); var pName = $("#paramName_"+j).val(); paramArr[i] = pGroup+'@@@@'+pName; } var dataArr = '¶mCount='+paramCount+'¶mArr='+paramArr; $.ajax({ type: "GET", url : main_console_root+"ajax/comm_template.php?mod=parameterDivContent"+dataArr, async : false, success : function(response){ $('#parameterDivContent').html(response); } }); return msg; } function viewEmailTemplateDetail(template_id) { var options = { url: main_console_root+"modal/comm_template_modal.php?modeType=EmailTemplateView&template_id="+template_id, title :'Email Template Details', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function viewSMSTemplateDetail(template_id) { var options = { url: main_console_root+"modal/comm_template_modal.php?modeType=SMSTemplateView&template_id="+template_id, title :'SMS Template Details', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function viewNotificationTemplateDetail(template_id) { var options = { url: main_console_root+"modal/comm_template_modal.php?modeType=NotificationTemplateView&template_id="+template_id, title :'Notification Template Details', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function emailHeaderActive(header_id) { if(header_id !='') { $.ajax({ type: "GET", url : main_console_root+"ajax/comm_template.php?mod=EmailHeaderActive&header_id="+header_id, async : false, success : function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } function emailFooterActive(footer_id) { if(footer_id !='') { $.ajax({ type: "GET", url : main_console_root+"ajax/comm_template.php?mod=EmailFooterActive&footer_id="+footer_id, async : false, success : function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } function viewEmailFooterContent(footer_id) { var options = { url: main_console_root+"modal/comm_template_modal.php?modeType=EmailFooterContent&id="+footer_id, title :'Email Footer Content', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function smsFooterActive(footer_id) { if(footer_id !='') { $.ajax({ type: "GET", url : main_console_root+"ajax/comm_template.php?mod=SmsFooterActive&footer_id="+footer_id, async : false, success : function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } function viewEventTagDetail(event_key) { var options = { url: main_console_root+"modal/comm_template_modal.php?modeType=EventDetail&event_key="+event_key, title :'Event Details', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function viewNotifyImageFolder() { var options = { url: main_console_root+"modal/comm_template_modal.php?modeType=viewNotifyImageFolder", title :'Notification Image', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function getNotifyImageName(imageName) { if(imageName !='') { var dvPreview = $("#browseImages"); dvPreview.html(""); eModal.close(); $("#selNotifyImage").val(imageName); // Notificaiton Image Full Path var fullPath = main_root_image+'data/notification/'+imageName var img = $(""); img.attr("style", "height:100px;width: 100px;padding: 5px;"); img.attr("src", fullPath); dvPreview.append(img); } } function notificationRemove(template_id) { if(template_id !='') { $.ajax({ type: "GET", url : main_console_root+"ajax/comm_template.php?mod=RemoveNotifyImage&template_id="+template_id, async : false, success : function(result) { var alertMSG = "success@@@@Notificaiton Image Remove Successfully"; getDisplayAlertMsg(alertMSG); } }); window.setTimeout(function(){ location.reload(); }, 1000); } }// JavaScript Document //*************************** Store Detail ************************** function getStoreName(store_id) { var store_name = ''; $.ajax({ type : "GET", url : main_console_root+"ajax/store_detail.php?mod=storeName&store_id="+store_id, async : false, success:function(result) { store_name = result; } }); return store_name } // Store Detail function viewStoreDetails(store_id) { var store_name = getStoreName(store_id); var options = { url: main_console_root+"modal/store_detail_modal.php?modeType=StoreDetails&store_id="+store_id, title :'Business Details : '+store_name, size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function areaClubIdTagStoreId(areaClubId) { if(areaClubId !='') { var redirectPath = getRedirectUrlJs('MAIN_CONSOLE_ROOT','module/master/master_area_club_store'); $.ajax({ type: "GET", url : main_console_root+"ajax/store_detail.php?mod=areaClubIdTagStoreId&areaClubId="+areaClubId, async : false, success : function(response){ } }); window.setTimeout(function(){ window.location = redirectPath; }); } } // ************************* Seller Communicatio Modal ****************** // All Selected Store Communication Modal function allSellerCommunicationModal() { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { var id = $(this).val(); listArr[i] = id; i++; }); if(listArr.length >0 ) { var options = { url: main_console_root+"modal/store_detail_modal.php?modeType=SellerCommunicationModal&sellerIdList="+listArr, title :'Seller Communication', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }], }; return eModal.ajax(options); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } //Store Communication Modal Validate function validateSellerCommunication(modeType) { var counter = 1; var dataArr = ''; if(modeType == 'Email') { var seller_id = $("#sendEmailForm #seller_id").val(); var emailSubject = $("#sendEmailForm #emailSubject").val(); var emailDesc = $("#sendEmailForm #emailDesc").val(); if(emailSubject == "") { $("#sendEmailForm #emailSubject").addClass("field-error"); counter = 0; } if(emailDesc == "") { $("#sendEmailForm #emailDesc").addClass("field-error"); counter = 0; } var dataArr = 'mod=SendSellerEmail&sellerIdList='+seller_id+'&emailSubject='+emailSubject+'&emailDesc='+emailDesc; } else if(modeType == 'Sms') { var seller_id = $("#sendSmsForm #seller_id").val(); var smsDesc = $("#sendSmsForm #smsDesc").val(); if(smsDesc == ""){ $("#sendSmsForm #smsDesc").addClass("field-error"); counter = 0; } var dataArr = 'mod=SendSellerSms&sellerIdList='+seller_id+'&smsDesc='+smsDesc; } if(counter == 0) { return false; } else { $.ajax({ type : "GET", url : main_console_root+"ajax/store_detail.php?"+dataArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { eModal.close(); var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { eModal.close(); var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } // ************************* Store Communicatio Modal ****************** // All Selected Store Communication Modal function allStoreCommunicationModal() { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { var id = $(this).val(); listArr[i] = id; i++; }); if(listArr.length >0 ) { var options = { url: main_console_root+"modal/store_detail_modal.php?modeType=StoreCommunicationModal&storeIdList="+listArr, title :'Business Communication', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } // Store Communication Modal function viewStoreCommunicatinModal(store_id) { var store_name = getStoreName(store_id); var options = { url: main_console_root+"modal/store_detail_modal.php?modeType=StoreCommunicationModal&storeIdList="+store_id, title :'Business Communication : '+store_name, size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } //Store Communication Modal Validate function validateStoreCommunication(modeType) { var counter = 1; var dataArr = ''; if(modeType == 'Email') { var store_id = $("#sendEmailForm #store_id").val(); var emailSubject = $("#sendEmailForm #emailSubject").val(); var emailDesc = $("#sendEmailForm #emailDesc").val(); if(emailSubject == ""){ $("#sendEmailForm #emailSubject").addClass("field-error"); counter = 0; } if(emailDesc == "") { $("#sendEmailForm #emailDesc").addClass("field-error"); counter = 0; } var dataArr = 'mod=SendStoreEmail&storeIdList='+store_id+'&emailSubject='+emailSubject+'&emailDesc='+emailDesc; } else if(modeType == 'Sms') { var store_id = $("#sendSmsForm #store_id").val(); var smsDesc = $("#sendSmsForm #smsDesc").val(); if(smsDesc == ""){ $("#sendSmsForm #smsDesc").addClass("field-error"); counter = 0; } var dataArr = 'mod=SendStoreSms&storeIdList='+store_id+'&smsDesc='+smsDesc; } else if(modeType == 'Notify') { var store_id = $("#sendNotifyForm #store_id").val(); var notifyTitle = $("#sendNotifyForm #notifyTitle").val(); var notifyDesc = $("#sendNotifyForm #notifyDesc").val(); var imageSend = $('input[name=imageSend]:checked', '#sendNotifyForm').val(); if(notifyTitle == ""){ $("#sendNotifyForm #notifyTitle").addClass("field-error"); counter = 0; } if(notifyDesc == "") { $("#sendNotifyForm #notifyDesc").addClass("field-error"); counter = 0; } if(imageSend === undefined) { imageSend = "None";} var dataArr = 'mod=SendStoreNotify&storeIdList='+store_id+'¬ifyTitle='+notifyTitle+'¬ifyDesc='+notifyDesc+'&imageSend='+imageSend; } if(counter == 0) { return false; } else { $.ajax({ type : "GET", url : main_console_root+"ajax/store_detail.php?"+dataArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { eModal.close(); var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { eModal.close(); var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } // ************************* Store Detail edit ****************** function editStoreDetails(store_id) { var store_name = getStoreName(store_id); var options = { url: main_console_root+"modal/store_detail_modal.php?modeType=EditStoreDetails&store_id="+store_id, title :'Business Details : '+store_name , size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true,click: validateStoreDetail } ], }; return eModal.ajax(options); } function validateStoreDetail() { var counter = 1; var formName = '#editStoreDetailForm'; var pattern = new RegExp("^([a-zA-Z0-9\\s_\\.\\-:])+(.jpg|.jpeg|.png)$"); var IMAGE_EXTENSIONS = '.jpg, .jpeg,.png'; var store_id = $(formName+" #store_id").val(); var storeName = $(formName+" #storeName").val(); var businessType = $(formName+" #businessType").val(); var ownerName = $(formName+" #ownerName").val(); var contactMobile = $(formName+" #contactMobile").val(); var contactEmail = $(formName+" #contactEmail").val(); var address = $(formName+" #address").val(); var landmark = $(formName+" #landmark").val(); var deliveryDistance = $(formName+" #deliveryDistance").val(); var storeImage = document.getElementById('storeImage'); var bankName = $(formName+" #bankName").val(); var bankAccount = $(formName+" #bankAccount").val(); var bankIfsc = $(formName+" #bankIfsc").val(); var expressOrderEnable = $('input[name=expressOrderEnable]:checked', formName).val(); var showInventory = $('input[name=showInventory]:checked', formName).val(); if(storeName == "") { $(formName+" #storeName_EBox").html('Please Enter Business Name'); counter = 0;} if(businessType == "") { $(formName+" #businessType_EBox").html('Please Select Business Type'); counter = 0; } if(ownerName == "") { $(formName+" #ownerName_EBox").html('Please Enter Owner Name'); counter = 0;} if(contactMobile == "") { $(formName+" #contactMobile_EBox").html('Please Enter Contact Mobile Number'); counter = 0; } else { var msg = checkMobileFormat(contactMobile); if(msg != true) { $(formName+" #contactMobile_EBox").html(msg); counter = 0; } } if(contactEmail == "") { $(formName+" #contactEmail_EBox").html('Please Enter Contact Email-Id'); counter = 0; } else { var msg = checkEmailFormat(contactEmail); if(msg != true) { $(formName+" #contactEmail_EBox").html(msg); counter = 0; } } if(address == "") { $(formName+" #address_EBox").html('Please Enter Store Address'); counter = 0; } if(deliveryDistance == "") { $(formName+" #deliveryDistance_EBox").html('Please Enter Delivery Distance'); counter = 0; } if(expressOrderEnable === undefined || expressOrderEnable == '') { $(formName+" #expressOrderEnable_EBox").html("Select Any One Option"); counter = 0; } if(showInventory === undefined || showInventory == '') { $(formName+" #showInventory_EBox").html("Select Any One Option"); counter = 0; } if(parseInt(storeImage.files.length) >0) { var storeImgName = storeImage.files[0].name.toLowerCase(); if(storeImgName !='' && !pattern.test(storeImgName)) { $(formName +" #storeImage_EBox").html('Please upload files having extensions. '+IMAGE_EXTENSIONS); counter = 0; } } if(counter == 0) { return false; } else { var file_data = ''; if(parseInt(storeImage.files.length) >0) { var file_data = storeImage.files[0]; } var form_data = new FormData(); form_data.append('mod', 'updateStoreDetail'); form_data.append('store_id', store_id); form_data.append('storeName', storeName); form_data.append('businessType', businessType); form_data.append('ownerName', ownerName); form_data.append('contactMobile', contactMobile); form_data.append('contactEmail', contactEmail); form_data.append('address', address); form_data.append('landmark', landmark); form_data.append('deliveryDistance', deliveryDistance); form_data.append('bankName', bankName); form_data.append('bankAccount', bankAccount); form_data.append('bankIfsc', bankIfsc); form_data.append('expressOrderEnable', expressOrderEnable); form_data.append('showInventory', showInventory); form_data.append('storeImage', file_data); $.ajax({ type : "POST", url : main_console_root+"ajax/store_detail.php", async : false, data : form_data, cache : false, contentType: false, processData:false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { eModal.close(); var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { eModal.close(); var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } // ************************* Store Reg Approved Status ****************** function storeRegApprovedStatus(store_id) { var store_name = getStoreName(store_id); var options = { url: main_console_root+"modal/approval_deny_modal.php?modeType=StoreRegApproval&store_id="+store_id, title :'Business Approval : '+store_name , size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true, click: validateStoreRegApproval } ], }; return eModal.ajax(options); } function validateStoreRegApproval(store_id) { var counter = 1; var formName = '#storeApprovalForm'; var store_id = $(formName+" #store_id").val(); var verifyStatus = $('input[name=verifyStatus]:checked', formName).val(); var tagAreaClubId = $(formName+" #tagAreaClubId").val(); if(verifyStatus === undefined || verifyStatus == '') { $(formName+" #verifyStatus_EBox").html("Please Select Any One"); counter = 0; } if(tagAreaClubId === undefined) { tagAreaClubId = ''; } if(counter == 0) { return false; } else { var listArr = store_id; var mod_action = 'StoreApproval'; console.log(main_console_root+"ajax/approval_records.php?status=1&mod="+mod_action+'&listArr='+listArr+'&verifyStatus='+verifyStatus+'&tagAreaClubId='+tagAreaClubId); $.ajax({ type : "GET", url : main_console_root+"ajax/approval_records.php?status=1&mod="+mod_action+'&listArr='+listArr+'&verifyStatus='+verifyStatus+'&tagAreaClubId='+tagAreaClubId, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } function storeRegDenyStatus(store_id) { var listArr = store_id; var mod_action = 'StoreApproval'; var store_name = getStoreName(store_id); var options = { url: main_console_root+"modal/approval_deny_modal.php?modeType=DenyReasonList&mod_action="+mod_action+'&denyIdList='+listArr, title :'Denial Reason : '+store_name , size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true, click: validateDenyReasonlistModal } ], }; return eModal.ajax(options); } function storeGoliveApprovedStatus(store_id) { var store_name = getStoreName(store_id); var confirmMSG = 'Please click OK to approve '+store_name+' GoLive Business on '+PROJECT_SITE_NAME+' Portal. '; return eModal.confirm(confirmMSG, ' '+PROJECT_SITE_NAME+' Message') .then(function () { var listArr = store_id; var mod_action = 'StoreGolive'; $.ajax({ type : "GET", url : main_console_root+"ajax/approval_records.php?status=1&mod="+mod_action+'&listArr='+listArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); }); } function storeGoliveDenyStatus(store_id) { var listArr = store_id; var mod_action = 'StoreGolive'; var store_name = getStoreName(store_id); var options = { url: main_console_root+"modal/approval_deny_modal.php?modeType=DenyReasonList&mod_action="+mod_action+'&denyIdList='+listArr, title :'Denial Reason : '+store_name , size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true, click: validateDenyReasonlistModal } ], }; return eModal.ajax(options); } // Store Detail Edit KYC function editStoreKycDetails(store_id) { var alertMSG = "warning@@@@"+"Need To Be Discuss"; getDisplayAlertMsg(alertMSG); } function storeKycHoldModal() { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { var id = $(this).val(); listArr[i] = id; i++; }); if(listArr.length >0 ) { var alertMSG = "warning@@@@"+"Need To Be Discuss"; getDisplayAlertMsg(alertMSG); } } function storeMapView(store_id) { var store_name = getStoreName(store_id); var options = { url: main_console_root+"modal/store_detail_modal.php?modeType=StoreMapView&store_id="+store_id, title :'Google Map View: '+store_name , size: eModal.size.lgs, buttons: [{text: 'Close', style: 'default ', close: true }], }; return eModal.ajax(options); } function updateShoposCertification(store_id) { var store_name = getStoreName(store_id); var options = { url: main_console_root+"modal/store_detail_modal.php?modeType=updateShoposLicence&store_id="+store_id, title :'SHOPOS Certification : '+store_name , size: eModal.size.lgs, buttons: [ {text: 'Update',style: 'success ', close: true, click: validateShoposCertification }, {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function validateShoposCertification() { var counter = 1; var formName = '#updateShoposLicenceForm'; var store_id = $(formName+" #store_id").val(); var shoposEnable = $('input[name=shoposEnable]:checked', formName).val(); var shoposType = $('input[name=shoposType]:checked', formName).val(); var orderEstimation = $('input[name=orderEstimation]:checked', formName).val(); var kichenActive = $('input[name=kichenActive]:checked', formName).val(); var tableActive = $('input[name=tableActive]:checked', formName).val(); var posTableCount = $(formName+" #posTableCount").val(); var shoposValidity = $(formName+" #shoposValidity").val(); var serialPrefix = $(formName+" #serialPrefix").val(); var storeMarquee = $(formName+" #storeMarquee").val(); var posPaymentType = new Array(); var i=0; $.each($("input[name='posPaymentType[]']:checked"), function() { posPaymentType[i] = $(this).val(); i++; }); if(posPaymentType.length == '0' ) { posPaymentType[0] = 'CASH'; } if(shoposEnable === undefined || shoposEnable == '') { $(formName+" #shoposEnable_EBox").html("Select Any One Option"); counter = 0; } if(shoposType === undefined || shoposType == '') { $(formName+" #shoposType_EBox").html("Select Any One Option"); counter = 0; } if(orderEstimation === undefined || orderEstimation == '') { $(formName+" #orderEstimation_EBox").html("Select Any One Option"); counter = 0; } if(kichenActive === undefined || kichenActive == '') { $(formName+" #kichenActive_EBox").html("Select Any One Option"); counter = 0; } if(tableActive === undefined || tableActive == '') { $(formName+" #tableActive_EBox").html("Select Any One Option"); counter = 0; } if(shoposValidity == '') { $(formName+" #shoposValidity_EBox").html('Shopos Demo Validity in Days'); counter = 0; } else { if(isNaN(shoposValidity)) { $(formName+" #shoposValidity_EBox").html('Please Enter Only Digit'); counter = 0; } else if(parseInt(shoposValidity)<0) { $(formName+" #shoposValidity_EBox").html('Please Enter Greater than Equal To Zero'); counter = 0; } } if(posTableCount == '') { $(formName+" #posTableCount_EBox").html('Enter Shopos Table Counts'); counter = 0; } else { if(isNaN(posTableCount)) { $(formName+" #posTableCount_EBox").html('Please Enter Only Digit'); counter = 0; } else if(parseInt(posTableCount)<0){ $(formName+" #posTableCount_EBox").html('Please Enter Greater than Equal To Zero'); counter = 0; } } if(counter == 0) { return false; } else { var dataArr = '&store_id='+store_id+'&shoposEnable='+shoposEnable+'&shoposType='+shoposType+'&kichenActive='+kichenActive; dataArr += '&tableActive='+tableActive+'&posTableCount='+posTableCount+'&shoposValidity='+shoposValidity; dataArr += '&posPaymentType='+posPaymentType+'&orderEstimation='+orderEstimation+'&serialPrefix='+serialPrefix; dataArr += '&storeMarquee='+storeMarquee; //alert(main_console_root+"ajax/store_detail.php?mod=updateShoposLicence"+dataArr); $.ajax({ type : "GET", url : main_console_root+"ajax/store_detail.php?mod=updateShoposLicence"+dataArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { eModal.close(); var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { eModal.close(); var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } function makeStoreWebList() { var confirmMSG = 'Are you confirm to Web List'; return eModal.confirm(confirmMSG, ' '+PROJECT_SITE_NAME+' Message') .then(function () { $.ajax({ type : "GET", url : main_console_root+"ajax/store_detail.php?mod=makeStoreWebList", async : false, success:function(result) { var alertMSG = "success@@@@Web List Update Successfully"; getDisplayAlertMsg(alertMSG); } }); }); } function viewStoreOfferDetail(offer_id) { var options = { url: main_console_root+"modal/store_detail_modal.php?modeType=StoreOfferDetail&offer_id="+offer_id, title :'Business Offer Details', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function allPosStoreMarqueeModal() { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { var id = $(this).val(); listArr[i] = id; i++; }); if(listArr.length >0 ) { var options = { url: main_console_root+"modal/store_detail_modal.php?modeType=posStoreMarqueeModal&storeIdList="+listArr, title :'SHOPOS Scroller Marquee', size: eModal.size.lgs, buttons: [ {text: 'Update',style: 'success ', close: true, click: validateShoposMarquee }, {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } function validateShoposMarquee() { var counter = 1; var formName = '#updateShoposMaqueeForm'; var store_id = $(formName+" #store_id").val(); var marqueConcatenate = $('input[name=marqueConcatenate]:checked', formName).val(); var storeMarquee = $(formName+" #storeMarquee").val(); if(marqueConcatenate === undefined || marqueConcatenate == '') { $(formName+" #marqueConcatenate_EBox").html("Select Any One Option"); counter = 0; } if(storeMarquee == '') { $(formName+" #storeMarquee_EBox").html('Please Enter Store Scroller Marquee'); counter = 0; } if(counter == 0) { return false; } else { var dataArr = '&store_id='+store_id+'&marqueConcatenate='+marqueConcatenate+'&storeMarquee='+storeMarquee; $.ajax({ type : "GET", url : main_console_root+"ajax/store_detail.php?mod=updateShoposMarquee"+dataArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { eModal.close(); var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { eModal.close(); var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } // Store Detail function viewCashiOfferDetail(cashi_offer_id) { var options = { url: main_console_root+"modal/store_detail_modal.php?modeType=CashiOfferDetail&cashi_offer_id="+cashi_offer_id, title :'Cashi Offer Details ', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function editStoreConfigurationStep(store_id) { var store_name = getStoreName(store_id); var options = { url: main_console_root+"modal/store_detail_modal.php?modeType=editStoreConfigurationStep&store_id="+store_id, title :'Business Details : '+store_name , size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true,click: validateStoreConfigurationStep } ], }; return eModal.ajax(options); } function validateStoreConfigurationStep() { var formName = '#storePrferenceForm'; var counter = 1; var fldTypeObj = $(formName+" #metaFieldListArr").val(); var store_id = $(formName+" #store_id").val(); fldTypeObj = JSON.parse(fldTypeObj); var inputDataArr = '&store_id='+store_id; $.each(fldTypeObj, function(key, value) { var fld_key = value['fld_key']; if(value['fld_type'] =='radio_type') { var name_title = $("input[name='"+fld_key+"']:checked"). val(); if(parseInt(value['fld_mdt']) == 1) { if(name_title == "" || name_title === undefined ) { $("#"+fld_key+"EBox").html(value['fldError']); counter = 0; } } inputDataArr += '&'+fld_key+'='+name_title; } else if (value['fld_type'] == 'checkbox_type') { var atlestone = 0; var ser_quant = $("input[name='"+fld_key+"[]']"); var checkBoxArr = new Array(); $.each(ser_quant,function(index) { if($("input[name='"+fld_key+"[]']").eq(index).is(':checked')) { var id = $(this).val(); checkBoxArr[atlestone] = id; atlestone++; } }); if(parseInt(value['fld_mdt']) == 1) { if(checkBoxArr.length == 0 ) { $("#"+fld_key+"EBox").html(value['fldError']); counter = 0; } } inputDataArr += '&'+fld_key+'='+checkBoxArr; } else if(value['fldType'] == 'number_type') { var name_title = $("#"+fld_key).val(); if(parseInt(value['fld_mdt']) == 1) { if(name_title == "") { $("#"+fld_key+"EBox").html(value['fldError']); counter = 0; } else { if( parseInt(name_title) < 1 ) { $("#"+fld_key+"EBox").html('Please enter greater than and equal to one.'); counter = 0; } } } inputDataArr += '&'+fld_key+'='+name_title; } else { var name_title = $("#"+fld_key).val(); if(parseInt(value['fld_mdt']) == 1) { if(name_title == "" ) { $("#"+fld_key+"EBox").html(value['fldError']); counter = 0; } } inputDataArr += '&'+fld_key+'='+encodeURIComponent(name_title); } }); if(counter == 0) { return false; } else { console.log(main_console_root+"ajax/store_detail.php?&mod=updateStorePreferenceDetail"+inputDataArr); $.ajax({ type : "GET", url : main_console_root+"ajax/store_detail.php?&mod=updateStorePreferenceDetail"+inputDataArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { eModal.close(); var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { eModal.close(); var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } // *********************** Store Product Essential List *************** function getActiveEssentialGroupList(bizType) { console.log(main_console_root+"ajax/getDropDownOption.php?mod=bizTypeEssentialList&bizType="+bizType); $.ajax({ type: "GET", url : main_console_root+"ajax/getDropDownOption.php?mod=bizTypeEssentialList&bizType="+bizType, async : false, success : function(response) { console.log(response); $('#essentialId').html(response); } }); } function uploadStoreEssentialProduct(store_id) { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { var id = $(this).val(); listArr[i] = id; i++; }); if(listArr.length >0 ) { var options = { url: main_console_root+"modal/store_detail_modal.php?modeType=storeEssentialProductModal&storeIdList="+listArr, title :'Business Essential Product', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true, click: validateStoreEssentialTagModal } ], }; return eModal.ajax(options); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } function validateStoreEssentialTagModal() { var counter = 1; var formName = '#storeEssentialTagProForm'; var businessType = $(formName +" #businessType").val(); var essentialId = $(formName +" #essentialId").val(); var storeIdList = $(formName +" #store_id").val(); if(businessType == "") { $(formName +" #businessType_EBox").html('Please Select Deny Reason'); counter = 0; } if(essentialId.length == 0) { $(formName +" #essentialId_EBox").html('Please Select Essential'); counter = 0; } if(counter == 0) { return false; } else { var dataArr = '&storeIdList='+storeIdList+'&businessType='+businessType+'&essentialId='+essentialId; console.log(main_console_root+"ajax/store_detail.php?mod=storeEssentialProduct"+dataArr); $.ajax({ type : "GET", url : main_console_root+"ajax/store_detail.php?mod=storeEssentialProduct"+dataArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } // *********************** Store Archive *************** // Records Archive With Reason List Modal function storeArchiveReasonModal() { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { var id = $(this).val(); listArr[i] = id; i++; }); if(listArr.length >0 ) { console.log(main_console_root+"modal/approval_deny_modal.php?modeType=DenyReasonList&mod_action=StoreArchive&denyIdList="+listArr); var options = { url: main_console_root+"modal/approval_deny_modal.php?modeType=DenyReasonList&mod_action=StoreArchive&denyIdList="+listArr, title :'Archive Reason', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true, click: validateStoreArchiveReasonModal } ], }; return eModal.ajax(options); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } // validate Archive With Reason List Modal function validateStoreArchiveReasonModal() { var counter = 1; var formName = '#denyReasonListForm'; var mod_action = $(formName +" #mod_action").val(); var denyIdList = $(formName +" #denyIdList").val(); var denyReason = $(formName +" #denyReason").val(); var denyComment = $(formName +" #denyComment").val(); if(denyReason == "") { $(formName +" #denyReason_EBox").html('Please Select Deny Reason'); counter = 0; } if(denyComment == "") { $(formName +" #denyComment_EBox").html('Please Enter Comment'); counter = 0; } //else if(parseInt(denyComment.length) < 20) { $(formName +" #denyComment_EBox").html('Please Enter Comment Greater Than 20 Characters'); counter = 0; } if(counter == 0) { return false; } else { var dataArr = '&listArr='+denyIdList+'&denyReason='+denyReason+'&denyComment='+denyComment; console.log(main_console_root+"ajax/approval_records.php?status=2&mod=StoreArchive"+dataArr); $.ajax({ type : "GET", url : main_console_root+"ajax/approval_records.php?mod=StoreArchive"+dataArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } // *********************** Store Promoted *************** function storePromotedModal() { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { var id = $(this).val(); listArr[i] = id; i++; }); if(listArr.length >0 ) { var options = { url: main_console_root+"modal/store_detail_modal.php?modeType=storePromotedModal&storeIdList="+listArr, title :'Business Promoted', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true, click: validateStorePromotedDate } ], }; return eModal.ajax(options); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } // validate Archive With Reason List Modal function validateStorePromotedDate() { var counter = 1; var formName = '#storePromotedForm'; var store_id = $(formName +" #store_id").val(); var promotionStart = $(formName +" #promotionStart").val(); var promotionEnd = $(formName +" #promotionEnd").val(); var current_date = new Date(); if(promotionStart == "") { $(formName +" #promotionStart_EBox").html('Please Select Promotion Start Date'); counter = 0; } if(promotionEnd == "") { $(formName +" #promotionEnd_EBox").html('Please Select Promotion End Date'); counter = 0; } if(promotionStart !='' && promotionEnd !='') { // Start Date var dateArr1 = promotionStart.match(/(\d+)/g); var newDate1 = new Date(dateArr1[0], dateArr1[1]-1, dateArr1[2]); // months are 0-based var firstDate = new Date(newDate1); // End Date var dateArr2 = promotionEnd.match(/(\d+)/g); var newDate2 = new Date(dateArr2[0], dateArr2[1]-1, dateArr2[2]); // months are 0-based var secondDate = new Date(newDate2); var newDate3 = new Date(current_date.getFullYear(), current_date.getMonth(), current_date.getDate()); // months are 0-based var thirdDate = new Date(newDate3); if(thirdDate > firstDate) { $(formName +" #promotionStart_EBox").html('Please Select Another Date'); counter = 0; } if(firstDate > secondDate) { $(formName +" #promotionEnd_EBox").html('Please Select Another Date'); counter = 0; } } if(counter == 0) { return false; } else { var dataArr = '&promotionStart='+promotionStart+'&promotionEnd='+promotionEnd+'&storeIdList='+store_id; console.log(main_console_root+"ajax/store_detail.php?mod=storePromotionUpdate"+dataArr); $.ajax({ type : "GET", url : main_console_root+"ajax/store_detail.php?mod=storePromotionUpdate"+dataArr, async : false, success:function(result) { var alertMSG = "success@@@@Store Promotion Set Successfully"; getDisplayAlertMsg(alertMSG); } }); window.setTimeout(function(){ location.reload(); }, 1000); } } function getStoreSellerLogin(store_id) { var loginPath = main_console_root+"ajax/seller_login.php?mod=storeLogin&store_id="+store_id; window.open(loginPath); //window.setTimeout(function(){ window.location = loginPath; }); }// JavaScript Document //*********************************** Add Field Row ********************** function addFieldRow(FieldTypeArr) { var fldTypeObj = $.parseJSON(FieldTypeArr); var msg = ''; msg += '

'; msg += '
'; // Check Box msg += '
'; // Form Fields msg += '
'; if( 1==1) { msg += '
'; msg += ''; msg += ''; msg += ''; msg += '
'; } if( 2==2) { msg += '
'; msg += ''; msg += ''; msg += ''; msg += '
'; } if( 3== 3) { msg += '
'; msg += ''; msg += ''; msg += ''; msg += '
'; } msg += '
'; msg += '
'; $("#fieldDataDiv").append(msg); $(".span12").click(function(){ if ($(this).hasClass("field-error")) { $(this).removeClass("field-error"); }}); $(".span11").click(function(){ if ($(this).hasClass("field-error")) { $(this).removeClass("field-error"); }}); } //*********************************** Delete Field Row ********************** function delFieldRow() { var quant = $("input[name='chk[]']"); if(quant.length >1) { var indexArr = []; $.each(quant,function(index){ if($("input[name='chk[]']").eq(index).is(':checked')) { indexArr.push(index); } }); if(indexArr.length > 0) { return eModal.confirm('Are you confirm to delete', ' '+PROJECT_SITE_NAME+' Message') .then(function () { for (var i=indexArr.length-1; i>=0; i-- ) { index = indexArr[i]; $("input[name='chk[]']").eq(index).parents().eq(3).remove(); } }); } else { var alertMSG = "warning@@@@Please Select Atleast One Checkbox"; getDisplayAlertMsg(alertMSG); } } else { var alertMSG = "warning@@@@You cannot Delete All Field"; getDisplayAlertMsg(alertMSG); } } function customeFieldValidation(formName,fldTypeObj) { var counter = 1; $.each(fldTypeObj, function(key, value) { // Field is Mandatry or Not if(value['fld_mdt'] == 'Yes') { // Get the Field Details var fld_key = value['fld_key']; var field_type = value['fld_type']; var field_error = value['fld_error']; var field_EBox = "#"+formName+" #"+fld_key+"_EBox"; if(field_type =='radio_type') // Validatation for Radio Type { var field_value = $('input[name='+fld_key+']:checked', formName).val(); if(field_value === undefined || field_value == '') { $(field_EBox).html(field_error); counter = 0; } } else if (field_type == 'checkbox_type') // Validatation for Checkbox Type { var atlestone = 0; // Flag Set For Checkbox Counter var ser_quant = $("input[name='"+fld_key+"[]']"); $.each(ser_quant,function(index) { if($("input[name='"+fld_key+"[]']").eq(index).is(':checked')) { atlestone = 1; } }); if(parseInt(atlestone) == 0) { $(field_EBox).html(field_error); counter = 0; } } else if(field_type == 'number_type') // Validatation for Number Type { var field_value = $("#"+fld_key).val(); if(field_value == "") { $(field_EBox).html(field_error); counter = 0; } else if( parseInt(field_value) < 0 ){ $(field_EBox).html('Greater than and equal to Zero.'); counter = 0; } else if(isNaN(field_value)) { $(field_EBox).html('Please Enter Only Digit.'); counter = 0; } } else // Other Else Field Type { var field_value = $("#"+fld_key).val(); if(field_value == "" ) { $(field_EBox).html(field_error); counter = 0; } } } }); return counter; } //*********************************** Check Product Template Name ********************** function checkProTemplateName(template_name) { var template_id = $("#addProTemplateForm #template_id").val(); var dataArr = '&template_name='+template_name+'&template_id='+template_id; var msg = true; $.ajax({ type: "GET", url : main_console_root+"ajax/product_template.php?&mod=chkProTemplateName"+dataArr, async : false, success : function(response) { if(response != '0') { msg = response ; } } }); return msg; } function proTemplateChoose(template_id,product_id,redirect) { if (product_id == 'new_product') { product_id = ''; } if (redirect === undefined) { redirect = ''; } var edit_parameter = ''; if(product_id !='') { edit_parameter = 'mod@edit@@id@'+product_id; if(redirect !='') {edit_parameter += '@@redirect@'+redirect; } } var redirectPath = getRedirectUrlJs('MAIN_CONSOLE_ROOT','module/product/product_add',edit_parameter); $.ajax({ type: "GET", url : main_console_root+"ajax/product_template.php?mod=proTemplateChoose&template_id="+template_id, async : false, success : function(response){ } }); window.setTimeout(function(){ window.location = redirectPath; }); } function changeChooseProductForm() { var redirectPath = getRedirectUrlJs('MAIN_CONSOLE_ROOT','module/product/product_form_choose'); $.ajax({ type: "GET", url : main_console_root+"ajax/product_template.php?mod=changeProTemplate", async : false, success : function(response){ } }); window.setTimeout(function(){ window.location = redirectPath; }); } // Get the Parameter New Row for the Tempalte function getDescParameterNewRow(template_id,descParamCount) { if(descParamCount === undefined) { descParamCount = '0'; } if(isNaN(descParamCount)) { descParamCount = '0'; } var paramNameArr = document.getElementsByName("paramNameArr[]"); var descParamArr = new Array(); for(var i= 0; i< paramNameArr.length; i++) { var j = i+1; descParamArr[i] = $("#paramName_"+j).val(); } var dataArr = '&template_id='+template_id+'&descParamCount='+descParamCount+'&descParamArr='+descParamArr; console.log(main_console_root+"ajax/product_template.php?mod=descParameterDivContent"+dataArr); $.ajax({ type: "GET", url : main_console_root+"ajax/product_template.php?mod=descParameterDivContent"+dataArr, async : false, success : function(response) { $('#descParameterDivContent').html(response); } }); } //*********************************** Master Product Detail ********************** // Get Product Name function getProductName(product_id) { var product_name = ''; if(product_id !='') { $.ajax({ type: "GET", url : main_console_root+"ajax/product_template.php?mod=getProductName&product_id="+product_id, async : false, success : function(response){ product_name = response; } }); } return product_name; } // Product Details Modal function viewProductDetailModal(product_id) { var proName = getProductName(product_id); var options = { url: main_console_root+"modal/product_detail_modal.php?modeType=ProductDetail&product_id="+product_id, title :'Product Details : ' +proName, size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } //*********************************** Master Product Image ********************** function updateProductImageSequence(product_id) { var dataArr = '&product_id='+product_id; console.log(main_console_root+"modal/product_detail_modal.php?modeType=ProductImageSequence"+dataArr); var options = { url: main_console_root+"modal/product_detail_modal.php?modeType=ProductImageSequence"+dataArr, title :'Product Image Sequence', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }, {text: 'Save', style: 'primary ', close: true, click:validateProductImageSequence } ], }; return eModal.ajax(options); } function validateProductImageSequence() { var counter =1; var formName = '#proImageSequenceForm'; var listArr = new Array(); var i=0; var product_id = $(formName +" #product_id").val(); var quant = $(formName +" input[name='imageIdArr[]']"); $.each(quant,function(index) { var imageId = $(formName +" input[name='imageIdArr[]']").eq(index).val(); var imageSort = $(formName +" input[name='imageSortArr[]']").eq(index).val(); listArr[i] = imageId+'@@'+imageSort; i++; }); if(counter == 1) { var dataArr = '&product_id='+product_id+'&listArr='+listArr; console.log(main_console_root+"ajax/product_template.php?mod=updateProImageSortingList"+dataArr); $.ajax({ type: "GET", url : main_console_root+"ajax/product_template.php?mod=updateProImageSortingList"+dataArr, async : false, success : function(response) { getDisplayAlertMsg("success@@@@Image Sorting Successfully"); } }); window.setTimeout(function(){ window.location.reload(); }, 1000); } else { return false; } } function imageProductChoose(product_id) { var redirectPath = getRedirectUrlJs('MAIN_CONSOLE_ROOT','module/image_upload/product_image'); $.ajax({ type: "GET", url : main_console_root+"ajax/product_template.php?mod=imageProductChoose&product_id="+product_id, async : false, success : function(response){ } }); window.setTimeout(function(){ window.location = redirectPath; }); } function productImageRemove(image_id) { var result = ''; if(image_id !='') { $.ajax({ type : "GET", url : main_console_root+"ajax/delete_records.php?mod=ProductImageApproval&listArr="+image_id, async : false, success:function(result) { if(result > 0) { var alertMSG = "success@@@@Product Image Remove Successfully"; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+result; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } function viewProImageDenyReason(productImageId) { var options = { url: main_console_root+"modal/approval_deny_modal.php?modeType=viewProImageDenyReason&productImageId="+productImageId, title :'Product Image Deny Reason', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } //*********************************** Auto Suggestion ********************** // ******************* Product UPC ********************* //Product UPC Auto Suggestion List function autoCompletUPC(formName) { var min_length = 0; var keyword = $('#'+formName+' #proUpc').val(); var template_id = $('#'+formName+' #template_id').val(); if (keyword.length > min_length) { var dataArr = '&keyword='+keyword+'&template_id='+template_id+'&formName='+formName; $.ajax({ type: "GET", url :main_console_root+"ajax/auto_suggestion.php?mod=autoCompletUpc"+dataArr, success : function(response) { if(response == "") { $('#'+formName+' #product_id').val(''); $('#'+formName+' #validationFlag').val('0'); $('#'+formName+' #autoSuggestUpcList').hide(); } else { $('#'+formName+' #product_id').val(''); $('#'+formName+' #validationFlag').val('0'); $('#'+formName+' #autoSuggestUpcList').show(); $('#'+formName+' #autoSuggestUpcList').html(response); } } }); } else { $('#'+formName+' #product_id').val(''); $('#'+formName+' #validationFlag').val('0'); $('#'+formName+' #autoSuggestUpcList').hide(); if(formName == 'proForm') { $("#formHideDiv :input").attr("disabled", true); $("#metaDetilDiv :input").attr("disabled", true); } } } // Select the Item UPC on Auto Suggestion List function selAutoSuggestUPC(proUpc,form_name) { // hide proposition list $(form_name+' #autoSuggestUpcList').hide(); // fill the Barcode $(form_name+' #proUpc').val(proUpc); $('#submit').trigger( "click" ); } // ******************* Product Name ********************* // Product Name Auto Suggestion List function autoCompletProName(formName) { var min_length = 0; var keyword = $('#'+formName+' #proName').val(); var template_id = $('#'+formName+' #template_id').val(); if (keyword.length > min_length) { var dataArr = '&keyword='+keyword+'&template_id='+template_id+'&formName='+formName; $.ajax({ type: "GET", url :main_console_root+"ajax/auto_suggestion.php?mod=autoCompleteProName"+dataArr, success : function(response) { if(response == "") { $('#'+formName+' #autoSuggestProNameList').hide(); } else { $('#'+formName+' #autoSuggestProNameList').show(); $('#'+formName+' #autoSuggestProNameList').html(response); } } }); } else { $('#'+formName+' #autoSuggestNameList').hide(); } } // Select the Item Name on Auto Suggestion List function selAutoSuggestName(product_id,form_name) { // hide proposition list $('#'+form_name+' #autoSuggestProNameList').hide(); var proName = getProductName(product_id); // fill the Product Name $('#'+form_name+' #proName').val(proName); } // ******************* Product Brand ********************* // Product Brand Auto Suggestion List function autoCompletProBrand(formName) { var min_length = 0; var keyword = $('#'+formName+' #proBrand').val(); var template_id = $('#'+formName+' #template_id').val(); if (keyword.length > min_length) { var dataArr = '&keyword='+keyword+'&template_id='+template_id+'&formName='+formName; $.ajax({ type: "GET", url :main_console_root+"ajax/auto_suggestion.php?mod=autoCompletProBrand"+dataArr, success : function(response) { if(response == "") { $('#'+formName+' #autoSuggestProBrandList').hide(); } else { $('#'+formName+' #autoSuggestProBrandList').show(); $('#'+formName+' #autoSuggestProBrandList').html(response); } } }); } else { $('#'+formName+' #autoSuggestProBrandList').hide(); } } // Select the Item Brand on Auto Suggestion List function selAutoSuggestBrand(proBrand,form_name) { // hide proposition list $('#'+form_name+' #autoSuggestProBrandList').hide(); // fill the Barcode $('#'+form_name+' #proBrand').val(proBrand); } // ******************* Product Linking Tag ********************* function productLinkingUpdate() { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { listArr[i] = $(this).val(); i++; }); if(listArr.length >0 ) { var confirmMSG = 'Are you confirm to Continue...'; return eModal.confirm(confirmMSG, ' '+PROJECT_SITE_NAME+' Message') .then(function () { console.log(main_console_root+"ajax/product_template.php?mod=productLinkingUpdate&listArr="+listArr); $.ajax({ type : "GET", url : main_console_root+"ajax/product_template.php?mod=productLinkingUpdate&listArr="+listArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); }); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } function chooseProductLinkTag(product_id) { if(product_id !='') { var redirectPath = getRedirectUrlJs('MAIN_CONSOLE_ROOT','module/product/product_link_tag'); console.log(main_console_root+"ajax/product_template.php?mod=proLinkTagIdChoose&product_id="+product_id); $.ajax({ type: "GET", url : main_console_root+"ajax/product_template.php?mod=proLinkTagIdChoose&product_id="+product_id, async : false, success : function(response){ } }); window.setTimeout(function(){ window.location = redirectPath; }); } } //*********************************** Product Category ********************** // Catagory Product Tag Modal function viewCategoryTagProduct(mainCate,subCate) { var options = { url: main_console_root+"modal/product_detail_modal.php?modeType=CategoryTagProduct&mainCate="+mainCate+'&subCate='+subCate, title :'Tag Product Details', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function proCategoryTagIdChoose(category_id) { if(category_id !='') { var redirectPath = getRedirectUrlJs('MAIN_CONSOLE_ROOT','module/product/product_category_tag'); $.ajax({ type: "GET", url : main_console_root+"ajax/product_template.php?mod=proCategoryTagIdChoose&category_id="+category_id, async : false, success : function(response){ } }); window.setTimeout(function(){ window.location = redirectPath; }); } } function productCategoryImageRemove(category_id) { var result = ''; if(category_id !='') { $.ajax({ type : "GET", url : main_console_root+"ajax/product_template.php?mod=delCategoryImage&category_id="+category_id, async : false, success:function(result) { if(result > 0) { var alertMSG = "success@@@@Category Image Remove Successfully"; getDisplayAlertMsg(alertMSG); } else { var alertMSG = "warning@@@@"+result; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } function viewCategoryImageDenyReason(category_id) { var options = { url: main_superadmin_root+"modal/approval_deny_modal.php?modeType=ViewCategoryImageDeny&category_id="+category_id, title :'Category Deny Reason', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } //*********************************** Essential Product ********************** // Essential Product Tag Modal function viewEssentialTagProduct(essential_id) { console.log(main_console_root+"modal/product_detail_modal.php?modeType=EssentialTagProduct&essential_id="+essential_id); var options = { url: main_console_root+"modal/product_detail_modal.php?modeType=EssentialTagProduct&essential_id="+essential_id, title :'Essential Product Details', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function essentialProTagIdChoose(essential_id) { if(essential_id !='') { console.log(main_console_root+"ajax/product_template.php?mod=essentialProTagIdChoose&essential_id="+essential_id); var redirectPath = getRedirectUrlJs('MAIN_CONSOLE_ROOT','module/product/essential_product_tag'); $.ajax({ type: "GET", url : main_console_root+"ajax/product_template.php?mod=essentialProTagIdChoose&essential_id="+essential_id, async : false, success : function(response){ } }); window.setTimeout(function(){ window.location = redirectPath; }); } } function viewCouponDetail(coupon_id,store_id) { if(store_id === undefined) { store_id = ''; } var options = { url: main_console_root+"modal/product_detail_modal.php?modeType=ViewCouponDetail&coupon_id="+coupon_id+'&store_id='+store_id, title :'Coupon Detail', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } // ********************** Import/ Export File ********************** // Get the Product List For Discount tag function getExportDownloadFilter(fileTypeName) { if (fileTypeName === undefined) { fileTypeName = ''; } if(fileTypeName !='') { $.ajax({ type : "GET", url : main_console_root+"ajax/import_export_detail.php?mod=exportDownloadFilter&fileTypeName="+fileTypeName, async : false, success:function(response) { $('#filterListDiv').html(response); } }); } } function updateProductCloudinaryImagePath(imageType,image_id) { if(image_id !='' ) { var dataArr = '&imageType='+imageType+'&image_id='+image_id console.log(main_console_root+"ajax/product_template.php?mod=updateProductCloudinaryImagePath"+dataArr); $.ajax({ type : "GET", url : main_console_root+"ajax/viewProductDetail.php?mod=updateProductCloudinaryImagePath"+dataArr, global: false, async : false, success:function() { var alertMSG = "success@@@@"+"Cloudinary Image Updated Successfully"; getDisplayAlertMsg(alertMSG); } }); window.open(main_console_root+"ajax/product_template.php?mod=updateProductCloudinaryImagePath"+dataArr, "_blank"); window.setTimeout(function(){ location.reload(); }, 1000); } }// JavaScript Document // ********************** Customer ********************** // Get Customer Name function getCustomerName(customer_id) { var customer_name = ''; $.ajax({ type : "GET", url : main_console_root+"ajax/customer_detail.php?mod=customerName&customer_id="+customer_id, async : false, success:function(result) { customer_name = result; } }); return customer_name } // Customer Details Modal function viewCustomerDetails(customer_id) { var customer_name = getCustomerName(customer_id); var options = { url: main_console_root+"modal/customer_detail_modal.php?modeType=CustomerDetails&customer_id="+customer_id, title :'Customer Details : '+ customer_name, size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function customerLoginMapView(customer_id) { var customer_name = getCustomerName(customer_id); var options = { url: main_console_root+"modal/customer_detail_modal.php?modeType=CustomeLoginMapView&customer_id="+customer_id, title :'Customer Login Map View: '+customer_name , size: eModal.size.lgs, buttons: [{text: 'Close', style: 'default ', close: true }], }; return eModal.ajax(options); } // ************************* Customer Communicatio Modal ****************** // All Selected Customer Communication Modal function allCustomerCommunicationModal() { var listArr = new Array(); var i=0; $.each($("input[name='chk']:checked"), function() { var id = $(this).val(); listArr[i] = id; i++; }); if(listArr.length >0 ) { var options = { url: main_console_root+"modal/customer_detail_modal.php?modeType=CustomerCommunicationModal&customerIdList="+listArr, title :'Customer Communication', size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true }], }; return eModal.ajax(options); } else { var alertMSG = "warning@@@@"+"Please Select the Checkbox"; getDisplayAlertMsg(alertMSG); } } // Store Communication Modal function viewCustomerCommunicatinModal(customer_id) { var customer_name = getCustomerName(customer_id); var options = { url: main_console_root+"modal/customer_detail_modal.php?modeType=CustomerCommunicationModal&customerIdList="+customer_id, title :'Customer Communication : '+customer_name, size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } //Customer Communication Modal Validate function validateCustomreCommunication(modeType) { var counter = 1; var dataArr = ''; if(modeType == 'Email') { var customer_id = $("#sendEmailForm #customer_id").val(); var emailSubject = $("#sendEmailForm #emailSubject").val(); var emailDesc = $("#sendEmailForm #emailDesc").val(); if(emailSubject == ""){ $("#sendEmailForm #emailSubject").addClass("field-error"); counter = 0; } if(emailDesc == "") { $("#sendEmailForm #emailDesc").addClass("field-error"); counter = 0; } var dataArr = 'mod=SendCustomerEmail&customerIdList='+customer_id+'&emailSubject='+emailSubject+'&emailDesc='+emailDesc; } else if(modeType == 'Sms') { var customer_id = $("#sendSmsForm #customer_id").val(); var smsDesc = $("#sendSmsForm #smsDesc").val(); if(smsDesc == ""){ $("#sendSmsForm #smsDesc").addClass("field-error"); counter = 0; } var dataArr = 'mod=SendCustomerSms&customerIdList='+customer_id+'&smsDesc='+smsDesc; } else if(modeType == 'Notify') { var customer_id = $("#sendNotifyForm #customer_id").val(); var notifyTitle = $("#sendNotifyForm #notifyTitle").val(); var notifyDesc = $("#sendNotifyForm #notifyDesc").val(); var imageSend = $('input[name=imageSend]:checked', '#sendNotifyForm').val(); if(notifyTitle == ""){ $("#sendNotifyForm #notifyTitle").addClass("field-error"); counter = 0; } if(notifyDesc == "") { $("#sendNotifyForm #notifyDesc").addClass("field-error"); counter = 0; } if(imageSend === undefined) { imageSend = "None";} var dataArr = 'mod=SendCustomerNotify&customerIdList='+customer_id+'¬ifyTitle='+notifyTitle+'¬ifyDesc='+notifyDesc+'&imageSend='+imageSend; } if(counter == 0) { return false; } else { $.ajax({ type : "GET", url : main_console_root+"ajax/customer_detail.php?"+dataArr, async : false, success:function(result) { var resultArr = result.split('@@@@'); if(resultArr[0] > 0) { eModal.close(); var alertMSG = "success@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } else { eModal.close(); var alertMSG = "warning@@@@"+resultArr[1]; getDisplayAlertMsg(alertMSG); } } }); window.setTimeout(function(){ location.reload(); }, 1000); } } // ********************** Customer Event ********************** // Get Customer Event Detail function getCustomerEventTitle(event_id) { var event_title = ''; $.ajax({ type : "GET", url : main_console_root+"ajax/customer_detail.php?mod=customerEventTitle&event_id="+event_id, async : false, success:function(result) { event_title = result; } }); return event_title } // Customer Details Modal function viewCustomerEventDetail(event_id) { var event_title = getCustomerEventTitle(event_id); var options = { url: main_console_root+"modal/customer_detail_modal.php?modeType=CustomerEventDetail&event_id="+event_id, title :'Customer Event Details : '+ event_title, size: eModal.size.lgs, buttons: [ {text: 'Close', style: 'default ', close: true } ], }; return eModal.ajax(options); } function customerEventMapView(event_id) { var event_title = getCustomerEventTitle(event_id); var options = { url: main_console_root+"modal/customer_detail_modal.php?modeType=CustomeEventMapView&event_id="+event_id, title :'Event Map View: '+event_title , size: eModal.size.lgs, buttons: [{text: 'Close', style: 'default ', close: true }], }; return eModal.ajax(options); }// JavaScript Document function viewOrderDetails(order_id) { var redirectPath = getRedirectUrlJs('MAIN_CONSOLE_ROOT','module/order/order_detail'); $.ajax({ type: "GET", url : main_console_root+"ajax/order_detail.php?mod=changeViewOrderId&order_id="+order_id, async : false, success : function(response){ } }); window.setTimeout(function(){ window.location = redirectPath; }); } function orderAddressMapView(order_id) { var options = { url: main_console_root+"modal/order_detail_modal.php?modeType=orderAddressMapView&order_id="+order_id, title :'Order Address Map View' , size: eModal.size.lgs, buttons: [{text: 'Close', style: 'default ', close: true }], }; return eModal.ajax(options); } function viewReturnOrderDetails(return_id) { var redirectPath = getRedirectUrlJs('MAIN_CONSOLE_ROOT','module/order_return/order_return_detail'); $.ajax({ type: "GET", url : main_console_root+"ajax/order_detail.php?mod=changeViewReturnOrderId&return_id="+return_id, async : false, success : function(response){ } }); window.setTimeout(function(){ window.location = redirectPath; }); } function returnOrderAddressMapView(return_id) { var options = { url: main_console_root+"modal/order_detail_modal.php?modeType=returnOrderAddressMapView&return_id="+return_id, title :'Return Order Address Map View' , size: eModal.size.lgs, buttons: [{text: 'Close', style: 'default ', close: true }], }; return eModal.ajax(options); }
Fatal error: Uncaught Error: Call to undefined function include123() in /home/coinshopview/v4.shopview.co.in/include/allScriptFile.php:13 Stack trace: #0 {main} thrown in /home/coinshopview/v4.shopview.co.in/include/allScriptFile.php on line 13