');
setTimeout(function(){ window.location.href = basePath+"dashboard"; }, 3000);
}
else
{
setTimeout(function(){ window.location.href = redirecurl; }, 3000);
$('#loginfrm').html('
Please Wait, We Are Directing To Member Profile,
');
}
return false;
}
setTimeout(function(){ $('#loginmsgloader').html(''); }, 2000);
},
});
}
return false;
}
function forgetpassword(basePath)
{
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var email = $('#usremail').val();
var thisvalue = $('#usremail').val();
if (thisvalue == "") {
$('#usremail').css("border-color","red");
$('#usremailErr').html('Enter Your Email!');
error = 1;
}
var thisvalue = $('#usremail').val();
if (!email_pattern_match.test($('#usremail').val()) && thisvalue != "") {
$('#usremail').css("border-color","red");
$('#usremailErr').html('Invalid Email Format!');
error = 1;
}
if(error!=1)
{
$.ajax({
type: "POST",
url: basePath+'ajax/forgetpassword',
data: {'email':email},
beforeSend: function() {
// setting a timeout
$('#forgetloader').html('
');
$('input:text').val('');
},
success: function(result){
if(result=='error' && result!="")
{
$('#forgetloader').html('
Email Id not registered!
');
}
else
{
$('#forgetloader').html('
We Have Sent An Email, Please Check Your Inbox Of Registered Email!
');
}
//setTimeout(function(){ $('#forgetloader').html(''); }, 4000);
},
});
}
return false;
}
function updateprofimage(basePath)
{
var fd = new FormData($('#profimgfrm')[0]);
$.ajax({
url: basePath+'ajax/updateprofimage',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
$('#profimgmsgloader').html('
');
},
success: function(result){
//alert(data);
if(result=='success' && result!="")
{
$('#profimgmsgloader').html('
Profile Image Udpated Successfully!
');
}
else if(result=='fail' && result!="")
{
$('#profimgmsgloader').html('
Something Went Wrong, Please Try Again Later!
');
}
setTimeout(function(){ $('#profimgmsgloader').html(''); location.reload(); }, 3000);
}
});
return false;
}
function myprofileupdate(baseurl)
{
var error = "";
/*
var thisvalue = $('#name').val();
if (thisvalue == "") {
$('#name').css("border-color","red");
error = 1;
}
var thisvalue = $('#phone').val();
if (thisvalue == "") {
$('#phone').css("border-color","red");
error = 1;
}
var thisvalue = $('#aboutinfo').val();
if (thisvalue == "") {
$('#aboutinfo').css("border-color","red");
error = 1;
}
*/
if(error!=1)
{
var fd = new FormData($('#myprofileupdatefrm')[0]);
$.ajax({
type: "POST",
url: baseurl+'ajax/myprofileupdate',
data: fd,
contentType: false,
cache: false,
processData:false,
beforeSend: function() {
$('#profilemsgloader').html('
');
},
success: function(result){
if(result=='error' && result!="")
{
$('#profilemsgloader').html('
Something went wrong please try again later!
');
}
else
{
$('#profilemsgloader').html('
Info. Updated Successfully!
');
}
setTimeout(function(){ $('#profilemsgloader').html(''); location.reload(); }, 4000);
},
});
}
return false;
}
function changepassword(baseurl)
{
error = '';
var thisvalue = $('#oldpassword').val();
if (thisvalue == "") {
$('#oldpassword').css("border-color","red");
$('#oldpasswordErr').html('Enter Old Password!');
error = 1;
}
var thisvalue = $('#newpassword').val();
if (thisvalue == "") {
$('#newpassword').css("border-color","red");
$('#newpasswordErr').html('Enter New Password!');
error = 1;
}
var thisvalue = $('#confpassword').val();
if (thisvalue == "") {
$('#confpassword').css("border-color","red");
$('#confpasswordErr').html('Enter Confirm Password!');
error = 1;
}
var thisvalue = $('#confpassword').val();
if (thisvalue != $('#newpassword').val() && $('#confpassword').val()!="") {
$('#confpassword').css("border-color","red");
$('#confpasswordErr').html('Enter Confirm Password!');
error = 1;
}
if(error!=1)
{
$.ajax({
type: "POST",
url: baseurl+'ajax/changepassword',
data: $('#changepasswordfrm').serialize(),
beforeSend: function() {
$('#passwordloader').html('
Please Wait...
');
},
success: function(result){
if(result=='exist' && result!="")
{
$('#passwordloader').html('
Invalid Old Password!
');
}
else
{
$('#passwordloader').html('
Password. Updated Successfully!
');
}
setTimeout(function(){ $('#passwordloader').html(''); }, 4000);
},
});
}
return false;
}
function setstarRating(rating,obj)
{
$('#'+obj).val(rating);
var starVal = '';
for(i=1; i<=5; i++)
{
var starClass = 'fa-star-o';
if(i<=rating)
{
var starClass = 'fa-star';
}
starVal += '
';
}
$('#'+obj+'_bx').html(starVal);
}
function hideshowBox(obj)
{
if($('#'+obj+'btn').html()=='+')
{
$('#'+obj+'btn').html('-');
$('#'+obj+'bx').show('slow');
}
else
{
$('#'+obj+'btn').html('+');
$('#'+obj+'bx').hide('slow');
}
}
function passwordview(inputid) {
var x = document.getElementById(inputid);
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
$(".toggle-password").click(function() {
$(this).toggleClass("fa-eye fa-eye-slash");
});
function checkusername(basePath)
{
var error = "";
var profilename = $('#profilename').val();
if (profilename == "")
{
error = 1;
}
if(error!=1)
{
$.ajax({
url: basePath+"ajax/checkusername",
data: {'profilename':profilename},
type: "post",
beforeSend: function() {
$('#suggestionbox').html('
');
},
success: function(result){
if(result!="")
{
$('#suggestionbox').html(result);
$("#profilename").val('');
}
else
{
$('#suggestionbox').html('');
}
}
});
}
return false;
}
function filterSearch (basePath)
{
var keyword = $('#search').val();
var fd = new FormData($('#filterfrm')[0]);
$.ajax({
url: basePath+'ajax/filterSearch',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
$('.listdata').html('
');
},
success: function(data)
{
result = data.trim();
if(result!="")
{
$('.listdata').html(result);
}
else
{
$('.listdata').html('
No result found!
');
}
}
});
}
$("input").focus(function(){
var id=this.id;
$("#"+id+"Err").html('');
$("#"+id).css('border','1px solid #ccc');
});
$("select").focus(function(){
var id=this.id;
$("#"+id+"Err").html('');
$("#"+id).css('border','1px solid #ccc');
});
$("textarea").focus(function(){
var id=this.id;
$("#"+id+"Err").html('');
$("#"+id).css('border','1px solid #ccc');
});
$('input[name="email_id"]').change(function(e) {
var name = $('#name').val();
var basePath = $('#basePath').val();
if($('#name').val()=="" || $('#name').val() == null)
{
var name = $('#name').val();
}
var email = $(this).val();
if (email != '') {
$.ajax({
type: "POST",
url: basePath+"ajax/clickenquiry",
data: {
name : name,
email: email
},
success: function(data) {
//alert(data);
}
});
}
});
$('input[name="email"]').change(function(e) {
var name = $('#name').val();
var basePath = $('#basePath').val();
if($('#name').val()=="" || $('#name').val() == null)
{
var name = $('#name').val();
}
var email = $(this).val();
if (email != '') {
$.ajax({
type: "POST",
url: basePath+"ajax/clickenquiry",
data: {
name : name,
email: email
},
success: function(data) {
//alert(data);
}
});
}
});
$('input[name="send_email_id3"]').change(function(e) {
var name = $('#send_name3').val();
var basePath = $('#basePath').val();
if($('#name').val()=="" || $('#name').val() == null)
{
var name = $('#name').val();
}
var email = $(this).val();
if (email != '') {
$.ajax({
type: "POST",
url: basePath+"ajax/clickenquiry",
data: {
name : name,
email: email
},
success: function(data) {
//alert(data);
}
});
}
});
$('input[name="send_email_id"]').change(function(e) {
var name = $('#send_name').val();
var basePath = $('#basePath').val();
if($('#name').val()=="" || $('#name').val() == null)
{
var name = $('#name').val();
}
var email = $(this).val();
if (email != '') {
$.ajax({
type: "POST",
url: basePath+"ajax/clickenquiry",
data: {
name : name,
email: email
},
success: function(data) {
//alert(data);
}
});
}
});
$('input[name="secured_payment_email"]').change(function(e) {
var name = $('#secured_payment_name').val();
var basePath = $('#basePath').val();
if($('#secured_payment_name').val()=="" || $('#secured_payment_name').val() == null)
{
var name = $('#secured_payment_name').val();
}
var email = $(this).val();
if (email != '') {
$.ajax({
type: "POST",
url: basePath+"ajax/clickenquiry",
data: {
name : name,
email: email
},
success: function(data) {
//alert(data);
}
});
}
});
$('input[name="phone_no"]').change(function(e) {
var name = $('#name').val();
var email = $('#email_id').val();
var phone = $(this).val();
if (phone != '') {
$.ajax({
type: "POST",
url: basePath+"ajax/clickenquiry",
data: {
name : name,
email: email,
phone: phone
},
success: function(data) {
//alert(data);
}
});
}
});
/* $('input[name="phone"]').change(function(e) {
var name = $('#name').val();
var email = $('#email').val();
var phone = $(this).val();
if (phone != '') {
$.ajax({
type: "POST",
url: basePath+"ajax/clickenquiry",
data: {
name : name,
email: email,
phone: phone
},
success: function(data) {
//alert(data);
}
});
}
});*/
$('input[name="phoneno"]').change(function(e) {
var name = $('#name').val();
var email = $('#email').val();
var phone = $(this).val();
if (phone != '') {
$.ajax({
type: "POST",
url: basePath+"ajax/clickenquiry",
data: {
name : name,
email: email,
phone: phone
},
success: function(data) {
//alert(data);
}
});
}
});
function validateenqfrm(basePath){
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var phone_pattern_match = /^[0-9]+$/;
var str1 = document.getElementById('txtCaptcha').value;
var str2 = document.getElementById('captcha').value;
var URL_pattern = /(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?/gi;
var thisvalue = $('#name').val();
if (thisvalue == "") {
$('#name').css("border-color","red");
$('#nameErr').html('Enter Name!');
error = 1;
}
var thisvalue = $('#email').val();
if (thisvalue == "") {
$('#email').css("border-color","red");
$('#emailErr').html('Enter Your Email!');
error = 1;
}
if (!email_pattern_match.test($('#email').val()) && thisvalue!="") {
$('#email').css("border-color","red");
$('#emailErr').html('Invalid Email Format!');
error = 1;
}
var thisvalue = $('#phone').val();
if (thisvalue == "") {
$('#phone').css("border-color","red");
$('#phoneErr').html('Please Enter Phone!');
error = 1;
}
var thisvalue = $('#phone').val();
if (!phone_pattern_match.test($('#phone').val()) && thisvalue !="") {
$('#phone').css("border-color","red");
$('#phoneErr').html('Invalid Phone');
error = 1;
}
var thisvalue = $('#state').val();
if (thisvalue == "") {
$('#state').css("border-color","red");
error = 1;
}
var thisvalue = $('#city').val();
if (thisvalue == "") {
$('#city').css("border-color","red");
error = 1;
}
var thisvalue = $('#requirement').val();
if (thisvalue == "") {
$('#requirement').css("border-color","red");
error = 1;
}
var thisvalue = $('#requirement').val();
if (URL_pattern.test($('#requirement').val()) && thisvalue!="") {
$('#requirement').css("border-color","red");
$('#requirementErr').html('Please remove URL links');
error = 1;
}
if (str1 != str2)
{
$("#captcha").css("border-color","#e85445")
$("#captchaError").html("Captcha code did not match.")
error=1;
}
if(error!=1){
$.ajax({
type: "POST",
url: basePath+'ajax/enqfrmprocess',
data: $('#enqfrm').serialize(),
beforeSend: function() {
// setting a timeout
$('#msgloader').html('
Please Wait!
');
$('#sbmtbtn').attr('disabled',true);
},
success: function(result){
//return false;
if(result=='fail' && result!="")
{
$('#msgloader').html('
Something Went Wrong Please Try Again Later!
');
$('#sbmtbtn').removeAttr('disabled');
}
else
{
$('input:text').val('');
$('textarea').val('');
$('select').val('');
$('#msgloader').html('
Message Sent Successfully! Our team will get in touch with you shortly to discuss further details.
');
}
setTimeout(function(){ $('#msgloader').html(''); }, 5000);
},
});
}
return false;
}
function addsoftware(basePath){
for (instance in CKEDITOR.instances) {
CKEDITOR.instances[instance].updateElement();
}
var error = "";
/* var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var phone_pattern_match = /^[0-9]+$/;
var str1 = document.getElementById('txtCaptcha').value;
var str2 = document.getElementById('captcha').value;
var URL_pattern = /(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?/gi; */
var actionfrom = $('#actionfrom').val();
if(actionfrom == 'superadmin'){
var thisvalue = $('#company_names').val();
if(thisvalue == "") {
$('#company_names').css("border-color","red");
error = 1;
}
var thisvalue = $('#company_website').val();
if(thisvalue == "") {
$('#company_website').css("border-color","red");
error = 1;
}
var thisvalue = $('#company_email').val();
if(thisvalue == "") {
$('#company_email').css("border-color","red");
error = 1;
}
var thisvalue = $('#company_phone').val();
if(thisvalue == "") {
$('#company_phone').css("border-color","red");
error = 1;
}
}
var thisvalue = $('#name').val();
if (thisvalue == "") {
$('#name').css("border-color","red");
error = 1;
}
var thisvalue = $('#logo').val();
if (thisvalue == "" && ($('#softwareid').val()=='' || $('#softwareid').val()==null)) {
$('#logo').css("border-color","red");
error = 1;
}
var thisvalue = $('#tagline').val();
if (thisvalue == "") {
$('#tagline').css("border-color","red");
error = 1;
}
var thisvalue = $('#product_url').val();
if (thisvalue == "") {
$('#product_url').css("border-color","red");
error = 1;
}
var thisvalue = $('#primarycategory').val();
if (thisvalue == "") {
$('#primarycategoryErr').html("This field is required!");
//setTimeout(function(){ $('#primarycategoryErr').html(''); }, 3000);
error = 1;
}
var thisvalue = $('#secondarycategory').val();
if (thisvalue == "") {
$('#secondarycategoryErr').html("This field is required!");
//setTimeout(function(){ $('#secondarycategoryErr').html(''); }, 3000);
error = 1;
}
if($('.features:checked').length==0)
{
$('#errfeature').html('Select features');
//setTimeout(function(){ $('#errfeature').html(''); }, 3000);
error = 1;
}
if($('.features:checked').length > 30)
{
$('#errfeature').html('Select Maximum 30 features.');
//setTimeout(function(){ $('#errfeature').html(''); }, 3000);
error = 1;
}
var thisvalue = $('#competitor').val();
if (thisvalue == "") {
//$('#competitor').css("border-color","red");
$('#competitorErr').html('This field is required!');
error = 1;
}
var thisvalue = $('#summary').val();
if (thisvalue == "") {
$('#summary').css("border-color","red");
error = 1;
}
var thisvalue = $('#description').val();
if (thisvalue == "") {
$('#descriptionErr').html("This field is required!");
//setTimeout(function(){ $('#descriptionErr').html(''); }, 5000);
error = 1;
}
/* var thisvalue = $('#affiliate').val();
if (thisvalue == "") {
$('#affiliate').css("border-color","red");
error = 1;
} */
var modulename=$('#modulename').val();
//alert(modulename);
if(modulename=='update-software' && $('#plan_name1').val()=='' && $('actionfrom').val()!='superadmin')
{
if($('input[name="accessible"]:checked').length == 0) {
$('#accessibleErr').html("This field is required!");
error = 1;
}
if($('input[name="support_browser"]:checked').length == 0) {
$('#support_browserErr').html("This field is required!");
error = 1;
}
if($('input[name="free_trial"]:checked').length == 0) {
$('#free_trialErr').html("This field is required!");
error = 1;
}
if($('input[name="payment_option[]"]:checked').length == 0) {
$('#payment_optionErr').html("This field is required!");
error = 1;
}
if($('input[name="free_plan"]:checked').length == 0) {
$('#free_planErr').html("This field is required!");
error = 1;
}
if($('input[name="api_available"]:checked').length == 0) {
$('#api_availableErr').html("This field is required!");
error = 1;
}
if($('input[name="customization"]:checked').length == 0) {
$('#customizationErr').html("This field is required!");
error = 1;
}
if($('input[name="audience[]"]:checked').length == 0) {
$('#audienceErr').html("This field is required!");
error = 1;
}
if($('input[name="desktop_options[]"]:checked').length == 0) {
$('#desktop_optionsErr').html("This field is required!");
error = 1;
}
/*var thisvalue = $('#mob_app_overview').val();
if (thisvalue == "") {
$('#mob_app_overview').css("border-color","red");
$('#mob_app_overviewErr').html("This field is required!");
error = 1;
} */
if($('input[name="available_support[]"]:checked').length == 0) {
$('#available_supportErr').html("This field is required!");
error = 1;
}
}
else if(modulename=='update-software' && $('#plan_name1').val()=='' && $('actionfrom').val()!='superadmin')
{
var thisvalue = $('#plan_name1').val();
if (thisvalue == "") {
$('#plan_name1').css("border-color","red");
error = 1;
}
var thisvalue = $('#plan_price1').val();
if (thisvalue == "") {
$('#plan_price1').css("border-color","red");
error = 1;
}
var thisvalue = $('#plan_unit1').val();
if (thisvalue == "") {
$('#plan_unit1').css("border-color","red");
error = 1;
}
var thisvalue = $('input[name="plan_feature_1[]"]').val();
if (thisvalue == "") {
$('input[name="plan_feature_1[]"]').css("border-color","red");
error = 1;
}
}
/* if(actionfrom == 'superadmin'){
var thisvalue = $('#plan_name1').val();
if (thisvalue == "") {
$('#plan_name1').css("border-color","red");
error = 1;
}
var thisvalue = $('#plan_price1').val();
if (thisvalue == "") {
$('#plan_price1').css("border-color","red");
error = 1;
}
var thisvalue = $('#plan_unit1').val();
if (thisvalue == "") {
$('#plan_unit1').css("border-color","red");
error = 1;
}
var thisvalue = $('input[name="plan_feature_1[]"]').val();
if (thisvalue == "") {
$('input[name="plan_feature_1[]"]').css("border-color","red");
error = 1;
}
}
*/
/* if (str1 != str2)
{
$("#captcha").css("border-color","#e85445")
$("#captchaError").html("Captcha code did not match.")
error=1;
} */
if(error!=1){
var fd = new FormData($('#softwarefrm')[0]);
$.ajax({
url: basePath+'ajax/addsoftware',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
// setting a timeout
$('#msgloader').html('
');
//$('#sbmtbtn').attr('disabled',true);
},
success: function(result){
//return false;
if(result=='error' && result!="")
{
$('#msgloader').html('
Something Went Wrong Please Try Again Later!
');
//$('#sbmtbtn').removeAttr('disabled');
}
else
{
/* $('input:text').val('');
$('textarea').val('');
$('select').val(''); */
$('#msgloader').html('
Successfully Submitted!
');
if($('#actionfrom').val() == 'front')
{
setTimeout(function(){ window.location.href=basePath+'update-software/'+result; }, 2000);
}
if($('#actionfrom').val() == 'superadmin')
{
setTimeout(function(){ window.location.href=basePath+'siteadmin/software/edit/'+result; }, 2000);
}
/* $('html, body').animate({
scrollTop: $('body').offset().top
}, 1000); */
}
setTimeout(function(){ $('#msgloader').html(''); }, 5000);
},
});
}
else
{
/* $('html, body').animate({
scrollTop: $('body').offset().top
}, 1000); */
}
return false;
}
function getstate(basePath)
{
var country = $('#country').val();
if(country == '101')
{
$.ajax({
type: "POST",
url: basePath+'ajax/getstate',
data: {country:country},
beforeSend: function() {
$('#state').html('
Loading... ');
},
success: function(result){
$('#statesdiv').show();
$('#citydiv').show();
$('#state').html(result);
},
});
}
else
{
$('#statesdiv').hide();
$('#citydiv').hide();
return false;
}
}
function getcity(basePath)
{
var country = $('#country').val();
var state = $('#state').val();
if(country == '101' && state!='')
{
$.ajax({
type: "POST",
url: basePath+'ajax/getcity',
data: {country:country,state:state},
beforeSend: function() {
$('#city').html('
Loading... ');
},
success: function(result){
$('#citydiv').show();
$('#city').html(result);
},
});
}
else
{
$('#statesdiv').hide();
$('#citydiv').hide();
return false;
}
}
$('#addfeature').click(function(){
var featurecounter = $('#prjtcounter').val();
var featurecounter = parseInt(featurecounter) + parseInt(1);
$('#prjtcounter').val(featurecounter);
$('#othrprjtbx').append('
');
});
function delfeature(rowid,type=null,featureid=null, basePath=null)
{
if(type == 'update' && featureid!="")
{
if(!confirm('Are You Sure Want To Delete This Record!'))
{
return false;
}
var featurecounter = $('#prjtcounter').val();
var featurecounter = parseInt(featurecounter) - parseInt(1);
$('#prjtcounter').val(featurecounter);
$.ajax({
url: basePath+"ajax/removefeature",
data: {'featureid':featureid},
type: "post",
beforeSend: function() {
},
success: function(data){
//alert(data);
$('#prjtrow'+rowid).remove();
}
});
}
else
{
var prjtcounter = $('#prjtcounter').val();
var prjtcounter = parseInt(prjtcounter) - parseInt(1);
$('#prjtcounter').val(prjtcounter);
$('#prjtrow'+rowid).remove();
}
}
/*$('.primarycategory , .secondarycategory').change(function(){
var basePath = $('#basePath').val();
var primarycategory = $('.primarycategory option:selected').val();
var secondarycategory = [];
$('.secondarycategory option:selected').each(function()
{
secondarycategory.push($(this).val())
});
//alert(primarycategory+'=='+secondarycategory);
if(primarycategory!="" || secondarycategory!="")
{
$.ajax({
url: basePath+"ajax/getfeatures",
data: {'primarycategory':primarycategory,'secondarycategory':secondarycategory},
type: "post",
beforeSend: function() {
$('.featurebx').html('
');
},
success: function(data){
$('.featurebx').html(data);
}
});
}
});*/
$('#primarycategory').change(function(){
var category_id = $('#primarycategory').val();
if(category_id != '')
{
$.ajax({
url:"https://www.chanakyasoftware.com/catalog/fetch_subcategory",
method:"POST",
data:{category_id:category_id},
success:function(data)
{
$('#secondarycategory').html(data);
}
});
}
else
{
$('#secondarycategory').html('
Select Subcategory ');
}
});
$('.secondarycategory').change(function(){
var basePath = $('#basePath').val();
var primarycategory = $('.primarycategory option:selected').val();
var secondarycategory = [];
$('.secondarycategory option:selected').each(function()
{
secondarycategory.push($(this).val())
});
//alert(primarycategory+'=='+secondarycategory);
if(secondarycategory!="")
{
$.ajax({
url: basePath+"ajax/getfeatures",
data: {'primarycategory':primarycategory,'secondarycategory':secondarycategory},
type: "post",
beforeSend: function() {
$('.featurebx').html('
');
},
success: function(data){
$('.featurebx').html(data);
}
});
}
});
function removesftwrimg(basePath,id,type,rowbx,imgname)
{
if(id>0)
{
if(!confirm('Are You Sure Want To Delete This Record!'))
{
return false;
}
$.ajax({
url: basePath+"ajax/removesftwrimg",
data: {'id':id, 'imgname':imgname, 'type':type},
type: "post",
beforeSend: function() {
$('.'+rowbx).html('
');
},
success: function(data){
//alert(data);
$('.'+rowbx).remove();
}
});
}
}
function removesrvwrimg(basePath,id,type,rowbx,imgname)
{
if(id>0)
{
if(!confirm('Are You Sure Want To Delete This Record!'))
{
return false;
}
$.ajax({
url: basePath+"ajax/removesrvwrimg",
data: {'id':id, 'imgname':imgname, 'type':type},
type: "post",
beforeSend: function() {
$('.'+rowbx).html('
');
},
success: function(data){
//alert(data);
$('.'+rowbx).remove();
}
});
}
}
$(function () {
$("#webapp").click(function () {
if ($(this).is(":checked")) {
$("#dvPassport").show();
} else {
$("#dvPassport").hide();
$("#webapp_val").val('');
}
});
$("#mobile_option_ios").click(function () {
if ($(this).is(":checked"))
{
$(".mobile_option_iosbx").show();
} else {
$(".mobile_option_iosbx").hide();
}
});
$("#mobile_option_ios_android").click(function () {
if ($(this).is(":checked"))
{
$(".mobile_option_androidbx").show();
} else {
$(".mobile_option_androidbx").hide();
}
});
});
$('.extra-fields-customer').click(function() {
$('.customer_records_dynamic').append('
');
});
$('.extra-fields-customer2').click(function() {
$('.customer_records_dynamic2').append('
');
});
$('.extra-fields-customer3').click(function() {
$('.customer_records_dynamic3').append('
');
});
$('.extra-fields-customer4').click(function() {
$('.customer_records_dynamic4').append('
');
});
$('.extra-fields-customer5').click(function() {
$('.customer_records_dynamic5').append('
');
});
$('.extra-fields-customer6').click(function() {
$('.customer_records_dynamic6').append('
');
});
$('.extra-fields-customer7').click(function() {
$('.customer_records_dynamic7').append('
');
});
$('.extra-fields-customer8').click(function() {
$('.customer_records_dynamic8').append('
');
});
$('.extra-fields-customer9').click(function() {
$('.customer_records_dynamic9').append('
');
});
$('.extra-fields-customer11').click(function() {
var type_services = $('.type_services1').html();
$('.customer_records_dynamic11').append('
');
});
$('.extra-fields-customer12').click(function() {
var industry_type = $('.industry_type1').html();
$('.customer_records_dynamic12').append('
');
});
$('.extra-fields-customer13').click(function() {
$('.customer_records_dynamic13').append('
');
});
$('.extra-fields-customer23').click(function() {
$('.customer_records_dynamic23').append('
');
});
$('.extra-fields-customer93').click(function() {
$('.customer_records_dynamic93').append('
');
});
$('.extra-fields-customer10').click(function() {
$('.customer_records_dynamic10').append('
');
});
$('.extra-fields-customer14').click(function() {
$('.customer_records_dynamic14').append('
');
});
$(document).on('keyup', '.focusfieldservices', function(e) {
//alert('hi');
var sum = 0;
$('.focusfieldservices').each(function() {
sum += Number($(this).val());
});
$('#totalpercentservices').html(sum);
if(sum>100)
{
$('#totalpercentservices').css('color','#f00');
$('#totalpercentservicesErr').html('Sum of the percentage can not be greater than 100');
//$('.btn-primary').attr('disabled',true);
}
else if(sum==100)
{
$('#totalpercentservices').css('color','#26c826');
$('#totalpercentservicesErr').html('');
//$('.btn-primary').removeAttr('disabled');
}
else
{
$('#totalpercentservices').css('color','#000');
$('#totalpercentservicesErr').html('Sum of the percentage entered should be 100');
}
});
$(document).on('keyup', '.focusfieldsindustry', function(e) {
//alert('hi');
var sum = 0;
$('.focusfieldsindustry').each(function() {
sum += Number($(this).val());
});
$('#totalpercentindustry').html(sum);
if(sum>100)
{
$('#totalpercentindustry').css('color','#f00');
$('#totalpercentindustryErr').html('Sum of the percentage can not be greater than 100');
//$('.btn-primary').attr('disabled',true);
}
else if(sum==100)
{
$('#totalpercentindustry').css('color','#26c826');
$('#totalpercentindustryErr').html('');
//$('.btn-primary').removeAttr('disabled');
}
else
{
$('#totalpercentindustry').css('color','#000');
$('#totalpercentindustryErr').html('Sum of the percentage entered should be 100');
}
});
$(document).on('click', '.remove-field', function(e) {
$(this).parent('.remove').remove();
e.preventDefault();
});
$(document).on('click', '.service_provided', function(e) {
var parentid = $(this).data('srvid');
if(parentid>0)
{
var basePath = $('#basePath').val();
$.ajax({
url: basePath+"ajax/getservicetypefocusfield",
data: {'parentid':parentid},
type: "post",
beforeSend: function() {
$('.srvfieldbx').html('
');
},
success: function(data){
//alert(data);
$('.srvfieldbx').html(data);
$('#totalpercent').html('0');
$(document).on('keypress', '.numfg', function(e) {
keys = ['0','1','2','3','4','5','6','7','8','9','.']
return keys.indexOf(event.key) > -1
});
$(document).on('keyup', '.focusfield', function(e) {
//alert($(this).data('focusfield'));
var sum = 0;
$('.focusfield').each(function() {
sum += Number($(this).val());
});
$('#totalpercent').html(sum);
if(sum>100)
{
$('#totalpercent').css('color','#f00');
$('#totalpercentserviceprovidedErr').html('Sum of the percentage can not be greater than 100');
}
else if(sum==100)
{
$('#totalpercent').css('color','#26c826');
$('#totalpercentserviceprovidedErr').html('');
}
else
{
$('#totalpercent').css('color','#000');
$('#totalpercentserviceprovidedErr').html('Sum of the percentage entered should be 100');
}
});
}
});
}
});
$(document).on('click', '.service_feature_add_btn', function(e)
{
var service_provided = $('.service_provided:checked').val();
var sum = 0;
var tblstr = '';
$('.focusfield').each(function() {
sum += Number($(this).val());
if(sum>100)
{
$('#totalpercent').css('color','#f00');
}
if($(this).val()!="")
{
fieldtitle = $(this).data('focusfieldtitle');
tblstr = tblstr+'
'+service_provided+' '+fieldtitle+' '+$(this).val()+' ';
}
});
if(sum>100)
{
tblstr ='';
$('#totalpercent').css('color','#f00');
$('#srv_type_loader').html('
Sum can\'t be greater than 100!
');
}
else if(sum==100)
{
$('#totalpercent').css('color','#26c826');
}
else
{
tblstr ='';
$('#totalpercent').css('color','#000');
$('#srv_type_loader').html('
Sum can\'t be less than 100!
');
}
$('#totalpercent').html(sum);
$('.service_data_tbody').html(tblstr);
setTimeout(function(){
$('#srv_type_loader').html('');
}, 3000);
});
function addservice(basePath){
for (instance in CKEDITOR.instances) {
CKEDITOR.instances[instance].updateElement();
}
var error = "";
/* var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var phone_pattern_match = /^[0-9]+$/;
var str1 = document.getElementById('txtCaptcha').value;
var str2 = document.getElementById('captcha').value;
var URL_pattern = /(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?/gi; */
var thisvalue = $('#service_industry').val();
if (thisvalue == "") {
$('#service_industry').css("border-color","red");
error = 1;
}
var thisvalue = $('#company_logo').val();
if (thisvalue == "" && ($('#serviceid').val()=='' || $('#serviceid').val()==null)) {
$('#company_logo').css("border-color","red");
error = 1;
}
var thisvalue = $('#hourly_rate').val();
if (thisvalue == "") {
$('#hourly_rate').css("border-color","red");
error = 1;
}
var thisvalue = $('#company_type').val();
if (thisvalue == "") {
$('#company_type').css("border-color","red");
error = 1;
}
var thisvalue = $('#serviceusers').val();
if (thisvalue == "") {
$('#serviceusersErr').html("
This field is required! ");
setTimeout(function(){ $('#serviceusersErr').html(''); }, 2000);
error = 1;
}
var thisvalue = $('#annualrevenue').val();
if (thisvalue == "") {
$('#annualrevenue').css("border-color","red");
error = 1;
}
var thisvalue = $('#project_size').val();
if (thisvalue == "") {
$('#project_size').css("border-color","red");
error = 1;
}
var thisvalue = $('#country').val();
if (thisvalue == "") {
$('#countryErr').html("
This field is required! ");
setTimeout(function(){ $('#countryErr').html(''); }, 2000);
error = 1;
}
/*var thisvalue = $('#noofprojects').val();
if (thisvalue == "") {
$('#noofprojects').css("border-color","red");
error = 1;
}*/
var thisvalue = $('#service_category').val();
if (thisvalue == "") {
$('#service_categoryErr').html("
This field is required! ");
setTimeout(function(){ $('#service_categoryErr').html(''); }, 2000);
error = 1;
}
var thisvalue = $('#company_tagline').val();
if (thisvalue == "") {
$('#company_tagline').css("border-color","red");
error = 1;
}
var thisvalue = $('#company_overview').val();
if (thisvalue == "") {
$('#company_overview').css("border-color","red");
error = 1;
}
var thisvalue = $('#description').val();
if (thisvalue == "") {
$('#descriptionErr').html("
This field is required! ");
setTimeout(function(){ $('#descriptionErr').html(''); }, 2000);
error = 1;
}
var thisvalue = $('#affiliate').val();
if (thisvalue == "") {
$('#affiliate').css("border-color","red");
error = 1;
}
if(error!=1){
var fd = new FormData($('#servicefrm')[0]);
$.ajax({
url: basePath+'ajax/addservice',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
// setting a timeout
$('#msgloader').html('
');
//$('#sbmtbtn').attr('disabled',true);
},
success: function(result){
//return false;
if(result=='error' && result!="")
{
$('#msgloader').html('
Something Went Wrong Please Try Again Later!
');
//$('#sbmtbtn').removeAttr('disabled');
}
else
{
/* $('input:text').val('');
$('textarea').val('');
$('select').val(''); */
$('#msgloader').html('
Successfully Submitted!
');
if($('#actionfrom').val() == 'front')
{
setTimeout(function(){ window.location.href=basePath+'update-service/'+result; }, 2000);
}
if($('#actionfrom').val() == 'superadmin')
{
setTimeout(function(){ window.location.href=basePath+'siteadmin/service/edit/'+result; }, 2000);
}
$('html, body').animate({
scrollTop: $('body').offset().top
}, 1000);
}
setTimeout(function(){ $('#msgloader').html(''); }, 5000);
},
});
}
else
{
$('html, body').animate({
scrollTop: $('body').offset().top
}, 1000);
}
return false;
}
$('.setdatabx').click(function(){
var bxid = $(this).data('id');
$('html, body').animate({
scrollTop: $('#'+bxid).offset().top
}, 1000);
});
function filterservSearch (basePath)
{
var keyword = $('#search').val();
var fd = new FormData($('#filterfrm')[0]);
$.ajax({
url: basePath+'ajax/filterservSearch',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
$('.listdata').html('
');
},
success: function(data)
{
result = data.trim();
if(result!="")
{
$('.listdata').html(result);
}
else
{
$('.listdata').html('
No result found!
');
}
}
});
}
/* function copyToClipboard(element) {
var $temp = $("
");
$("body").append($temp);
$temp.val($(element).text()).select();
document.execCommand("copy");
$(element).append('
Copied Successfully
');
setTimeout(function(){ $('.msgbx').remove(); }, 2000);
$temp.remove();
} */
function copyToClipboard(element) {
var $temp = $("
");
$("body").append($temp);
$temp.val($(element).html()).select();
var str = $(element).html();
function listener(e) {
e.clipboardData.setData("text/html", str);
e.clipboardData.setData("text/plain", str);
e.preventDefault();
}
document.addEventListener("copy", listener);
document.execCommand("copy");
document.removeEventListener("copy", listener);
$(element).append('
Copied Successfully ');
setTimeout(function(){ $('.msgbx').remove(); }, 2000);
$temp.remove();
$("#success").slideDown("slow");
}
$('.star').click(function(){
var type = $(this).data('type');
if(type!="")
{
var value = $(this).data('value');
$('#'+type).val(value);
}
});
$('.numbar_li').click(function(){
var type = $(this).data('type');
if(type!="")
{
var value = $(this).data('rating');
$('#'+type).val(value);
$('.numbar_li').removeClass('selected');
for(i=1; i<=value; i++)
{
$('.numbar_li'+i).addClass('selected');
}
}
});
$('.support_rating_li').click(function(){
var type = $(this).data('type');
if(type!="")
{
var value = $(this).data('rating');
$('#'+type).val(value);
$('.support_rating_li').removeClass('selected');
for(i=1; i<=value; i++)
{
$('.supportnumbar_li'+i).addClass('selected');
}
}
});
function addreview(basePath){
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var regurl = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
var thisvalue = $('#software_id').val();
if (thisvalue == "") {
$('#software_id').css("border-color","red");
$("#software_idErr").html("Select Software");
error = 1;
}
var thisvalue = $('#name').val();
if (thisvalue == "") {
$('#name').css("border-color","red");
$("#nameErr").html("Enter Name");
error = 1;
}
var action = $('#action').val();
if(action != 'siteadmin')
{
var thisvalue = $('#email').val();
if (thisvalue == "")
{
$('#email').css("border-color","red");
$("#emailErr").html("Enter Email Id");
error = 1;
}
if (!email_pattern_match.test($('#email').val()) && thisvalue!="")
{
$('#email').css("border-color","red");
$("#emailErr").html("Invalid Email Id");
error = 1;
}
}
var thisvalue = $('#overall_rating').val();
if (thisvalue == "") {
$('#ratingbx').html("
All ratings are mandatory! ");
//setTimeout(function(){ $('#ratingbx').html(''); }, 2000);
error = 1;
}
var thisvalue = $('#features').val();
if (thisvalue == "") {
$('#ratingbx').html("
All ratings are mandatory! ");
//setTimeout(function(){ $('#ratingbx').html(''); }, 2000);
error = 1;
}
var thisvalue = $('#ease_of_use').val();
if (thisvalue == "") {
$('#ratingbx').html("
All ratings are mandatory! ");
//setTimeout(function(){ $('#ratingbx').html(''); }, 2000);
error = 1;
}
var thisvalue = $('#value_for_money').val();
if (thisvalue == "") {
$('#ratingbx').html("
All ratings are mandatory! ");
//setTimeout(function(){ $('#ratingbx').html(''); }, 2000);
error = 1;
}
var thisvalue = $('#customer_support').val();
if (thisvalue == "") {
$('#ratingbx').html("
All ratings are mandatory! ");
//setTimeout(function(){ $('#ratingbx').html(''); }, 2000);
error = 1;
}
var thisvalue = $('#review_title').val();
if (thisvalue == "") {
$('#review_title').css("border-color","red");
$("#review_titleErr").html("Enter Review Tite");
error = 1;
}
if(regurl.test($("#review_title").val()))
{
$('#review_title').css("border-color","red");
$('#review_titleErr').html('URL links are not allowed, please remove URL link from the review title');
error = 1;
}
var thisvalue = $('#your_review').val();
if (thisvalue == "") {
$('#your_review').css("border-color","red");
$("#your_reviewErr").html("Enter Review");
error = 1;
}
if(regurl.test($("#your_review").val()))
{
$('#your_review').css("border-color","red");
$('#your_reviewErr').html('URL links are not allowed, please remove URL link from the review');
error = 1;
}
var thisvalue = $('#impressive_about').val();
if (thisvalue == "") {
$('#impressive_about').css("border-color","red");
$("#impressive_aboutErr").html("Enter impressive about software");
error = 1;
}
var thisvalue = $('#features_part').val();
if (thisvalue == "") {
$('#features_part').css("border-color","red");
$("#features_partErr").html("Enter which software features/part can be improved");
error = 1;
}
var thisvalue = $('.sft_value_for_money:checked').length;
//alert(thisvalue);
if (thisvalue == null || thisvalue == '') {
$('#sft_value_for_moneyErr').html("
This field is required! ");
//setTimeout(function(){ $('#sft_value_for_moneyErr').html(''); }, 2000);
error = 1;
}
var thisvalue = $('.satisfied_with_fture:checked').length;
//alert(thisvalue);
if (thisvalue == null || thisvalue == '') {
$('#satisfied_with_ftureErr').html("
This field is required! ");
//setTimeout(function(){ $('#satisfied_with_ftureErr').html(''); }, 2000);
error = 1;
}
var thisvalue = $('.software_implementation:checked').length;
//alert(thisvalue);
if (thisvalue == null || thisvalue == '') {
$('#software_implementationErr').html("
This field is required! ");
//setTimeout(function(){ $('#software_implementationErr').html(''); }, 2000);
error = 1;
}
var thisvalue = $('#missing_feature').val();
if (thisvalue == "") {
$('#missing_feature').css("border-color","red");
$("#missing_featureErr").html("Enter any missing_feature");
error = 1;
}
var thisvalue = $('.mobile_app:checked').length;
//alert(thisvalue);
if (thisvalue == null || thisvalue == '') {
$('#mobile_appErr').html("
This field is required! ");
//setTimeout(function(){ $('#mobile_appErr').html(''); }, 2000);
error = 1;
}
var thisvalue = $('#mobile_app_rating').val();
if (thisvalue == "") {
$('#mobile_app_ratingErr').html("
This field is required! ");
//setTimeout(function(){ $('#mobile_app_ratingErr').html(''); }, 2000);
error = 1;
}
var thisvalue = $('#other_software_used').val();
if (thisvalue == "") {
$('#other_software_used').css("border-color","red");
$("#other_software_usedErr").html("Enter other products like software have you used or evaluated");
error = 1;
}
var thisvalue = $('#software_diff_competitors').val();
if (thisvalue == "") {
$('#software_diff_competitors').css("border-color","red");
$("#software_diff_competitorsErr").html("Enter How software is better/different from its competitors");
error = 1;
}
var thisvalue = $('#support_rating').val();
if (thisvalue == "") {
$('#support_ratingErr').html("
This field is required! ");
//setTimeout(function(){ $('#support_ratingErr').html(''); }, 2000);
error = 1;
}
/* if (str1 != str2)
{
$("#captcha").css("border-color","#e85445")
$("#captchaError").html("Captcha code did not match.")
error=1;
} */
//alert(error);
if(error!=1){
var fd = new FormData($('#write_reviewfrm')[0]);
$.ajax({
url: basePath+'ajax/addreview',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
// setting a timeout
$('#msgloader').html('
');
//$('#sbmtbtn').attr('disabled',true);
},
success: function(result){
//alert(result);
//return false;
if(result=='fail' && result!="")
{
$('#msgloader').html('
Something Went Wrong Please Try Again Later!
');
//$('#sbmtbtn').removeAttr('disabled');
}
else if(result=='review already exists' && result!="")
{
$('#msgloader').html('
Review Already Exists!
');
//$('#sbmtbtn').removeAttr('disabled');
}
else
{
/* $('input:text').val('');
$('textarea').val('');
$('select').val(''); */
$('#msgloader').html('
Successfully Submitted!
');
setTimeout(function(){ location.reload(); }, 2000);
}
setTimeout(function(){ $('#msgloader').html(''); }, 5000);
},
});
}
else
{
$('html, body').animate({
scrollTop: $('body').offset().top
}, 1000);
}
return false;
}
function readimgURL(input,id, viewtype='')
{
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
$('#'+id).attr('src', e.target.result);
if(viewtype!="")
{
var img = new Image();
img.onload = function() {
//alert(this.width + 'x' + this.height);
if(this.width > 200 && this.height > 200)
{
$('#logosizeErr').show();
$("#logo").val('');
}
else
{
$('#logosizeErr').hide();
}
}
img.src = e.target.result;
}
}
reader.readAsDataURL(input.files[0]); // convert to base64 string
}
}
$("#user_icon").change(function() {
readimgURL(this,'user_icon_view');
});
//$("#logo").change(function() {
//readimgURL(this,'logo_view_img','software');
// $('#sft_logo_view').modal('show');
//});
/*$("#logo").change(function() {
readimgURL(this,'logo_view_img','software');
$('#imageModel').modal('show');
});*/
/*$('#logo').change(function() {
var i = $(this).prev('label').clone();
var file = $('#logo')[0].files[0].name;
$('.file-custom').text(file);
});*/
$(".free_trial").click(function() {
if($('.free_trial:checked').val()=='Yes')
{
$('.free_trial_days_bx').show();
}
else
{
$('.free_trial_days_bx').hide();
$('.free_trial_days_fld').val('');
}
});
function subscribefrnewsletter(basePath){
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var thisvalue = $('#name').val();
if (thisvalue == "")
{
$('#name').css("border-color","red");
error = 1;
}
var thisvalue = $('#email').val();
if (thisvalue == "")
{
$('#email').css("border-color","red");
error = 1;
}
if (!email_pattern_match.test($('#email').val()) && thisvalue!="")
{
$('#email').css("border-color","red");
error = 1;
}
var thisvalue = $('#c_captcha1').val();
if (thisvalue == "") {
$('#c_captcha1').css("border-color","red");
//alert('You can\'t leave Captcha Code');
return false;
}
if($("#c_captcha1").val()!=$("#ccode1").val() && $('#c_captcha1').val() != "")
{
alert('Invalid captcha code!');
return false;
}
if(error!=1){
var fd = new FormData($('#news-subcribeform')[0]);
$.ajax({
url: basePath+'ajax/subscribefrnewsletter',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
// setting a timeout
$('#msgloader').html('
');
//$('#sbmtbtn').attr('disabled',true);
},
success: function(result){
//return false;
if(result=='error' && result!="")
{
$('#msgloader').html('
Something Went Wrong Please Try Again Later!
');
//$('#sbmtbtn').removeAttr('disabled');
}
else
{
$('input:text').val('');
$('#msgloader').html('
Subscribed Successfully !
');
setTimeout(function(){ location.reload(); }, 2000);
}
setTimeout(function(){ $('#msgloader').html(''); }, 5000);
},
});
}
else
{
$('html, body').animate({
scrollTop: $('body').offset().top
}, 1000);
}
return false;
}
function sendEnquiry(basePath)
{
var error="";
var str1 = $('#txtCaptchaDiv').html();
var str2 = $('#captcha').val();
var filter = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var thisvalue = $('#send_name').val();
if (thisvalue == "")
{
$("#send_name").css("border-color","red");
//$("#send_nameErr").html("Please enter your name");
error=1;
}
var thisvalue = $('#send_email_id').val();
if (thisvalue == "")
{
$("#send_email_id").css("border-color","red");
//$("#send_email_idErr").html("Please enter your email id");
error=1;
}
else if (!filter.test($("#send_email_id").val())) {
$("#send_email_id").css("border-color","#e85445")
//$("#send_email_idErr").html("Email address is invalid.")
error=1;
}
var thisvalue = $('#send_mobile').val();
if (thisvalue == "")
{
$("#send_mobile").css("border-color","red");
//$("#send_mobileErr").html("Please enter your mobile no.");
error=1;
}
var thisvalue = $('#send_city').val();
if (thisvalue == "")
{
$("#send_city").css("border-color","red");
//$("#send_cityErr").html("Please enter city");
error=1;
}
var thisvalue = $('#send_preferred_time').val();
if (thisvalue == "")
{
$("#send_preferred_time").css("border-color","red");
//$("#send_cityErr").html("Please enter city");
error=1;
}
var thisvalue = $('#captcha').val();
if (thisvalue == "")
{
$("#captcha").css("border-color","#e85445")
$("#captchaErr").html("This value is required.")
error=1;
}
else if (str1 != str2)
{
$("#captcha").css("border-color","#e85445")
$("#captchaErr").html("Captcha code did not match.")
error=1;
}
if(error!=1)
{
var fd = new FormData($('#rqstfrm')[0]);
$.ajax({
url: basePath+'ajax/sendEnquiry',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
$('#enqmsgloader').html('
');
},
success: function(result){
//alert(data);
if(result=='exist' && result!="")
{
$('#enqmsgloader').html('
You Have Already Sent An Enquiry On This Software!
');
}
else if(result=='fail' && result!="")
{
$('#enqmsgloader').html('
Something Went Wrong, Please Try Again Later!
');
}
else
{
$('input:text').val('');
$('textarea').val('');
$('#enqmsgloader').html('
Message Sent Successfully! Our team will get in touch with you shortly to discuss further details.
');
setTimeout(function(){ location.reload(); }, 3000);
}
//setTimeout(function(){ $('#enqmsgloader').html(''); }, 3000);
}
});
}
return false;
}
function getsftprice(basePath)
{
var error="";
var str1 = $('#txtCaptchaDiv3').html();
var str2 = $('#captcha3').val();
var filter = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var thisvalue = $('#send_name3').val();
if (thisvalue == "")
{
$("#send_name3").css("border-color","red");
//$("#send_nameErr").html("Please enter your name");
error=1;
}
var thisvalue = $('#send_email_id3').val();
if (thisvalue == "")
{
$("#send_email_id3").css("border-color","red");
//$("#send_email_idErr").html("Please enter your email id");
error=1;
}
else if (!filter.test($("#send_email_id3").val())) {
$("#send_email_id3").css("border-color","#e85445")
//$("#send_email_idErr").html("Email address is invalid.")
error=1;
}
var thisvalue = $('#send_mobile3').val();
if (thisvalue == "")
{
$("#send_mobile3").css("border-color","red");
//$("#send_mobileErr").html("Please enter your mobile no.");
error=1;
}
var thisvalue = $('#captcha3').val();
if (thisvalue == "")
{
$("#captcha3").css("border-color","#e85445")
$("#captcha3Err").html("This value is required.")
error=1;
}
else if (str1 != str2)
{
$("#captcha3").css("border-color","#e85445")
$("#captcha3Err").html("Captcha code did not match.")
error=1;
}
if(error!=1)
{
var fd = new FormData($('#rqstfrm3')[0]);
$.ajax({
url: basePath+'ajax/getsftprice',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
$('#enqmsgloader3').html('
');
},
success: function(result){
//alert(data);
if(result=='exist' && result!="")
{
$('#enqmsgloader3').html('
You Have Already Sent An Enquiry On This Software!
');
}
else if(result=='fail' && result!="")
{
$('#enqmsgloader3').html('
Something Went Wrong, Please Try Again Later!
');
}
else
{
$('input:text').val('');
$('textarea').val('');
$('#enqmsgloader3').html('
Message Sent Successfully! Our team will get in touch with you shortly to discuss further details.
');
setTimeout(function(){ location.reload(); }, 3000);
}
//setTimeout(function(){ $('#enqmsgloader').html(''); }, 3000);
}
});
}
return false;
}
function validategetintouch(basePath)
{
event.preventDefault();
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var phone_pattern_match = /^[0-9]+$/;
var thisvalue = $('#name').val();
if (thisvalue == "") {
$('#name').css("border-color","red");
$('#nameErr').html('Enter Your Name!');
error = 1;
}
var thisvalue = $('#email').val();
if (thisvalue == "") {
$('#email').css("border-color","red");
$('#emailErr').html('Please Enter Your Email!');
error = 1;
}
if (!email_pattern_match.test($('#email').val()) && thisvalue!="") {
$('#email').css("border-color","red");
$('#emailErr').html('Invalid Email Format!');
error = 1;
}
var thisvalue = $('#phone').val();
if (thisvalue == "") {
$('#phone').css("border-color","red");
$('#phoneErr').html('Enter Your getintouch No!');
error = 1;
}
if (!phone_pattern_match.test($('#phone').val()) && thisvalue !="") {
$('#phone').css("border-color","red");
$('#phoneErr').html('Invalid getintouch No!');
error = 1;
}
/* var v = grecaptcha.getResponse();
if(v.length == 0)
{
$('#captcha').html('You can\'t leave Captcha Code');
error = 1;
}
else
{
$('#captcha').html('');
} */
var thisvalue = $('#c_captcha1').val();
if (thisvalue == "") {
$('#c_captcha1').css("border-color","red");
//alert('You can\'t leave Captcha Code');
return false;
}
if($("#c_captcha1").val()!=$("#ccode1").val() && $('#c_captcha1').val() != "")
{
alert('Invalid captcha code!');
return false;
}
if(error!=1)
{
var fd = new FormData($('#getintouchfrm')[0]);
$.ajax({
type: "POST",
url: basePath+'ajax/getintouch_proccess',
data: fd,
contentType: false,
cache: false,
processData:false,
beforeSend: function() {
// setting a timeout
$('#msgloader').html('
Please Wait!
');
$('#submit').attr('disabled',true);
},
success: function(result){
//return false;
if(result=='fail' && result!="")
{
$('#msgloader').html('
Something Went Wrong Please Try Again Later!
');
// $('#sbmtbtn').removeAttr('disabled');
}
else if(result=='exist' && result!="")
{
$('#msgloader').html('
Already registered with this Email Id!
');
// $('#sbmtbtn').removeAttr('disabled');
}
else
{
$('input:text').val('');
$('#email').val('');
$('select').val('');
$('#msgloader').html('
Message sent successfully! Our team will get in touch with you shortly to discuss further details.
');
}
setTimeout(function(){ $('#msgloader').html(''); }, 5000);
},
});
}
return false;
}
$('.extra-fields-customer-feature1').click(function() {
$('.customer_records_dynamic-feature1').append('
');
});
$('.addmoreplan').click(function() {
var featurecounter = $('#prjtcounter').val();
var featurecounter = parseInt(featurecounter) + parseInt(1);
$('#prjtcounter').val(featurecounter);
$('.newplanbox').append('
Create Pricing Plan '+featurecounter+' ');
$('.extra-fields-customer-feature'+featurecounter).click(function() {
$('.customer_records_dynamic-feature'+featurecounter).append('
');
});
});
function delplan(rowid,type=null,featureid=null, basePath=null)
{
if(type == 'update' && featureid!="")
{
if(!confirm('Are You Sure Want To Delete This Record!'))
{
return false;
}
var featurecounter = $('#prjtcounter').val();
var featurecounter = parseInt(featurecounter) - parseInt(1);
$('#prjtcounter').val(featurecounter);
$.ajax({
url: basePath+"ajax/delplan",
data: {'featureid':featureid},
type: "post",
beforeSend: function() {
},
success: function(data){
//alert(data);
$('#prjtrow'+rowid).remove();
}
});
}
else
{
var prjtcounter = $('#prjtcounter').val();
var prjtcounter = parseInt(prjtcounter) - parseInt(1);
$('#prjtcounter').val(prjtcounter);
$('#prjtrow'+rowid).remove();
}
}
function getcategorymenu(basePath)
{
var searchcat = $('#searchcat').val();
$.ajax({
type: "POST",
url: basePath+'ajax/getcategorymenu',
data: {'searchcat':searchcat},
beforeSend: function() {
// setting a timeout
$('.categorymenubx').html('
');
},
success: function(result){
$('.categorymenubx').html(result);
},
});
}
function getservicemenu(basePath)
{
var searchser = $('#searchser').val();
$.ajax({
type: "POST",
url: basePath+'ajax/getservicemenu',
data: {'searchser':searchser},
beforeSend: function() {
// setting a timeout
$('.servicemenubx').html('
');
},
success: function(result){
$('.servicemenubx').html(result);
},
});
}
function validatecontact(basePath)
{
event.preventDefault();
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var phone_pattern_match = /^[0-9]+$/;
var thisvalue = $('#name').val();
if (thisvalue == "") {
$('#name').css("border-color","red");
$('#nameErr').html('Enter Your Name!');
error = 1;
}
var thisvalue = $('#email').val();
if (thisvalue == "") {
$('#email').css("border-color","red");
$('#emailErr').html('Please Enter Your Email!');
error = 1;
}
if (!email_pattern_match.test($('#email').val()) && thisvalue!="") {
$('#email').css("border-color","red");
$('#emailErr').html('Invalid Email Format!');
error = 1;
}
var thisvalue = $('#company').val();
if (thisvalue == "") {
$('#company').css("border-color","red");
$('#companyErr').html('Enter Your company!');
error = 1;
}
var thisvalue = $('#phone').val();
if (thisvalue == "") {
$('#phone').css("border-color","red");
$('#phoneErr').html('Enter Your Contact No!');
error = 1;
}
if (!phone_pattern_match.test($('#phone').val()) && thisvalue !="") {
$('#phone').css("border-color","red");
$('#phoneErr').html('Invalid Contact No!');
error = 1;
}
var thisvalue = $('#subject').val();
if (thisvalue == "") {
$('#subject').css("border-color","red");
error = 1;
}
var thisvalue = $('#message').val();
if (thisvalue == "") {
$('#message').css("border-color","red");
error = 1;
}
/* var v = grecaptcha.getResponse();
if(v.length == 0)
{
$('#captcha').html('You can\'t leave Captcha Code');
error = 1;
}
else
{
$('#captcha').html('');
} */
var thisvalue = $('#c_captcha1').val();
if (thisvalue == "") {
$('#c_captcha1').css("border-color","red");
//alert('You can\'t leave Captcha Code');
return false;
}
if($("#c_captcha1").val()!=$("#ccode1").val() && $('#c_captcha1').val() != "")
{
alert('Invalid captcha code!');
return false;
}
if(error!=1)
{
var fd = new FormData($('#contactfrm')[0]);
$.ajax({
type: "POST",
url: basePath+'ajax/contactus_proccess',
data: fd,
contentType: false,
cache: false,
processData:false,
beforeSend: function() {
// setting a timeout
$('#msgloader').html('
Please Wait!
');
$('#submit').attr('disabled',true);
},
success: function(result){
//return false;
if(result=='fail' && result!="")
{
$('#msgloader').html('
Something Went Wrong Please Try Again Later!
');
// $('#sbmtbtn').removeAttr('disabled');
}
else if(result=='exist' && result!="")
{
$('#msgloader').html('
Already registered with this Email Id!
');
// $('#sbmtbtn').removeAttr('disabled');
}
else
{
$('input:text').val('');
$('#email').val('');
$('select').val('');
$('textarea').val('');
$('#msgloader').html('
Message sent successfully! Our team will get in touch with you shortly to discuss further details.
');
}
setTimeout(function(){ $('#msgloader').html(''); }, 5000);
},
});
}
return false;
}
function checkemail(basePath)
{
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var email = $('#email').val();
var thisvalue = $('#email').val();
if (thisvalue == "") {
$('#email').css("border-color","red");
$('#regimsgloader').html('
Enter Your Email!
');
error = 1;
}
if (!email_pattern_match.test($('#email').val()) && thisvalue!="") {
$('#email').css("border-color","red");
$('#regimsgloader').html('
Invalid Email Format!
');
error = 1;
}
if(error!=1)
{
$.ajax({
type: "POST",
url: basePath+'ajax/checkemail',
data: {'email':email},
beforeSend: function() {
$('#regimsgloader').html('
');
},
success: function(result){
if(result=='found' && result!="")
{
$('#email').val('');
$('#regimsgloader').html('
Email Id Already Exist!
');
}
},
});
}
setTimeout(function(){ $('#regimsgloader').html('');}, 3000);
return false;
}
$("#toggle_password").click(function () {
$(this).toggleClass("fa-eye fa-eye-slash");
var type = $(this).hasClass("fa-eye-slash") ? "text" : "password";
$("#password").attr("type", type);
});
$("#toggle_userpassword").click(function () {
$(this).toggleClass("fa-eye fa-eye-slash");
var type = $(this).hasClass("fa-eye-slash") ? "text" : "password";
$("#userpassword").attr("type", type);
});
$("#toggle_password_confirm").click(function () {
$(this).toggleClass("fa-eye fa-eye-slash");
var type = $(this).hasClass("fa-eye-slash") ? "text" : "password";
$("#password_confirm").attr("type", type);
});
$("#toggle_oldpassword").click(function () {
$(this).toggleClass("fa-eye fa-eye-slash");
var type = $(this).hasClass("fa-eye-slash") ? "text" : "password";
$("#oldpassword").attr("type", type);
});
$("#toggle_newpassword").click(function () {
$(this).toggleClass("fa-eye fa-eye-slash");
var type = $(this).hasClass("fa-eye-slash") ? "text" : "password";
$("#newpassword").attr("type", type);
});
$("#toggle_confpassword").click(function () {
$(this).toggleClass("fa-eye fa-eye-slash");
var type = $(this).hasClass("fa-eye-slash") ? "text" : "password";
$("#confpassword").attr("type", type);
});
function validatesecuredpayment(basePath)
{
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var regurl = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
var phone_pattern_match = /^[0-9]+$/;
var basePath = $('#basePath').val();
var thisvalue = $('#secured_payment_amount').val();
if (thisvalue == "") {
$('#secured_payment_amount').css("border-color","red");
$('#secured_payment_amountErr').html('Enter Amount');
error = 1;
}
var thisvalue = $('#secured_payment_quotation_id').val();
if (thisvalue == "") {
$('#secured_payment_quotation_id').css("border-color","red");
$('#secured_payment_quotation_idErr').html('Enter Quotation Id');
error = 1;
}
if(regurl.test($("#secured_payment_quotation_id").val()))
{
$('#secured_payment_quotation_id').css("border-color","red");
$('#secured_payment_quotation_idErr').html('URL links are not allowed, please remove URL link from the quotation id');
error = 1;
}
var thisvalue = $('#secured_payment_name').val();
if (thisvalue == "") {
$('#secured_payment_name').css("border-color","red");
$('#secured_payment_nameErr').html('Enter Name');
error = 1;
}
var thisvalue = $('#secured_payment_email').val();
if (thisvalue == "") {
$('#secured_payment_email').css("border-color","red");
$('#secured_payment_emailErr').html('Enter Email Id');
error = 1;
}
if (!email_pattern_match.test($('#secured_payment_email').val()) && thisvalue!="") {
$('#secured_payment_email').css("border-color","red");
$('#secured_payment_emailErr').html('Invalid Email Format');
error = 1;
}
var thisvalue = $('#secured_payment_phone').val();
if (thisvalue == "") {
$('#secured_payment_phone').css("border-color","red");
$('#secured_payment_phoneErr').html(' Enter Phone No.');
error = 1;
}
if (!phone_pattern_match.test($('#secured_payment_phone').val()) && thisvalue !="") {
$('#secured_payment_phone').css("border-color","red");
$('#secured_payment_phoneErr').html('Invalid Phone');
error = 1;
}
var thisvalue = $('#secured_payment_country').val();
if (thisvalue == "") {
$('#secured_payment_country').css("border-color","red");
$('#secured_payment_countryErr').html('Select Country');
error = 1;
}
var message = $('#secured_payment_address').val();
if (message == "") {
$('#secured_payment_address').css("border-color","red");
$('#secured_payment_addressErr').html('Enter Message');
error = 1;
}
if(regurl.test($("#secured_payment_address").val()))
{
$('#secured_payment_address').css("border-color","red");
$('#secured_payment_addressErr').html('URL links are not allowed, please remove URL link from the address');
error = 1;
}
var thisvalue = $('#secured_payment_state').val();
if (thisvalue == "") {
$('#secured_payment_state').css("border-color","red");
$('#secured_payment_stateErr').html('Enter State');
error = 1;
}
var thisvalue = $('#secured_payment_city').val();
if (thisvalue == "") {
$('#secured_payment_city').css("border-color","red");
$('#secured_payment_cityErr').html('Enter City');
error = 1;
}
var thisvalue = $('#secured_payment_pincode').val();
if (thisvalue == "") {
$('#secured_payment_pincode').css("border-color","red");
$('#secured_payment_pincodeErr').html('Enter Pincode');
error = 1;
}
if(regurl.test($("#secured_payment_pincode").val()))
{
$('#secured_payment_pincode').css("border-color","red");
$('#secured_payment_pincodeErr').html('URL links are not allowed, please remove URL link from the pincode');
error = 1;
}
var thisvalue1 = $('#captchabx_codeBox1contact').val();
var thisvalue2 = $('#captchabx_codeBox2contact').val();
var thisvalue3 = $('#captchabx_codeBox3contact').val();
var thisvalue4 = $('#captchabx_codeBox4contact').val();
var str2 = thisvalue1 + thisvalue2 + thisvalue3 + thisvalue4;
if(str2 == "") {
$('#captchacontactErr').html('You can\'t leave Captcha Code');
error = 1;
}
if(str2 != $("#captchacontact").val() && str2 != "") {
$('#captchacontactErr').html('Invalid captcha code!');
error = 1;
}
if(document.getElementById('terms').checked)
{
error = "";
}
else
{
$('#terms').css("border-color","red");
$('#termsErr').html('Please agree to the privacy policy');
error = 1;
}
//alert(error);
if(error!=1)
{
$('#captchacontactErr').html('');
$.ajax({
type: "post",
url: basePath+'ajax/validatesecuredpayment',
data: $('#secuured-payment-frm').serialize(),
beforeSend: function() {
// setting a timeout
$('#msgloader13').html('
Please Wait!
');
$('#sbmtbtn').attr('disabled',true);
},
success: function(result){
if(result=='fail' && result!="")
{
$('#msgloader13').html('
Something Went Wrong Please Try Again Later!
');
$('#sbmtbtn').removeAttr('disabled');
}
else
{
var arrdata=result.split("||");
var amount = arrdata[0];
var name = arrdata[1];
var email = arrdata[2];
var phone = arrdata[3];
$('#secpayfrm').attr('action','https://www.webimta.com/razorpay/payment_secured_chanakyasoftware.php');
$('#secpayfrm').html('
');
$('#secpayfrm').submit();
/* $('#secuured-payment-frm')[0].reset();
$('#sbmtbtn').removeAttr('disabled');
$('#msgloader13').html('
Message Sent Successfully!
');*/
}
setTimeout(function(){ $('#msgloader13').html(''); }, 5000);
},
});
}
return false;
}
function validatepayentgatewayform(basePath)
{
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var regurl = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
var phone_pattern_match = /^[0-9]+$/;
var basePath = $('#basePath').val();
var thisvalue = $('#amount').val();
if (thisvalue == "") {
$('#amount').css("border-color","red");
$('#amountErr').html('Enter Amount');
error = 1;
}
var thisvalue = $('#quoteid').val();
if (thisvalue == "") {
$('#quoteid').css("border-color","red");
$('#quoteidErr').html('Enter Quotation Id');
error = 1;
}
if(regurl.test($("#quoteid").val()))
{
$('#quoteid').css("border-color","red");
$('#quoteidErr').html('URL links are not allowed, please remove URL link from the quotation id');
error = 1;
}
var thisvalue = $('#name').val();
if (thisvalue == "") {
$('#name').css("border-color","red");
$('#nameErr').html('Enter Name');
error = 1;
}
var thisvalue = $('#email_id').val();
if (thisvalue == "") {
$('#email_id').css("border-color","red");
$('#email_idErr').html('Enter Email Id');
error = 1;
}
if (!email_pattern_match.test($('#email_id').val()) && thisvalue!="") {
$('#email_id').css("border-color","red");
$('#email_idErr').html('Invalid Email Format');
error = 1;
}
var thisvalue = $('#phone_no').val();
if (thisvalue == "") {
$('#phone_no').css("border-color","red");
$('#phone_noErr').html(' Enter Phone No.');
error = 1;
}
if (!phone_pattern_match.test($('#phone_no').val()) && thisvalue !="") {
$('#phone_no').css("border-color","red");
$('#phone_noErr').html('Invalid Phone');
error = 1;
}
var thisvalue = $('#country').val();
if (thisvalue == "") {
$('#country').css("border-color","red");
$('#countryErr').html('Select Country');
error = 1;
}
var message = $('#complete_address').val();
if (message == "") {
$('#complete_address').css("border-color","red");
$('#complete_address').html('Enter Address');
error = 1;
}
if(regurl.test($("#complete_address").val()))
{
$('#complete_address').css("border-color","red");
$('#complete_addressErr').html('URL links are not allowed, please remove URL link from the address');
error = 1;
}
var thisvalue = $('#state').val();
if (thisvalue == "") {
$('#state').css("border-color","red");
$('#stateErr').html('Enter State');
error = 1;
}
var thisvalue = $('#city').val();
if (thisvalue == "") {
$('#city').css("border-color","red");
$('#cityErr').html('Enter City');
error = 1;
}
var thisvalue = $('#postal_code').val();
if (thisvalue == "") {
$('#postal_code').css("border-color","red");
$('#postal_codeErr').html('Enter Pincode');
error = 1;
}
if(regurl.test($("#postal_code").val()))
{
$('#postal_code').css("border-color","red");
$('#postal_codeErr').html('URL links are not allowed, please remove URL link from the pincode');
error = 1;
}
var thisvalue1 = $('#captchabx_codeBox1').val();
var thisvalue2 = $('#captchabx_codeBox2').val();
var thisvalue3 = $('#captchabx_codeBox3').val();
var thisvalue4 = $('#captchabx_codeBox4').val();
var str2 = thisvalue1 + thisvalue2 + thisvalue3 + thisvalue4;
if(str2 == "") {
$('#captchaErr').html('You can\'t leave Captcha Code');
error = 1;
}
if(str2 != $("#captcha").val() && str2 != "") {
$('#captchaErr').html('Invalid captcha code!');
error = 1;
}
if(document.getElementById('terms').checked)
{
error = "";
}
else
{
$('#terms').css("border-color","red");
$('#termsErr').html('Please agree to the terms and conditions');
error = 1;
}
//alert(error);
if(error!=1)
{
$('#captchaErr').html('');
$.ajax({
type: "post",
url: basePath+'ajax/validatepayentgatewayform',
data: $('#secure-pay').serialize(),
beforeSend: function() {
// setting a timeout
$('#msgloader15').html('
Please Wait!
');
$('#sbmtbtn').attr('disabled',true);
},
success: function(result){
if(result=='fail' && result!="")
{
$('#msgloader15').html('
Something Went Wrong Please Try Again Later!
');
$('#sbmtbtn').removeAttr('disabled');
}
else
{
var arrdata=result.split("||");
var hidden_amount = arrdata[0];
var hidden_name = arrdata[1];
var hidden_email = arrdata[2];
var hidden_phone = arrdata[3];
$('#secpaymetfrm').attr('action','https://www.webimta.com/razorpay/payment_gateway_chanakyasoftware_com_process.php');
$('#secpaymetfrm').html('
');
$('#secpaymetfrm').submit();
}
setTimeout(function(){ $('#msgloader15').html(''); }, 5000);
},
});
}
return false;
}
function sendleadotp(basePath,obj)
{
var error = "";
var email_pattern_match = /^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i;
var thisvalue = $('#username').val();
if (thisvalue == "") {
$('#username').css("border-color","red");
$('#msgloader').html('
Enter Your Email!
');
error = 1;
}
if (!email_pattern_match.test($('#username').val()) && thisvalue!="") {
$('#username').css("border-color","red");
$('#msgloader').html('
Invalid Email Format!
');
error = 1;
}
var username = $('#username').val();
var leaduserid = $('#leaduserid').val();
if(error!=1)
{
$.ajax({
type: "POST",
url: basePath+'ajax/sendleadotp',
data: {'username':username,leaduserid:leaduserid},
beforeSend: function() {
// setting a timeout
$('#msgloader').html('
Please Wait!
');
$('#sbmtbtn').attr('disabled',true);
},
success: function(result){
//return false;
if(result=='fail' && result!="")
{
$('#msgloader').html('
Invalid Email ID!
');
$('#sbmtbtn').removeAttr('disabled');
}
else
{
$('#msgloader').html('
OTP Sent to your Registered Email ID.
');
$('.otpbox').css('display','');
$(obj).remove();
}
setTimeout(function(){ $('#msgloader').html(''); }, 5000);
},
});
}
}
function verifyleadotp(basePath,obj)
{
//var otpcode = $('#otpcode').val();
var digit1 = $('#digit-1').val();
var digit2 = $('#digit-2').val();
var digit3 = $('#digit-3').val();
var digit4 = $('#digit-4').val();
var otpcode = digit1+digit2+digit3+digit4;
//alert(otpcode);
//return false;
if(otpcode!='')
{
$.ajax({
type: "POST",
url: basePath+'ajax/verifyleadotp',
data: {'otpcode':otpcode},
beforeSend: function() {
// setting a timeout
$('#msgloader').html('
Please Wait!
');
$('#sbmtbtn').attr('disabled',true);
},
success: function(result){
//alert(result);
//return false;
if(result=='error' && result!="")
{
$('#msgloader').html('
Something Went Wrong Please Try Again Later!
');
}
else if(result=='fail' && result!="")
{
$('#msgloader').html('
Invalid OTP Please Try Again!
');
}
else
{
$('#msgloader').html('
Verify Successfully!
');
$('.otpbox').remove();
/* $('.verifytext').html('Verified');
$('#verifysts').val('2'); */
$('#sbmtbtn').removeAttr('disabled');
setTimeout(function(){
$('#msgloader').html('');
window.location.href= basePath+'viewleaddetails/'+result;
}, 2000);
}
},
});
}
else
{
$('#otpcode').css("border-color","red");
}
}
$('.digit-group').find('input').each(function() {
$(this).attr('maxlength', 1);
$(this).on('keyup', function(e) {
var parent = $($(this).parent());
if(e.keyCode === 8 || e.keyCode === 37) {
var prev = parent.find('input#' + $(this).data('previous'));
if(prev.length) {
$(prev).select();
}
} else if((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 65 && e.keyCode <= 90) || (e.keyCode >= 96 && e.keyCode <= 105) || e.keyCode === 39) {
var next = parent.find('input#' + $(this).data('next'));
if(next.length) {
$(next).select();
} else {
if(parent.data('autosubmit')) {
parent.submit();
}
}
}
});
});
$(".interviewrow").on('change',function() {
var interviewrow = $('.interviewrow:checked').length;
if(interviewrow>0)
{
$('.meetingfld').show('slow');
}
else
{
$('.meetingfld').hide('slow');
}
});
function assignmultiple(baseurl)
{
var interviewrow = $('.interviewrow:checked').length;
//var user = $('#user').val();
var user = $('#user_hidden').val();
//return false;
if (interviewrow > 0)
{
var thisvalue = $('#user_hidden').val();
if (thisvalue == "")
{
$('#msgloader').html('
Select User!
');
return false;
}
if (!confirm('Are you sure, want to assign selected records ?')) return false;
var checkedinterviewid = [];
$.each($(".interviewrow:checked"), function() {
checkedinterviewid.push($(this).val());
});
var checkedinterviewid = checkedinterviewid.join(",");
$.ajax({
type: "POST",
url: baseurl + 'ajax/assignmultiple',
data: {
checkedinterviewid: checkedinterviewid, user:user
},
beforeSend: function() {
$('#msgloader').html('
');
},
success: function(result) {
//return false;
if (result == 'fail' && result != "") {
$('#msgloader').html('
Something went wrong, try again after sometime!
');
} else {
$('#msgloader').html('
Lead assigned successfully to selected User!
');
setTimeout(function() {
location.reload();
}, 4000);
}
},
});
}
else
{
$('#msgloader').html('
Please Select Atleast One Record!
');
}
setTimeout(function() {
$('#msgloader').html('');
}, 2000);
return false;
}
function validateleadpayment(basePath){
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var regurl = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
var phone_pattern_match = /^[0-9]+$/;
var basePath = $('#basePath').val();
var hidden_amount = $('#hidden_amount').val();
//alert(hidden_amount);
var hidden_wallet_balance = $('#hidden_wallet_balance').val();
//alert(error);
if(error!=1)
{
$.ajax({
type: "post",
url: basePath+'ajax/validateleadpayment',
data: $('#leadpaymentfrm').serialize(),
beforeSend: function() {
// setting a timeout
$('#msgloader13').html('
Please Wait!
');
$('#sbmtbtn').attr('disabled',true);
},
success: function(result){
//alert(result);
//return false;
if(result=='fail' && result!="")
{
$('#msgloader13').html('
Something Went Wrong Please Try Again Later!
');
$('#sbmtbtn').removeAttr('disabled');
}
else if(result=='success' && result!="")
{
//$('#msgloader13').html('
Lead Purchased Successfully!
');
//window.location.href= basePath+'interiordesigner/lead-management';
$(".myModalLeadPayment").removeAttr("style");
$('.myModalLeadPayment').click();
}
else
{
//$('#leadpaymentfrm')[0].reset();
//$('#sbmtbtn').removeAttr('disabled');
var arrdata = result.split('||');
var name = arrdata[0];
var email = arrdata[1];
var amount = arrdata[2];
var phone = arrdata[3];
var lead_paymnet_insert_id=arrdata[4];
$('#payfrm').attr('action','https://www.webimta.com/razorpay/payment_lead_chanakyasoftware.php');
$('#payfrm').html('
');
$('#payfrm').submit();
//$('#msgloader13').html('
Message Sent Successfully!
');
}
setTimeout(function(){ $('#msgloader13').html(''); }, 5000);
},
});
}
return false;
}
$("#filterdays").change(function(){
var days = $('#filterdays').val();
if(days == 'custom'){
$('#customdatefilterfromdate').show();
$('#customdatefiltertodate').show();
}else{
$('#customdatefilterfromdate').hide();
$('#customdatefiltertodate').hide();
}
});
$(".interviewrow").on('change',function() {
var error="";
var basePath= $('#basePath').val();
var interviewrow = $('.interviewrow:checked').length;
if(interviewrow>0)
{
var checkedinterviewid = [];
$.each($(".interviewrow:checked"), function() {
checkedinterviewid.push($(this).val());
});
var checkedinterviewid = checkedinterviewid.join(",");
//alert(checkedinterviewid);
$('#rowids').val(checkedinterviewid);
//$('.meetingfld').show('slow');
if(error!=1)
{
$.ajax({
type: "POST",
url: basePath+'ajax/getusersdropdown',
data: {'checkedinterviewid':checkedinterviewid},
beforeSend: function() {
$('#msgloadergq').html('
Please Wait!
');
},
success: function(result){
//return false;
if(result=='fail' && result!="")
{
$('#msgloader').html('
Something Went Wrong, Please Try Again Later!
');
}
else
{
$('#user').html(result);
}
setTimeout(function(){ $('#msgloader').html(''); }, 5000);
},
});
}
return false;
}
else
{
//$('.meetingfld').hide('slow');
$('.meetingfld').show('slow');
}
});
$('#state').change(function(){
var basePath=$('#basePath').val();
//alert(basePath);
var statename = $( "#state option:selected" ).text();
$('#hidden_state_name').val(statename);
var state_id = $('#state').val();
if(state_id != '')
{
$.ajax({
url: basePath+'ajax/fetch_city',
method:"POST",
data:{state_id:state_id},
success:function(data)
{
//alert(data);
$('#city').html(data);
}
});
}
else
{
$('#city').html('
Select City ');
}
});
$('#city').change(function(){
var cityname = $( "#city option:selected" ).text();
$('#hidden_city_name').val(cityname);
});
$("#add_external_paymnets").click(function() {
if($('#add_external_paymnets').is(":checked")) {
$('#hidden_add_external_payments').val('1');
$(".add_external_paymnets_div").show();
} else {
$('#hidden_add_external_payments').val('0');
$(".add_external_paymnets_div").hide();
}
});
$("#amount_including_gst").change(function() {
var amountincludinggst=$('#amount_including_gst').val();
var amtg=Math.round(amountincludinggst * (100 / 118));
var c= amountincludinggst - amtg;
$('#gst_amount').val(c);
$('#amount_net_of_gst').val(amountincludinggst - c);
});
$('.addmoneytowallet').on('click', function(e){
//alert('hi');
$('#addmoneytowalletdiv').toggle();
});
function validateteaddmoneytowallet(basePath){
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var regurl = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
var phone_pattern_match = /^[0-9]+$/;
var basePath = $('#basePath').val();
var thisvalue = $('#walletamount').val();
if (thisvalue == "") {
$('#walletamount').css("border-color","red");
$('#walletamountErr').html('Enter Amount');
error = 1;
}
if(thisvalue < 500){
$('#walletamount').css("border-color","red");
$('#walletamountErr').html('Enter Mimimum Amount 500');
error = 1;
}
//alert(error);
if(error!=1)
{
var fd = new FormData($('#add-money-to-wallet-frm')[0]);
$.ajax({
url: basePath+'ajax/validateteaddmoneytowallet',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
// setting a timeout
$('#msgloader').html('
Please Wait!
');
$('#sbmtbtn').attr('disabled',true);
},
success: function(result){
//return false;
if(result=='fail' && result!="")
{
$('#msgloader').html('
Something Went Wrong Please Try Again Later!
');
$('#sbmtbtn').removeAttr('disabled');
}
else
{
//alert(result);
//$('#terms-on-register-frm')[0].reset();
$('#sbmtbtn').removeAttr('disabled');
var arrdata=result.split('||');
var initialamount=arrdata[0];
var amountgst=arrdata[1];
var finalamount=arrdata[2];
var name=arrdata[3];
var email=arrdata[4];
var phone=arrdata[5];
var id=arrdata[6];
var wallet_paymnet_insert_id=arrdata[7];
$('#walletgstamount').html(amountgst);
$('#hidden_wallet_gst').val(amountgst);
$('#walletamounttopay').html(finalamount);
$('#hidden_wallet_amount_to_pay').val(finalamount);
$('#walletpayfrm').attr('action','https://www.webimta.com/razorpay/payment_addmoneytowallet_chanakyasoftware.php');
$('#walletpayfrm').html('
');
$('#walletpayfrm').submit();
//$('#msgloader').html('
Redirecting you to dashboard!
');
//window.location.href= basePath+'interiordesigner/dashboard';
}
setTimeout(function(){ $('#msgloader').html(''); }, 5000);
},
});
}
return false;
}
function calculateamounttopay(baseurl)
{
var error = "";
var walletamount = $('#walletamount').val();
var thisvalue = $('#walletamount').val();
if (thisvalue == "") {
$('#walletamount').css("border-color","red");
$('#msgloader').html('
Enter Your Email!
');
error = 1;
}
if (thisvalue < 500) {
$('#walletamount').css("border-color","red");
$('#msgloader').html('
Enter amount greater than 500!
');
$('#walletgstamount').html('');
$('#hidden_wallet_gst').val('');
$('#walletamounttopay').html('');
$('#hidden_wallet_amount_to_pay').val('');
error = 1;
}
if(error!=1)
{
$.ajax({
type: "POST",
url: baseurl+'ajax/calculateamounttopay',
data: {'walletamount':walletamount},
beforeSend: function() {
$('#msgloader').html('
Please Wait!
');
},
success: function(result){
if(result!="" && result=='fail')
{
$('#walletamount').val('');
$('#msgloader').html('
Amount not Added!
');
}
else
{
var arrdata=result.split('||');
var initialamount=arrdata[0];
var amountgst=arrdata[1];
var finalamount=arrdata[2];
var name=arrdata[3];
var email=arrdata[4];
var phone=arrdata[5];
$('#walletgstamount').html(amountgst);
$('#hidden_wallet_gst').val(amountgst);
$('#walletamounttopay').html(finalamount);
$('#hidden_wallet_amount_to_pay').val(finalamount);
}
},
});
}
setTimeout(function(){ $('#msgloader').html('');}, 3000);
return false;
}
$(".leadrow").on('change',function() {
var leadrow = $('.leadrow:checked').length;
if(leadrow>0)
{
$('.meetingfld').show('slow');
}
else
{
$('.meetingfld').hide('slow');
}
});
$('.leadpurchasedmdl').on('click', function(){
$('#myModalLeadPayment').hide();
window.location.href='https://www.chanakyasoftware.com/lead-management';
});
function CopyToClipboard(containerid) {
if (document.selection) {
var range = document.body.createTextRange();
range.moveToElementText(document.getElementById(containerid));
range.select().createTextRange();
document.execCommand("copy");
} else if (window.getSelection) {
var range = document.createRange();
range.selectNode(document.getElementById(containerid));
window.getSelection().addRange(range);
document.execCommand("copy");
//alert("Text has been copied, now paste in the text-area")
}
}
$(".editinvoiceno").click(function() {
//alert('hi');
$('#invoice_no').val();
$('#invoicenodiv').hide();
$('#editinvoicenodiv').show();
});
function myFunctioninvoice(baseurl)
{
var invoiceno = $('#hidden_invoice_no').val();
//alert(invoiceno);
$('#invoce_no').val(invoiceno);
$('#invoicenodiv').show();
$('.invoiceval').html(invoiceno);
$('#editinvoicenodiv').hide();
}
$("#uploadfile").on('change',function() {
var uploadfile = $('#uploadfile').val();
var fileName = document.getElementById("uploadfile").value; //get file name
var fileNam = document.getElementById("uploadfile"); //get file name
var realFileName = (fileName.split('\\').pop().split('/').pop().split('.'))[0];
var ext = fileName.substr(fileName.lastIndexOf('.') + 1);
var i = 0,
files = fileNam.files,
len = files.length;
for (; i < len; i++) {
console.log("Filename: " + files[i].name);
console.log("Type: " + files[i].type);
console.log("Size: " + files[i].size + " bytes");
}
var ext = $('#uploadfile').val().split(".").pop().toLowerCase();
if($.inArray(ext, ["doc","pdf",'docx','mp3','mpeg','mpg','mpeg3','png','jpg','jpeg']) == -1 && $('#uploadfile').val()!="")
{
$("#uploadfile").css("border-color","red");
alert("Please upload doc ,docx , pdf, mp3 ,mpeg ,mpg ,png , jpg , jpeg or mpeg3 file");
$("#uploadfile").val('');
return false;
}
});
$('.enablereplacement').on('click', function(e){
var getleadcode = $(this).data('leadcode');
var getamount = $(this).data('amount');
var getleadid = $(this).data('leadid');
var getuserid = $(this).data('userid');
$('#spanheadlinerev').html('Enable Lead Replacement '+getleadcode);
$('#amount').val(getamount);
$('#leadid').val(getleadid);
$('#userid').val(getuserid);
});
function previewNda()
{
var basePath=$('#basePath').val();
var signature = $("#droppable").val();
var fd = new FormData($('#terms-on-register-frm')[0]);
if(signature!=''){
$.ajax({
type: "POST",
url: basePath+"ajax/submitterms",
data: fd,
contentType: false,
cache: false,
processData:false,
beforeSend: function() {
$('#msgloader2').html('
');
},
success: function(result){
data= result.split('||')
if(result!="")
{
$('#msgloader2').hide();
$('#signaturepreview').html(data[0]);
$('#signaturepreview1').html(data[0]);
$('#signpath').val(data[1]);
}
//setTimeout(function(){ $('#signaturepreview').html(''); }, 3000);
},
});
}
}
function validatetermsonregister(basePath){
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var regurl = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
var phone_pattern_match = /^[0-9]+$/;
var basePath = $('#basePath').val();
var thisvalue = $('#customer_print_name').val();
if (thisvalue == "") {
$('#customer_print_name').css("border-color","red");
$('#customer_print_nameErr').html('Enter Name');
error = 1;
}
var thisvalue = $('#customer_company_name').val();
if (thisvalue == "") {
$('#customer_company_name').css("border-color","red");
$('#customer_company_nameErr').html('Enter Name');
error = 1;
}
var thisvalue = $('#customer_company_name').val();
if (thisvalue == "") {
$('#customer_company_name').css("border-color","red");
$('#customer_company_nameErr').html('Enter Name');
error = 1;
}
var thisvalue = $('#signaturedata').val();
if (thisvalue == "") {
$('#signatureErr').html('Draw Signature');
error = 1;
}
var signpath = $('#signpath').val();
if (signpath == "") {
$('#signpathErr').html('Please click on preview');
error = 1;
}
//alert(error);
if(error!=1)
{
$('#signpathErr').html('');
var fd = new FormData($('#terms-on-register-frm')[0]);
$.ajax({
url: basePath+'ajax/validatetermsonregister',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
// setting a timeout
$('#msgloader').html('
Please Wait!
');
$('#sbmtbtn').attr('disabled',true);
},
success: function(result){
//return false;
if(result=='fail' && result!="")
{
$('#msgloader').html('
Something Went Wrong Please Try Again Later!
');
$('#sbmtbtn').removeAttr('disabled');
}
else
{
$('#terms-on-register-frm')[0].reset();
$('#sbmtbtn').removeAttr('disabled');
$('#msgloader').html('
Redirecting you to dashboard!
');
window.location.href= basePath+'dashboard';
}
setTimeout(function(){ $('#msgloader').html(''); }, 5000);
},
});
}
return false;
}
$( "#country" ).on( "change", function( event ) {
var country = $( "#country" ).val();
//alert(country);
$("#country_code").val($("#country option:selected").attr("data-ccode"));
});
function getCodeBoxElement(index, id_prefix) {
return document.getElementById(id_prefix + index);
}
function onKeyUpEvent(index, event, id_prefix) {
const eventCode = event.which || event.keyCode;
if(getCodeBoxElement(index, id_prefix).value.length === 1) {
if(index !== 4) {
getCodeBoxElement(index + 1, id_prefix).focus();
} else {
getCodeBoxElement(index, id_prefix).blur();
// Submit code
console.log('submit code ');
}
}
if(eventCode === 8 && index !== 1) {
getCodeBoxElement(index - 1, id_prefix).focus();
}
}
function onFocusEvent(index, id_prefix) {
for(item = 1; item < index; item++) {
const currentElement = getCodeBoxElement(item, id_prefix);
if(!currentElement.value) {
currentElement.focus();
break;
}
}
}
function validatepackagesummaryfrm(basePath)
{
event.preventDefault();
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var phone_pattern_match = /^[0-9]+$/;
var regurl = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
var thisvalue = $('#name').val();
if (thisvalue == "") {
$('#name').css("border-color","red");
$('#nameErr').html('Enter Your Name!');
error = 1;
}
if(regurl.test($("#name").val()))
{
$('#name').css("border-color","red");
$('#nameErr').html('URL links are not allowed, please remove URL link from the name');
error = 1;
}
var thisvalue = $('#email').val();
if (thisvalue == "") {
$('#email').css("border-color","red");
$('#emailErr').html('Please Enter Your Email!');
error = 1;
}
if (!email_pattern_match.test($('#email').val()) && thisvalue!="") {
$('#email').css("border-color","red");
$('#emailErr').html('Invalid Email Format!');
error = 1;
}
var thisvalue = $('#company').val();
if (thisvalue == "") {
$('#company').css("border-color","red");
$('#companyErr').html('Enter Your Company!');
error = 1;
}
if(regurl.test($("#company").val()))
{
$('#company').css("border-color","red");
$('#companyErr').html('URL links are not allowed, please remove URL link from the company');
error = 1;
}
var thisvalue = $('#phoneno').val();
if (thisvalue == "") {
$('#phoneno').css("border-color","red");
$('#phoneErr').html('Enter Your Phone No!');
error = 1;
}
if (!phone_pattern_match.test($('#phoneno').val()) && thisvalue !="") {
$('#phoneno').css("border-color","red");
$('#phonenoErr').html('Invalid Phone No!');
error = 1;
}
var thisvalue = $('#message').val();
if (thisvalue == "") {
$('#message').css("border-color","red");
$('#messageErr').html('Enter Message!');
error = 1;
}
if(regurl.test($("#message").val()))
{
$('#message').css("border-color","red");
$('#messageErr').html('URL links are not allowed, please remove URL link from the message');
error = 1;
}
var thisvalue1 = $('#captchabx_codeBox1').val();
var thisvalue2 = $('#captchabx_codeBox2').val();
var thisvalue3 = $('#captchabx_codeBox3').val();
var thisvalue4 = $('#captchabx_codeBox4').val();
var str2 = thisvalue1 + thisvalue2 + thisvalue3 + thisvalue4;
if(str2 == "") {
$('#captchaErr').html('You can\'t leave Captcha Code');
error = 1;
}
if(str2 != $("#captcha").val() && str2 != "") {
$('#captchaErr').html('Invalid captcha code!');
error = 1;
}
if(error!=1)
{
$('#captchaErr').html('');
var fd = new FormData($('#package_summary_frm')[0]);
$.ajax({
type: "POST",
url: basePath+'ajax/packagesummary_proccess',
data: fd,
contentType: false,
cache: false,
processData:false,
beforeSend: function() {
// setting a timeout
$('#msgloader').html('
Please Wait!
');
$('#submit').attr('disabled',true);
},
success: function(result){
//return false;
if(result=='fail' && result!="")
{
$('#msgloader').html('
Something Went Wrong Please Try Again Later!
');
$('#sbmtbtn').removeAttr('disabled');
}
else if(result=='bot' && result!="")
{
$('#msgloader').html('
You are a bot.Not Allowed!
');
$('#sbmtbtn').removeAttr('disabled');
}
else
{
$('#package_summary_frm')[0].reset();
$('#msgloader').html('
Message sent successfully! Our team will get in touch with you shortly to discuss further details.
');
}
setTimeout(function(){
$('#msgloader').html('');
window.location.href= 'https://www.chanakyasoftware.com/';
}, 3000);
},
});
}
return false;
}