$('.numfg').on('keypress', function(e) {
keys = ['0','1','2','3','4','5','6','7','8','9','.']
return keys.indexOf(event.key) > -1
});
$('#add_graduate_course').click(function(){
var graduate_coursecounter = $('#graduate_coursecounter').val();
var graduate_coursecounter = parseInt(graduate_coursecounter) + parseInt(1);
$('#graduate_coursecounter').val(graduate_coursecounter);
$('#othrgraduate_coursebx').append('
');
});
function delgraduate_course(rowid,type=null,graduate_courseid=null, basePath=null)
{
if(type == 'update' && graduate_courseid!="" && confirm('Are You Sure Want To Delete This Record!'))
{
var graduate_coursecounter = $('#graduate_coursecounter').val();
var graduate_coursecounter = parseInt(graduate_coursecounter) - parseInt(1);
$('#graduate_coursecounter').val(graduate_coursecounter);
$.ajax({
url: basePath+"ajax/removegraduate_course",
data: {'graduate_courseid':graduate_courseid},
type: "post",
beforeSend: function() {
},
success: function(data){
//alert(data);
$('#graduate_courserow'+rowid).remove();
}
});
}
else
{
if(type != 'update')
{
var graduate_coursecounter = $('#graduate_coursecounter').val();
var graduate_coursecounter = parseInt(graduate_coursecounter) - parseInt(1);
$('#graduate_coursecounter').val(graduate_coursecounter);
$('#graduate_courserow'+rowid).remove();
}
}
}
$('#add_service1').click(function()
{
var service_countercounter = $('#service_counter').val();
/*alert(service_countercounter);*/
var service_countercounter = parseInt(service_countercounter) + parseInt(1);
$('#service_counter').val(service_countercounter);
/*alert(service_countercounter);*/
$('#othrservice_counterbx').append('');
});
function delservice_counter(rowid,type=null,post_graduate_courseid=null, basePath=null)
{
if(type == 'update' && post_graduate_courseid!="" && confirm('Are You Sure Want To Delete This Record!'))
{
var post_graduate_coursecounter = $('#post_graduate_coursecounter').val();
var post_graduate_coursecounter = parseInt(post_graduate_coursecounter) - parseInt(1);
$('#post_graduate_coursecounter').val(post_graduate_coursecounter);
$.ajax({
url: basePath+"ajax/removepost_graduate_course",
data: {'post_graduate_courseid':post_graduate_courseid},
type: "post",
beforeSend: function() {
},
success: function(data){
//alert(data);
$('#post_graduate_courserow'+rowid).remove();
}
});
}
else
{
if(type != 'update')
{
var post_graduate_coursecounter = $('#post_graduate_coursecounter').val();
var post_graduate_coursecounter = parseInt(post_graduate_coursecounter) - parseInt(1);
$('#post_graduate_coursecounter').val(post_graduate_coursecounter);
$('#post_graduate_courserow'+rowid).remove();
}
}
}
$('#add_service').click(function(){
var service_counter = $('#service_counter').val();
var service_counter = parseInt(service_counter) + parseInt(1);
$('#service_counter').val(service_counter);
$('#othrservicebx').append('');
});
function delservice(rowid,type=null,doctorate_courseid=null, basePath=null)
{
if(type == 'update' && doctorate_courseid!="" && confirm('Are You Sure Want To Delete This Record!'))
{
var service_counter = $('#service_counter').val();
var service_counter = parseInt(service_counter) - parseInt(1);
$('#service_counter').val(service_counter);
$.ajax({
url: basePath+"ajax/removecompany_service",
data: {'doctorate_courseid':doctorate_courseid},
type: "post",
beforeSend: function() {
},
success: function(data){
//alert(data);
$('#doctorate_courserow'+rowid).remove();
}
});
}
else
{
if(type != 'update')
{
var service_counter = $('#service_counter').val();
var service_counter = parseInt(service_counter) - parseInt(1);
$('#service_counter').val(service_counter);
$('#doctorate_courserow'+rowid).remove();
}
}
}
function changestatus(basePath,rowid,obj,id,module)
{
var status = $("#"+rowid).val();
var tagstatus = $(obj).html();
if(status!="")
{
$.ajax({
url: basePath+"ajax/changestatus",
data: {'status':status, 'id':id, 'module':module},
type: "post",
beforeSend: function() {
$(obj).removeClass("label-danger");
$(obj).removeClass("label-success");
$(obj).html('');
},
success: function(data){
//alert(data);
status = data.trim();
if(status == "Active")
{
$(obj).html('');
$(obj).removeClass("label-danger");
$(obj).addClass("label-success");
}
else if(status == "Inactive")
{
$(obj).html('');
$(obj).removeClass("label-success");
$(obj).addClass("label-danger");
}
$("#"+rowid).val(status);
}
});
}
}
function changefeaturedsts(basePath,rowid,obj,id,module)
{
var status = $("#"+rowid).val();
var tagstatus = $(obj).html();
if(status!="")
{
$.ajax({
url: basePath+"ajax/changefeaturedsts",
data: {'status':status, 'id':id, 'module':module},
type: "post",
beforeSend: function() {
$(obj).removeClass("label-danger");
$(obj).removeClass("label-success");
$(obj).html('');
},
success: function(data){
//alert(data);
status = data.trim();
if(status == "Active")
{
$(obj).html('');
$(obj).removeClass("label-danger");
$(obj).addClass("label-success");
}
else if(status == "Inactive")
{
$(obj).html('');
$(obj).removeClass("label-success");
$(obj).addClass("label-danger");
}
$("#"+rowid).val(status);
}
});
}
}
function check(input)
{
if (input.value != document.getElementById('password').value)
{
input.setCustomValidity('Password Must be Matching.');
}
else
{
// input is valid -- reset the error message
input.setCustomValidity('');
}
}
function registration(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");
$('#nameErr').html('Enter First 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 = $('#password').val();
if (thisvalue == "")
{
$("#password").css("border-color","red");
$("#passwordErr").html("Enter Password");
error = 1;
}
var thisvalue = $('#date_of_birth').val();
if (thisvalue == "")
{
$("#password_confirm").css("border-color","red");
$("#password_confirmErr").html("Enter Confirm Password");
error = 1;
}
if($("#password").val()!=$("#password_confirm").val() && $("#password").val()!="")
{
$("#password_confirm").css("border-color","red");
$("#password_confirmErr").html("Password does not match");
error = 1;
}
var thisvalue = $('#dob').val();
if (thisvalue == "")
{
$("#dob").css("border-color","red");
$("#dobErr").html("Enter Date Of Birth");
error = 1;
}
var thisvalue = $(':radio[name="gender"]:checked').length;
if (thisvalue <1)
{
$("#genderErr").html("Select Gender");
error = 1;
}
var thisvalue = $('#state').val();
if (thisvalue == "")
{
$("#state").css("border-color","red");
$("#stateErr").html("Select State");
error = 1;
}
var thisvalue = $('#city').val();
if (thisvalue == "")
{
$("#city").css("border-color","red");
$("#cityErr").html("Enter City");
error = 1;
}
var thisvalue = $('#area_code').val();
if (thisvalue == "")
{
$("#area_code").css("border-color","red");
$("#area_codeErr").html("Enter Area Code");
error = 1;
}
var thisvalue = $('#mobile_no').val();
if (thisvalue == "")
{
$("#mobile_no").css("border-color","red");
$("#mobile_noErr").html("Enter Mobile No");
error = 1;
}
var thisvalue = $('#address').val();
if (thisvalue == "")
{
$("#address").css("border-color","red");
$("#addressErr").html("Enter Permanent Address");
error = 1;
}
var thisvalue = $('#current_address').val();
if (thisvalue == "")
{
$("#current_address").css("border-color","red");
$("#current_addressErr").html("Enter Current Address");
error = 1;
}
var thisvalue = $('#qualification').val();
if (thisvalue == "")
{
$("#qualification").css("border-color","red");
$("#qualificationErr").html("Enter Highest Qualification");
error = 1;
}
/*var v = grecaptcha.getResponse();
if(v.length == 0)
{
$('#captcha').html('You can\'t leave Captcha');
error = 1;
}
else
{
$('#captcha').html('');
}*/
if(error!=1)
{
$('#personal_div').fadeOut('slow');
$('#reg_tab1').removeClass('reg-highlight');
$('#reg_tab2').removeClass('reg-blur');
$('#professional_div').fadeIn('slow');
$('#reg_tab2').addClass('reg-highlight');
$('#reg_tab1').addClass('reg-blur');
}
var thisvalue = $('#job_title').val();
if (thisvalue == "")
{
$("#job_title").css("border-color","red");
$("#job_titleErr").html("Enter Job Title");
error = 1;
}
var thisvalue = $('#company_name').val();
if (thisvalue == "")
{
$("#company_name").css("border-color","red");
$("#company_nameErr").html("Enter Current Company");
error = 1;
}
var thisvalue = $('#total_exp').val();
if (thisvalue == "")
{
$("#total_exp").css("border-color","red");
$("#total_expErr").html("Select Experience!");
error = 1;
}
var thisvalue = $('#curent_loc').val();
if (thisvalue == "")
{
$("#curent_loc").css("border-color","red");
$("#curent_locErr").html("Enter Current Location!");
error = 1;
}
var thisvalue = $('#cur_an_sal').val();
if (thisvalue == "")
{
$("#cur_an_sal").css("border-color","red");
$("#cur_an_salErr").html("Select Current Salary!");
error = 1;
}
var thisvalue = $('#resume').val();
if (thisvalue == "")
{
$("#resume").css("border-color","red");
$("#resumeErr").html("Upload Resume!");
error = 1;
}
var ext = $('#resume').val().split(".").pop().toLowerCase();
if($.inArray(ext, ["doc","pdf",'docx']) == -1)
{
$("#resume").css("border-color","red");
$("#resumeErr").html("Invalid File Format!");
error = 1;
}
if(error!=1)
{
var fd = new FormData($('#registerfrm')[0]);
$.ajax({
url: basePath+'ajax/registration',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
$('#regimsgloader').html('');
},
success: function(result){
//alert(data);
if(result=='exist' && result!="")
{
$('#regimsgloader').html('You Have Already Registered With Us !
');
}
else if(result=='fail' && result!="")
{
$('#regimsgloader').html('Something Went Wrong, Please Try Again Later!
');
}
else
{
$('input:text').val('');
$('input:password').val('');
$('#regimsgloader').html('Congratulation! You Have Successfully Register With Us.
');
}
setTimeout(function(){ $('#regimsgloader').html(''); }, 3000);
$('html,body').animate({
scrollTop: $("body").offset().top
}, 'slow');
}
});
}
return false;
}
function loginuser(basePath)
{
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var useremail = $('#useremail').val();
var userpassword = $('#userpassword').val();
var thisvalue = $('#useremail').val();
if (thisvalue == "") {
$('#useremail').css("border-color","red");
$('#useremailErr').html('Enter Your Email!');
error = 1;
}
var thisvalue = $('#useremail').val();
if (!email_pattern_match.test($('#useremail').val()) && thisvalue != "") {
$('#useremail').css("border-color","red");
$('#useremailErr').html('Invalid Email Format!');
error = 1;
}
var thisvalue = $('#userpassword').val();
if (thisvalue == "") {
$('#userpassword').css("border-color","red");
$('#userpasswordErr').html('Please Enter Your Password!');
error = 1;
}
if(error!=1)
{
$.ajax({
type: "POST",
url: basePath+'ajax/loginuser',
data: {'useremail':useremail,'userpassword':userpassword},
beforeSend: function() {
$('#loginmsgloader').html('');
},
success: function(result){
if(result=='error' && result!="")
{
$('#loginmsgloader').html('Invalid Login Credential or Your Account Is Inactive!
');
}
else
{
$('input:text').val('');
$('input:password').val('');
$('#loginmsgloader').html('Please Wait, We Are Directing To Dashboard,
');
setTimeout(function(){ window.location.href = basePath+"dashboard"; }, 3000);
return false;
}
setTimeout(function(){ $('#loginloader').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('');
},
success: function(result){
if(result=='error' && result!="")
{
$('#forgetloader').html('Invalid Email ID!
');
}
else
{
$('input:text').val('');
$('#forgetloader').html('We Have Send An Email, Please Check Your Inbox Of Registered Email!
');
}
setTimeout(function(){ $('#forgetloader').html(''); }, 4000);
},
});
}
return false;
}
function myprofile(baseurl)
{
var error = "";
var thisvalue = $('#title').val();
if (thisvalue == "") {
$('#title').css("border-color","red");
error = 1;
}
var thisvalue = $('#name').val();
if (thisvalue == "") {
$('#name').css("border-color","red");
error = 1;
}
var thisvalue = $('#company').val();
if (thisvalue == "") {
$('#company').css("border-color","red");
error = 1;
}
var thisvalue = $('#street').val();
if (thisvalue == "") {
$('#street').css("border-color","red");
error = 1;
}
var thisvalue = $('#post_code').val();
if (thisvalue == "") {
$('#post_code').css("border-color","red");
error = 1;
}
var thisvalue = $('#city').val();
if (thisvalue == "") {
$('#city').css("border-color","red");
error = 1;
}
var thisvalue = $('#region').val();
if (thisvalue == "") {
$('#region').css("border-color","red");
error = 1;
}
var thisvalue = $('#country').val();
if (thisvalue == "") {
$('#country').css("border-color","red");
error = 1;
}
var thisvalue = $('#phone').val();
if (thisvalue == "") {
$('#phone').css("border-color","red");
error = 1;
}
if(error!=1)
{
$.ajax({
type: "POST",
url: baseurl+'ajax/myprofile_proccess',
data: $('#myprofilefrm').serialize(),
beforeSend: function() {
$('#profileloader').html('');
},
success: function(result){
if(result=='error' && result!="")
{
$('#profileloader').html('Invalid Email ID!
');
}
else
{
$('#profileloader').html('Info. Updated Successfully!
');
}
setTimeout(function(){ $('#profileloader').html(''); }, 4000);
},
});
}
return false;
}
function changepassword(baseurl)
{
error = '';
var thisvalue = $('#oldpassword').val();
if (thisvalue == "") {
$('#oldpassword').css("border-color","red");
error = 1;
}
var thisvalue = $('#newpassword').val();
if (thisvalue == "") {
$('#newpassword').css("border-color","red");
error = 1;
}
var thisvalue = $('#newpassword').val();
if (thisvalue == "") {
$('#newpassword').css("border-color","red");
error = 1;
}
var thisvalue = $('#confpassword').val();
if (thisvalue == "") {
$('#confpassword').css("border-color","red");
error = 1;
}
var thisvalue = $('#confpassword').val();
if (thisvalue != $('#newpassword').val()) {
$('#confpassword').css("border-color","red");
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 taskcomment(baseurl)
{
error = '';
var thisvalue = $('#commentstatus').val();
if (thisvalue == "") {
$('#commentstatus').css("border-color","red");
error = 1;
}
var thisvalue = $('#comment').val();
if (thisvalue == "") {
$('#comment').css("border-color","red");
error = 1;
}
if(error!=1)
{
$.ajax({
type: "POST",
url: baseurl+'ajax/taskcomment',
data: $('#taskcommentfrm').serialize(),
beforeSend: function() {
$('#msgloader').html('');
},
success: function(result){
if(result=='error' && result!="")
{
$('#msgloader').html('Something went wrong, try again after sometime!
');
}
else
{
$('#msgloader').html('Comment Submitted Successfully!
');
setTimeout(function(){ $('#msgloader').html(''); location.reload(); }, 3000);
}
setTimeout(function(){ $('#msgloader').html(''); }, 3000);
},
});
}
return false;
}
function getjoblist(baseurl)
{
$.ajax({
type: "POST",
url: baseurl+'ajax/getjoblist',
data: $('#search_filter').serialize(),
beforeSend: function() {
$('#recent-opening').html('');
},
success: function(result){
$('#recent-opening').html(result);
$('html,body').animate({
scrollTop: $("body").offset().top
}, 'slow');
},
});
}
function changeUsersts(baseurl)
{
var current_status = $('#current_status').val();
var userid = $('#userid').val();
var jobid = $('#jobid').val();
if(current_status!="" && userid !="" && jobid !="")
{
$.ajax({
type: "POST",
url: baseurl+'ajax/changeUsersts',
data: {'current_status':current_status, 'userid':userid, 'jobid':jobid},
beforeSend: function() {
$('#msgloader').html('');
},
success: function(result){
if(result=='error' && result!="")
{
$('#msgloader').html('Something went wrong, try again after sometime!
');
}
else
{
$('#msgloader').html('Status Updated Successfully!
');
setTimeout(function()
{
$('#msgloader').html('');
if(current_status == 'Shortlist')
{
$('#invitationbx').fadeIn('Slow');
}
}, 3000);
}
},
});
}
else
{
$('#msgloader').html('Please Select Atleast One Status
');
setTimeout(function(){ $('#msgloader').html(''); }, 3000);
}
}
function sendInvitaion(baseurl)
{
error = '';
var userid = $('#userid').val();
var jobid = $('#jobid').val();
var thisvalue = $('#subject').val();
if (thisvalue == "") {
$('#subject').css("border-color","red");
error = 1;
}
var thisvalue = $('#job_location').val();
if (thisvalue == "") {
$('#job_location').css("border-color","red");
error = 1;
}
var thisvalue = $('#interview_date').val();
if (thisvalue == "") {
$('#interview_date').css("border-color","red");
error = 1;
}
if(error!=1)
{
$.ajax({
type: "POST",
url: baseurl+'ajax/sendInvitaion',
data: $('#invitationfrm').serialize(),
beforeSend: function() {
$('#msgloader').html('');
},
success: function(result){
if(result=='error' && result!="")
{
$('#msgloader').html('Something went wrong, try again after sometime!
');
}
else
{
$('#msgloader').html('Invitation Sent Successfully!
');
setTimeout(function(){ $('#msgloader').html(''); window.location.href = baseurl+"siteadmin/user/viewuser/"+userid; }, 3000);
}
$('html,body').animate({
scrollTop: $("body").offset().top
}, 'slow');
},
});
}
else
{
$('html,body').animate({
scrollTop: $("body").offset().top
}, 'slow');
}
return false;
}
function sameAddress(checked)
{
if(checked==true)
{
if($("#address").val()!="")
{
$("#current_address").val($("#address").val())
}
}
else
{
$("#current_address").val('')
}
}
function submitPersonalDetails(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");
$('#nameErr').html('Enter First Name!');
error = 1;
}
var thisvalue = $('#dob').val();
if (thisvalue == "")
{
$("#dob").css("border-color","red");
$("#dobErr").html("Enter Date Of Birth");
error = 1;
}
var thisvalue = $(':radio[name="gender"]:checked').length;
if (thisvalue <1)
{
$("#genderErr").html("Select Gender");
error = 1;
}
var thisvalue = $('#state').val();
if (thisvalue == "")
{
$("#state").css("border-color","red");
$("#stateErr").html("Select State");
error = 1;
}
var thisvalue = $('#city').val();
if (thisvalue == "")
{
$("#city").css("border-color","red");
$("#cityErr").html("Enter City");
error = 1;
}
var thisvalue = $('#area_code').val();
if (thisvalue == "")
{
$("#area_code").css("border-color","red");
$("#area_codeErr").html("Enter Area Code");
error = 1;
}
var thisvalue = $('#mobile').val();
if (thisvalue == "")
{
$("#mobile").css("border-color","red");
$("#mobileErr").html("Enter Mobile No");
error = 1;
}
var thisvalue = $('#address').val();
if (thisvalue == "")
{
$("#address").css("border-color","red");
$("#addressErr").html("Enter Permanent Address");
error = 1;
}
var thisvalue = $('#current_address').val();
if (thisvalue == "")
{
$("#current_address").css("border-color","red");
$("#current_addressErr").html("Enter Current Address");
error = 1;
}
var thisvalue = $('#qualification').val();
if (thisvalue == "")
{
$("#qualification").css("border-color","red");
$("#qualificationErr").html("Enter Highest Qualification");
error = 1;
}
if(error!=1)
{
var fd = new FormData($('#personal_info_form')[0]);
$.ajax({
url: basePath+'ajax/submitPersonalDetails',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
$('#regimsgloader').html('');
},
success: function(result){
if(result=='fail' && result!="")
{
$('#regimsgloader').html('Something Went Wrong, Please Try Again Later!
');
}
else
{
$('#regimsgloader').html('Personal Infomation Updated Successfully!.
');
}
setTimeout(function(){ $('#regimsgloader').html(''); }, 3000);
$('html,body').animate({
scrollTop: $("body").offset().top
}, 'slow');
}
});
}
return false;
}
function submitProfessionalDetailsValidate(basePath)
{
var thisvalue = $('#job_title').val();
if (thisvalue == "")
{
$("#job_title").css("border-color","red");
$("#job_titleErr").html("Enter Job Title");
error = 1;
}
var thisvalue = $('#company_name').val();
if (thisvalue == "")
{
$("#company_name").css("border-color","red");
$("#company_nameErr").html("Enter Current Company");
error = 1;
}
var thisvalue = $('#total_exp').val();
if (thisvalue == "")
{
$("#total_exp").css("border-color","red");
$("#total_expErr").html("Select Experience!");
error = 1;
}
var thisvalue = $('#curent_loc').val();
if (thisvalue == "")
{
$("#curent_loc").css("border-color","red");
$("#curent_locErr").html("Enter Current Location!");
error = 1;
}
var thisvalue = $('#cur_an_sal').val();
if (thisvalue == "")
{
$("#cur_an_sal").css("border-color","red");
$("#cur_an_salErr").html("Select Current Salary!");
error = 1;
}
var thisvalue = $('#resume').val();
var ext = $('#resume').val().split(".").pop().toLowerCase();
if($.inArray(ext, ["doc","pdf",'docx']) == -1 && thisvalue!="")
{
$("#resume").css("border-color","red");
$("#resumeErr").html("Invalid File Format!");
error = 1;
}
if(error!=1)
{
var fd = new FormData($('#professional_info_form')[0]);
$.ajax({
url: basePath+'ajax/submitProfessionalDetails',
data: fd,
contentType: false,
cache: false,
processData:false,
type: "post",
beforeSend: function() {
$('#regimsgloader').html('');
},
success: function(result){
if(result=='fail' && result!="")
{
$('#regimsgloader').html('Something Went Wrong, Please Try Again Later!
');
}
else
{
$('#regimsgloader').html('Professional Infomation Updated Successfully!.
');
}
setTimeout(function(){ $('#regimsgloader').html(''); }, 3000);
$('html,body').animate({
scrollTop: $("body").offset().top
}, 'slow');
}
});
}
return false;
}
function validatecontactus(basePath)
{
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var phone_pattern_match = /^[0-9]+$/;
var url_validate = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
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 First 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 first name');
error = 1;
}
var thisvalue = $('#lname').val();
if (thisvalue == "") {
$('#lname').css("border-color","red");
$('#lnameErr').html('Enter Last Name!');
error = 1;
}
if(regurl.test($("#lname").val()))
{
$('#lname').css("border-color","red");
$('#lnameErr').html('URL links are not allowed, please remove URL link from the last 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 = $('#country').val();
if (thisvalue == "") {
$('#country').css("border-color","red");
$('#countryErr').html('Please Select Your Country!');
error = 1;
}
var thisvalue = $('#phone').val();
if (thisvalue == "") {
$('#phone').css("border-color","red");
$('#phoneErr').html('Please Enter Phone Number!');
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 = $('#cname').val();
if (thisvalue == "") {
$('#cname').css("border-color","red");
$('#cnameErr').html('Please Enter Your Company Name!');
error = 1;
}
if(regurl.test($("#cname").val()))
{
$('#cname').css("border-color","red");
$('#cnameErr').html('URL links are not allowed, please remove URL link from the company name');
error = 1;
}
var thisvalue = $('#message').val();
if (thisvalue == "") {
$('#message').css("border-color","red");
$('#messageErr').html('Please Type Your 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 Ad Details');
error = 1;
}
var website = $('#website').val();
if (website == "") {
$('#website').css("border-color","red");
$('#websiteErr').html('Please Enter Company Website!');
error = 1;
}
if (!url_validate.test($('#website').val()) && website !="") {
$('#website').css("border-color","red");
$('websiteErr').html('Enter Valid URL!');
error = 1;
}
var v = grecaptcha.getResponse();
if(v.length == 0)
{
$('#captcha').html('You can\'t leave Captcha Code');
error = 1;
}
if(error!=1)
{
$.ajax({
type: "POST",
url: basePath+"ajax/contactprocess",
data: $('#contactfrm').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
{
$('#contactfrm')[0].reset();
grecaptcha.reset();
$('input:text').val('');
$('textarea').val('');
$('select').val('');
$('#msgloader').html('Message Send Successfully!
');
}
setTimeout(function(){ $('#msgloader').html(''); }, 5000);
},
});
}
return false;
}
function clickenquiry(basePath)
{
var name = $('#name').val();
var email = $("#email").val();
var phone = $('#phone').val();
if (name != '' && email != '') {
$.ajax({
type: "POST",
url: basePath+"ajax/click_enquiry",
data: {
name : name,
email: email,
phone: phone
},
success: function(result){
},
});
}
}
function shortbyrating(baseurl) {
var fd = new FormData($('#filterfrm')[0]);
$.ajax({
url: baseurl + 'ajax/shortbyrating',
data: fd,
contentType: false,
cache: false,
processData: false,
type: "post",
beforeSend: function() {
$('#resultdata').html('');
},
success: function(result) {
if(result=='error' && result!="")
{
$('#resultdata').html('Something went wrong, try again after sometime!
');
}
else
{
$('#resultdata').html(result);
}
}
});
}
function validatecontactusfrm(basePath)
{
var error = "";
var email_pattern_match = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var phone_pattern_match = /^[0-9]+$/;
var url_validate = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
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 First 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 first name');
error = 1;
}
var thisvalue = $('#lname').val();
if (thisvalue == "") {
$('#lname').css("border-color","red");
$('#lnameErr').html('Enter Last Name!');
error = 1;
}
if(regurl.test($("#lname").val()))
{
$('#lname').css("border-color","red");
$('#lnameErr').html('URL links are not allowed, please remove URL link from the last 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 = $('#country').val();
if (thisvalue == "") {
$('#country').css("border-color","red");
$('#countryErr').html('Please Select Your Country!');
error = 1;
}
var thisvalue = $('#phone').val();
if (thisvalue == "") {
$('#phone').css("border-color","red");
$('#phoneErr').html('Please Enter Phone Number!');
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 = $('#message').val();
if (thisvalue == "") {
$('#message').css("border-color","red");
$('#messageErr').html('Please Type Your 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 v = grecaptcha.getResponse();
if(v.length == 0)
{
$('#captcha').html('You can\'t leave Captcha Code');
error = 1;
}
if(error!=1)
{
//alert(basePath+"ajax/contactusprocess")
$.ajax({
type: "POST",
url: basePath+"ajax/contactusprocess",
data: $('#contactusfrm').serialize(),
beforeSend: function() {
// setting a timeout
$('#msgloader').html('Please Wait!
');
$('#sbmtbtn').attr('disabled',true);
},
success: function(result){
//return false;
//alert(result)
if(result=='fail' && result!="")
{
$('#msgloader').html('Something Went Wrong Please Try Again Later!
');
$('#sbmtbtn').removeAttr('disabled');
}
else
{
$('#contactusfrm')[0].reset();
grecaptcha.reset();
$('input:text').val('');
$('textarea').val('');
$('select').val('');
$('#msgloader').html('Message Send Successfully!
');
}
setTimeout(function(){ $('#msgloader').html(''); }, 5000);
},
});
}
return false;
}
$("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');
});