// 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];
$.gritter.add({
title : msg_color,
text : msg_content,
sticky: false
});
}
// Display the Browse Images
function displayBrowseImage(divBrowseId,fieldName)
{
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(divBrowseId,fieldName)
{
var input = document.getElementById(fieldName);
var dvPreview = $("#"+divBrowseId);
dvPreview.html("");
var regex = /^([a-zA-Z0-9 \s_\\.\-\(\):])+(.xls|.xlsx|.csv)$/;
var iconArr = {'xls':'icon_xls.png','xlsx':'icon_xlsx.png','csv':'icon_csv.png'};
for (var i=0; i");
img.attr("style", "height:100px;width: 100px;padding: 5px;");
img.attr("src", iconPath);
dvPreview.append(img);
}
reader.readAsDataURL(input.files[i]);
}
else
{
var alertMSG = "warning@@@@"+name + " is not a valid 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 += '
';
eModal.alert(message, title);
}
// ********************** 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)
{
console.log(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';
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)
{
//console.log(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';
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';
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
console.log(main_console_root+"ajax/approval_records.php?status=2"+dataArr);
$.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);
}
}
//Get the Active State List of Country
function getActiveStateList(country_id)
{
if(country_id =='All') { 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 = '';
getActiveDistrictList(state_id);
}
function getActiveDistrictList(state_id)
{
if(state_id =='All') { state_id = '';}
$.ajax({
type: "GET",
url : main_console_root+"ajax/getDropDownOption.php?id="+state_id+'&mod=districtList',
async : false,
success : function(response){
$('#districtdiv').html(response);
}
});
var district_id = '';
getActivCityList(district_id);
}
function getActivCityList(district_id)
{
if(district_id =='All') { district_id = '';}
$.ajax({
type: "GET",
url : main_console_root+"ajax/getDropDownOption.php?id="+district_id+'&mod=cityList',
async : false,
success : function(response)
{
$('#cityDiv').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;
}
//*************************** 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,divPlaceWholesalerId)
{
$.ajax({
type: "GET",
url : main_console_root+"ajax/comm_template.php?mod=ParameterDropDownList&groupName="+groupName,
async : false,
success : function(response){
$('#'+divPlaceWholesalerId).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);
}
});
}
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);
}
}
//*************************** 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);
}
//*************************** Image Slider ***************************
function updateSliderCloudinaryImagePath(slider_id)
{
if(slider_id !='' )
{
var dataArr = '&slider_id='+slider_id
console.log(main_console_root+"ajax/admin_detail.php?mod=updateSliderCloudinaryImagePath"+dataArr);
$.ajax({
type : "GET",
url : main_console_root+"ajax/admin_detail.php?mod=updateSliderCloudinaryImagePath"+dataArr,
global: false,
async : false,
success:function(result)
{
var alertMSG = "success@@@@"+"Cloudinary Image Updated Successfully";
getDisplayAlertMsg(alertMSG);
}
});
window.setTimeout(function(){ location.reload(); }, 1000);
}
}
Fatal error: Uncaught Error: Call to undefined function include123() in /home/liqware/cellar.liqware.com/include/allScriptFile.php:5
Stack trace:
#0 {main}
thrown in /home/liqware/cellar.liqware.com/include/allScriptFile.php on line 5