';
if( 1==1 )
{
msg += '
';
msg += '';
msg += '
';
msg += '
';
msg += '';
msg += '
';
msg += '
';
msg += '" ;="" var="" manadatryarr="new" array('no','yes');="" $.each(manadatryarr,="" function(key,="" value)="" {="" +value+'"="">'+value+'';
});
msg += '';
msg += '
';
msg += '
';
msg += '" ;="" }="" $("#fielddatadiv").append(msg);="" $(".form-control").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);
}
}
//*********************************** 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;
}
//*********************************** Redirect To Add Product Form **********************
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?template_id="+template_id+'&mod=proTemplateChoose',
async : false,
success : function(response){ }
});
window.setTimeout(function(){ window.location = redirectPath; });
}
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?product_id="+product_id+'&mod=imageProductChoose',
async : false,
success : function(response){ }
});
window.setTimeout(function(){ window.location = redirectPath; });
}
// Change the Product Form
function changeProductForm()
{
var redirectPath = getRedirectUrlJs('MAIN_CONSOLE_ROOT','module/product/product_add');
$.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 Product Name
function getProductName(product_id)
{
var product_name = '';
if(product_id !='')
{
$.ajax({
type: "GET",
url : main_console_root+"ajax/product_template.php?product_id="+product_id+'&mod=getProductName',
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);
}
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+' #autoSuggestNameList').hide();
}
else
{
$('#'+formName+' #autoSuggestNameList').show();
$('#'+formName+' #autoSuggestNameList').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+' #autoSuggestNameList').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+' #autoSuggestBrandList').hide();
}
else
{
$('#'+formName+' #autoSuggestBrandList').show();
$('#'+formName+' #autoSuggestBrandList').html(response);
}
}
});
}
else { $('#'+formName+' #autoSuggestBrandList').hide(); }
}
// Select the Item Brand on Auto Suggestion List
function selAutoSuggestBrand(proBrand,form_name)
{
// hide proposition list
$('#'+form_name+' #autoSuggestBrandList').hide();
// fill the Barcode
$('#'+form_name+' #proBrand').val(proBrand);
}
//*********************************** 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_tag');
$.ajax({
type: "GET",
url : main_console_root+"ajax/product_template.php?category_id="+category_id+'&mod=proCategoryTagIdChoose',
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);
}
}
//*********************************** Product Tax Class Tag **********************
// Catagory Product Tag Modal
function viewTaxTagProduct(tax_id)
{
var options = {
url: main_console_root+"modal/product_detail_modal.php?modeType=TaxClassTagProduct&tax_id="+tax_id,
title :'Tag Product Details',
size: eModal.size.lgs,
buttons: [
{text: 'Close', style: 'default ', close: true }
],
};
return eModal.ajax(options);
}
function proTaxTagIdChoose(tax_id)
{
if(tax_id !='')
{
var redirectPath = getRedirectUrlJs('MAIN_CONSOLE_ROOT','module/product/product_tax_tag');
$.ajax({
type: "GET",
url : main_console_root+"ajax/product_template.php?mod=proTaxClassTagIdChoose&tax_id="+tax_id,
async : false,
success : function(response){ }
});
window.setTimeout(function(){ window.location = redirectPath; });
}
}
// ********************** 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);
}
});
}
}
//*************************** Category Image **************************
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);
}
//*************************** 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 tagBrandImage(brand_id)
{
var options = {
url: main_console_root+"modal/business_type_tagging.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);
}
});
}
}
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);
}
//*********************************** Essential Product **********************
// Essential Product Tag Modal
function viewEssentialTagProduct(businessType)
{
var options = {
url: main_console_root+"modal/product_detail_modal.php?modeType=EssentialTagProduct&businessType="+businessType,
title :'Essential Product Details',
size: eModal.size.lgs,
buttons: [
{text: 'Close', style: 'default ', close: true }
],
};
return eModal.ajax(options);
}
function essentialProTagIdChoose(businessType)
{
if(businessType !='')
{
var redirectPath = getRedirectUrlJs('MAIN_CONSOLE_ROOT','module/product/essential_product_tag');
$.ajax({
type: "GET",
url : main_console_root+"ajax/product_template.php?mod=essentialProTagIdChoose&businessType="+businessType,
async : false,
success : function(response){ }
});
window.setTimeout(function(){ window.location = redirectPath; });
}
}
// JavaScript Document
// ************************* 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 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 :'Store Details : '+store_name,
size: eModal.size.lgs,
buttons: [
{text: 'Close', style: 'default ', close: true }
],
};
return eModal.ajax(options);
}
// ************************* 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 :'Store 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 :'Store 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 Reg Approved Status ******************
function storeRegApprovedStatus(store_id)
{
var store_name = getStoreName(store_id);
var confirmMSG = 'Please click OK to approve '+store_name+' on '+PROJECT_SITE_NAME+' Portal. ';
return eModal.confirm(confirmMSG, ' '+PROJECT_SITE_NAME+' Message')
.then(function ()
{
var listArr = store_id;
var mod_action = 'StoreApproval';
$.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 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 Store 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 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 :'Store 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 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();
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(counter == 0) { return false; }
else
{
storeName = encodeURIComponent(storeName);
address = encodeURIComponent(address);
landmark = encodeURIComponent(landmark);
var dataArr = '&store_id='+store_id+'&storeName='+storeName+'&businessType='+businessType+'&ownerName='+ownerName;
dataArr += '&contactMobile='+contactMobile+'&contactEmail='+contactEmail+'&address='+address+'&landmark='+landmark;
dataArr += '&deliveryDistance='+deliveryDistance;
$.ajax({
type : "GET",
url : main_console_root+"ajax/store_detail.php?&mod=updateStoreDetail"+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 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 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 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(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('Shopos Demo Validity in Days'); 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;
//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 :'Store Offer Details',
size: eModal.size.lgs,
buttons: [
{text: 'Close', style: 'default ', close: true }
],
};
return eModal.ajax(options);
}
function uploadStoreEssentialProduct()
{
var listArr = new Array();
var i=0;
$.each($("input[name='chk']:checked"), function()
{
var id = $(this).val();
listArr[i] = id;
i++;
});
$.ajax({
type : "GET",
url : main_console_root+"ajax/store_detail.php?mod=storeEssentialProduct&storeIdList="+listArr,
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);
}// 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 Communicatio Modal ******************
function allPosCustomerCommunicationModal(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 dataArr = '&customerIdList='+listArr+'&store_id='+store_id;
var options =
{
url: main_console_root+"modal/customer_detail_modal.php?modeType=PosCustomerCommunicationModal"+dataArr,
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);
}
}
//Customer Communication Modal Validate
function validatePosCustomreCommunication(modeType)
{
var counter = 1;
var dataArr = '';
if(modeType == 'Email')
{
var store_id = $("#sendEmailForm #store_id").val();
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=SendPosCustomerEmail&store_id='+store_id+'&customerIdList='+customer_id;
dataArr += '&emailSubject='+emailSubject+'&emailDesc='+emailDesc;
}
else if(modeType == 'Sms')
{
var store_id = $("#sendSmsForm #store_id").val();
var customer_id = $("#sendSmsForm #customer_id").val();
var smsDesc = $("#sendSmsForm #smsDesc").val();
if(smsDesc == ""){ $("#sendSmsForm #smsDesc").addClass("field-error"); counter = 0; }
var dataArr = 'mod=SendPosCustomerSms&store_id='+store_id+'&customerIdList='+customer_id+'&smsDesc='+smsDesc;
}
if(counter == 0) { return false; }
else
{
//alert(main_console_root+"ajax/customer_detail.php?"+dataArr);
$.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);
}