$(document).ready(function(){
//
$('.press_enter').keypress(function(e) {
if(e.which == 13) {
searchFilter();
}
});
//Disable autocomplete off features
$("input, select, textarea").attr("autocomplete", "off");
//Disable autocomplete off features
$('body').on('keypress', '.numeric', function(e){
return isNumberKey(e);
});
$('.textarea').wysihtml5();
$('.tooltips').tooltip();
$('[data-toggle="tooltip"]').tooltip();
$('.timepicker').timepicker({
showInputs: false
})
$('.datepicker').datepicker({
format: 'dd/mm/yyyy',
endDate: '+0d',
scrollInput : false,
autoclose: true
});
$('.datepicker_1').datepicker({
format: 'dd/mm/yyyy',
scrollInput : false,
autoclose: true
});
$('div.expander').expander({
slicePoint: 20,
widow: 2,
expandEffect: 'show',
userCollapseText: '[^]'
});
$('.daterange').daterangepicker({
locale: {
format: 'DD/MM/YYYY'
},
opens: 'right'
});
/*** Registration date validation start ***/
$("#last_activity_start").datepicker({
todayBtn: 1,
autoclose: true,
}).on('changeDate', function (selected) {
var minDate = new Date(selected.date.valueOf());
$('#last_activity_end').datepicker('setStartDate', minDate);
});
$("#last_activity_end").datepicker()
.on('changeDate', function (selected) {
var maxDate = new Date(selected.date.valueOf());
$('#last_activity_start').datepicker('setEndDate', maxDate);
});
/*** Registration date validation end ***/
/*** Last activity date validation start ***/
$("#reg_date_start").datepicker({
todayBtn: 1,
autoclose: true,
}).on('changeDate', function (selected) {
var minDate = new Date(selected.date.valueOf());
$('#reg_date_end').datepicker('setStartDate', minDate);
});
$("#reg_date_end").datepicker()
.on('changeDate', function (selected) {
var maxDate = new Date(selected.date.valueOf());
$('#reg_date_start').datepicker('setEndDate', maxDate);
});
/*** Last Activity date validation end ***/
/*** Company name auto suggest list start ***/
/*$("#company_name").autocomplete({
source: site_url+'masters/getCompanyListByName',
});*/
/*** Company name auto suggest list end ***/
$('#service_id').select2();
//EVENT MODULE*************************************
var lpdate = '';
$('#last_participate_date').datepicker({
format: 'dd/mm/yyyy',
endDate: $('#event_date').val(),
scrollInput : false,
autoclose: true
}).on('changeDate', function (selected){ lpdate = new Date(selected.date.valueOf()); });
$('#event_date').datepicker({
format: 'dd/mm/yyyy',
startDate: new Date(),
scrollInput : false,
autoclose: true
}).on('changeDate', function (selected) {
var maxDate = new Date(selected.date.valueOf());
if($('#last_participate_date').val() != '' && lpdate > maxDate)
{
$('#last_participate_date').val('');
}
$('#last_participate_date').datepicker('setEndDate', maxDate);
});;
$('#frm_event_form select[name=event_status]').change(function(){
if($(this).val() == '3')
{
alert('Make sure you have updated the new date for this event');
//$('#event_date').val('');
$("html, body").animate({ scrollTop: 0 }, "slow");
$('#event_date').focus();
}
});
$('#add_sponsor').click(function(){
$(this).closest('.form-group').after($('#sample_img_div_hidden').html());
});
$('body').on('click', '.delete_sponsor', function(){
$(this).closest('.form-group').remove();
});
$('body').on('click', '.delete_sponsor_db', function(e){
e.preventDefault();
var cnf = confirm('Are you sure to delete this sponsor');
var obj = $(this);
if(cnf)
{
$.ajax({ type : 'post', url : site_url+'events/removeSponsor/', data : { id : $(this).data('spid') } ,
success : function(msg)
{
if(msg == '1')
{
alert('Sponser Deleted Successfully');
obj.closest('.spitem').remove();
}
},
error : function()
{
alert('Something went wrong');
}
});
}
});
//EVENT MODULE ENDS***********************************
});
/***************Image upload browse *******************/
$(document).on('click', '#close-preview', function(){
$('.image-preview').popover('hide');
// Hover befor close the preview
$('.image-preview').hover(
function () {
$('.image-preview').popover('show');
},
function () {
$('.image-preview').popover('hide');
}
);
});
$(function() {
// Create the close button
var closebtn = $('<button/>', {
type:"button",
text: 'x',
id: 'close-preview',
style: 'font-size: initial;',
});
closebtn.attr("class","close pull-right");
// Set the popover default content
$('.image-preview').popover({
trigger:'manual',
html:true,
title: "<strong>Preview</strong>"+$(closebtn)[0].outerHTML,
content: "There's no image",
placement:'bottom'
});
// Clear event
$('.image-preview-clear').click(function(){
$('.image-preview').attr("data-content","").popover('hide');
$('.image-preview-filename').val("");
$('.image-preview-clear').hide();
$('.image-preview-input input:file').val("");
$(".image-preview-input-title").text("Browse");
});
// Create the preview image
$(".image-preview-input input:file").change(function (){
var img = $('<img/>', {
id: 'dynamic',
width:250,
height:200
});
var file = this.files[0];
var reader = new FileReader();
// Set preview image into the popover data-content
reader.onload = function (e) {
$(".image-preview-input-title").text("Change");
$(".image-preview-clear").show();
$(".image-preview-filename").val(file.name);
img.attr('src', e.target.result);
$(".image-preview").attr("data-content",$(img)[0].outerHTML).popover("show");
}
reader.readAsDataURL(file);
});
});
/*** Custom javascript start here ***/
function isNumberKey(event)
{
var charCode = (event.which) ? event.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 39 && charCode != 37 && charCode != 46 && charCode != 9 && charCode != 16 && charCode != 45 && charCode != 36 && charCode != 35)
return false;
return true;
}
function getUserPasswordResetModal(user_id)
{
$('#user_pass_msg').html('');
$('#user_reset_password').modal('show');
$('#user_forgot_user_id').val(user_id);
}
function resetUserPassword()
{
var user_id = $('#user_forgot_user_id').val();
var new_user_password = $.trim($('#new_user_password').val());
var new_user_retype_password = $.trim($('#new_user_retype_password').val());
if(new_user_password == '' || new_user_retype_password == '') {
$('#user_pass_msg').html('<small class="text-danger">Required fields can not be blank.</small>');
} else if(new_user_password != new_user_retype_password) {
$('#user_pass_msg').html('<small class="text-danger">Pasword mismatched.</small>');
} else {
$('#user_pass_msg').html('');
$('#user_pass_msg').html('<i class="fa fa-spinner"></i> Wait...');
$.ajax({
type: 'POST',
url: site_url+'users/resetUserPassword',
data: {user_id:user_id,new_user_password:new_user_password,new_user_retype_password:new_user_retype_password},
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$("#frm_user_password_reset").trigger('reset');
$('#user_pass_msg').html('<small class="text-success">'+obj.msg+'</small>');
$.when(setTimeout("$('#user_reset_password').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.href = site_url+'users'",delay_time);
});
} else {
$('#user_pass_msg').html('<small class="text-danger">'+obj.msg+'</small>');
}
}
});
}
}
function searchFilter(page_num)
{
page_num = page_num?page_num:0;
var data = $('#frm_search_filter').serializeArray();
var url_link = $.trim($('#url_link').val());
data.push({name: 'page', value: page_num});
$('.loading').show();
$.ajax({
type: 'POST',
url: site_url+url_link+page_num,
data:data,
beforeSend: function () {
},
success: function (html) {
$('#data_list').html(html);
$('.tooltips').tooltip();
$('#example2').DataTable({searching: false, paging: false, bInfo: false});
}
});
$('.loading').fadeOut("slow");
}
function searchClear()
{
if($('#member_status').length > 0)
$('#member_status option').removeAttr('selected');
$("#frm_search_filter").trigger('reset');
searchFilter();
}
function memberClear()
{
$("#frm_search_filter").trigger('reset');
$("#data_list").html('');
}
function changeMemberStatus(member_status, member_id)
{
var url = site_url+'members/changeMemberStatus/'+member_status+'/'+member_id;
var msg = 'Do you really want to change the member status?';
confirmBox(msg, url);
}
function changeAuthorizedStatus(member_authorize_status, member_id)
{
var url = site_url+'members/changeMemberAuthorizedStatus/'+member_authorize_status+'/'+member_id;
var msg = 'Do you really want to change the member authorization status?';
confirmBox(msg, url);
}
function changeMultipleLoginAllowStatus(is_multiple_login_allowed, member_id)
{
var url = site_url+'members/changeMultipleLoginAllowStatus/'+is_multiple_login_allowed+'/'+member_id;
var msg = 'Do you really want to change the member multiple login allow status?';
confirmBox(msg, url);
}
function bulkMemberActive(frm_name)
{
var status = $('#bulk_member_status').val();
var error = 0;
var msg = "";
if(status < 1) {
msg = "<span class=\"text-danger\">*</span> Select Status<br>";
error =1;
}
var checked = 0
$('.clmem').each(function(){
if($(this).is(":checked") == true) checked = 1;
})
if(checked == 0){
msg += "<span class=\"text-danger\">*</span> Select Members<br>";
error = 1;
}
if(error == 1){
$('#modal_msg').find('.modal-body').html(msg);
$('#modal_msg').find('#modal_msg_title').html("Bulk Status Update");
$('#modal_msg').modal('show');
return false;
}
var url = site_url+'members/bulkMemberActive';
var msg = 'Do you really want to Active all selected members?';
confirmBoxFormSubmit(msg, url, frm_name);
}
function memberPrivacySettingModel(member_id, member_name)
{
//$('#privacy_header_title').html(member_name+' Privacy Setting');
if(member_id > 0) {
var url = site_url+'members/ajaxMemberPrivacySetting';
$.post(url,{member_id:member_id},function(data){
$('#privacy_setting_data').html(data);
});
} else {
$('#privacy_setting_data').html('<small class="danger">Invalid request.</small>');
}
$('#privacy_setting').modal('show');
}
function memberPersonalEditModel()
{
$('#personal_info_edit').modal('show');
$('.profile_img_focus').hide();
}
function updateMemberPersonal()
{
var personal_member_id = $('#personal_member_id').val();
var member_mobile = $('#member_mobile').val();
var member_first_name = $('#member_first_name').val();
var member_last_name = $('#member_last_name').val();
var member_dob = $('#member_dob').val();
var member_profile_image = $('#member_profile_image').val();
var form_data = new FormData($('#frm_personal_info_edit')[0]);
if(member_mobile == '' || member_first_name == '' || member_last_name == '' || member_dob == '') {
$('#personal_member_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else {
$('#personal_member_msg').html('');
$('#personal_member_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
$('#btn_member_personal_edit').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberPersonalInfoUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$('#btn_member_personal_edit').removeAttr('disabled');
$('#personal_member_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#personal_info_edit').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#personal_member_msg').html('<small class="text-danger">'+obj.msg+'</small>');
}
}
});
}
}
function memberContactInfoAddEmailModel()
{
$('#email_label').val('');
$('#email_value').val('');
$('#contact_info_member_email_add_msg').html('');
$('#contact_info_emails_add').modal('show');
}
function saveMemberContactInfoEmail()
{
var mailregexp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var personal_member_id = $('#personal_member_id').val();
var email_label = $.trim($('#email_label').val());
var email_value = $.trim($('#email_value').val());
var form_data = new FormData($('#frm_contact_info_email_add')[0]);
if(email_label == '' || email_value == '') {
$('#contact_info_member_email_add_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else if(mailregexp.test(email_value) == false) {
$('#contact_info_member_email_add_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Invalid email format.</small>')
} else {
$('#contact_info_member_email_add_msg').html('');
$('#contact_info_member_email_add_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_member_contact_info_email_add').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberContactInfoEmailSave',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$('#email_label').val('');
$('#email_value').val('');
//$('#btn_member_contact_info_email_add').removeAttr('disabled');
$('#contact_info_member_email_add_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#contact_info_emails_add').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#contact_info_member_email_add_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
function memberContactInfoEditEmailModel(member_email_id, member_email_label, member_email_value)
{
$('#contact_info_member_email_edit_msg').html('');
$('#contact_info_emails_edit').modal('show');
$('#member_email_id').val(member_email_id);
$('#email_label_edit').val(member_email_label);
$('#email_value_edit').val(member_email_value);
}
function UpdateMemberContactInfoEmail()
{
var mailregexp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var member_email_id = $('#member_email_id').val();
var email_label = $.trim($('#email_label_edit').val());
var email_value = $.trim($('#email_value_edit').val());
var form_data = new FormData($('#frm_contact_info_email_edit')[0]);
if(email_label == '' || email_value == '') {
$('#contact_info_member_email_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else if(mailregexp.test(email_value) == false) {
$('#contact_info_member_email_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Invalid email format.</small>')
} else {
$('#contact_info_member_email_edit_msg').html('');
$('#contact_info_member_email_edit_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_member_contact_info_email_edit').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberContactInfoEmailUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
//$('#btn_member_contact_info_email_edit').removeAttr('disabled');
$('#contact_info_member_email_edit_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#contact_info_emails_edit').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#contact_info_member_email_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
function memberContactInfoAddPhoneModel()
{
$('#phone_label').val('');
$('#phone_value').val('');
$('#contact_info_member_phone_add_msg').html('');
$('#contact_info_phones_add').modal('show');
}
function saveMemberContactInfoPhone()
{
var personal_member_id = $('#personal_member_id').val();
var phone_label = $.trim($('#phone_label').val());
var phone_value = $.trim($('#phone_value').val());
var form_data = new FormData($('#frm_contact_info_phone_add')[0]);
if(phone_label == '' || phone_value == '') {
$('#contact_info_member_phone_add_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else {
$('#contact_info_member_phone_add_msg').html('');
$('#contact_info_member_phone_add_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#contact_info_member_phone_add_msg').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberContactInfoPhoneSave',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$('#phone_label').val('');
$('#phone_value').val('');
//$('#contact_info_member_phone_add_msg').removeAttr('disabled');
$('#contact_info_member_phone_add_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#contact_info_phones_add').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#contact_info_member_phone_add_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
function memberContactInfoEditPhoneModel(member_phone_id, member_phone_label, member_phone_value)
{
$('#contact_info_member_phone_edit_msg').html('');
$('#contact_info_phones_edit').modal('show');
$('#member_phone_id').val(member_phone_id);
$('#phone_label_edit').val(member_phone_label);
$('#phone_value_edit').val(member_phone_value);
}
function UpdateMemberContactInfoPhone()
{
var member_phone_id = $('#member_phone_id').val();
var phone_label = $.trim($('#phone_label_edit').val());
var phone_value = $.trim($('#phone_value_edit').val());
var form_data = new FormData($('#frm_contact_info_phone_edit')[0]);
if(phone_label == '' || phone_value == '') {
$('#contact_info_member_phone_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else {
$('#contact_info_member_phone_edit_msg').html('');
$('#contact_info_member_phone_edit_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_member_contact_info_phone_edit').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberContactInfoPhoneUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
//$('#btn_member_contact_info_phone_edit').removeAttr('disabled');
$('#contact_info_member_phone_edit_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#contact_info_phones_edit').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#contact_info_member_phone_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
function memberContactInfoEditAddressModel(address_type, member_address_id)
{
$('#contact_info_member_address_edit_msg').html('');
//$('#member_address_type').html(address_type);
$('#member_address_id').val(member_address_id);
$.ajax({
type: 'POST',
url: site_url+'members/ajaxMemberAddressById',
data: {member_address_id:member_address_id},
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$('#address_label_edit').val(obj.address.address_label);
$('#address_line_1_edit').val(obj.address.address_line_1);
$('#address_line_2_edit').val(obj.address.address_line_2);
$('#zip_code_edit').val(obj.address.zip_code);
$('#country_edit').val(obj.address.country);
$('#state_edit').val(obj.address.state);
$('#city_edit').val(obj.address.city);
$('#address_type_edit').val(obj.address.address_type);
} else {
$('#contact_info_member_address_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
$('#contact_info_addresses_edit').modal('show');
}
function UpdateMemberContactInfoAddress()
{
var member_address_id = $('#member_address_id').val();
var address_label = $.trim($('#address_label_edit').val());
var address_line_1 = $.trim($('#address_line_1_edit').val());
var zip = $.trim($('#zip_code_edit').val());
var country = $.trim($('#country_edit').val());
var state = $.trim($('#state_edit').val());
var city = $.trim($('#city_edit').val());
var address_type = $.trim($('#address_type_edit').val());
var form_data = new FormData($('#frm_contact_info_address_edit')[0]);
if(address_label == '' || address_line_1 == '' || zip == '' || country == '' || state == '' || city == '' || address_type == '') {
$('#contact_info_member_address_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else {
$('#contact_info_member_address_edit_msg').html('');
$('#contact_info_member_address_edit_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_member_contact_info_address_edit').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberContactInfoAddressUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
//$('#btn_member_contact_info_address_edit').removeAttr('disabled');
$('#contact_info_member_address_edit_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#contact_info_addresses_edit').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#contact_info_member_address_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
function customFieldsEditModel(meta_field_value_id, meta_field_id, module_id, general_category_id, member_id, default_value)
{
$('#custom_field_edit_msg').html('');
$('#meta_field_value_id').val(meta_field_value_id);
$('#meta_field_id').val(meta_field_id);
$('#module_id').val(module_id);
$('#general_category_id').val(general_category_id);
$('#member_id').val(member_id);
$('#default_value_edit').val(default_value);
$('#custom_fields_edit').modal('show');
}
/*function customEduProFieldsEditModel(meta_field_value_id, default_value)
{
$('#custom_field_pro_edu_edit_msg').html('');
$('#default_value_pro_edu_edit').val(default_value);
$('#custom_fields_pro_edu_edit').modal('show');
}*/
function memberSpeakModel(member_id, member_name, member_speak, is_show_on_home_page)
{
$('#member_speak_title').html('<h4 class="modal-title">'+member_name+' (Speak)</h4>');
$('#member_speak_member_id').val(member_id);
$('textarea#member_speak_count').val(member_speak);
$('#is_show_on_home_page').val(is_show_on_home_page);
$('#member_speak_msg').html('');
$('#member_speak').modal('show');
}
function updateMemberSpeak()
{
var member_speak = $.trim($('textarea#member_speak_count').val());
var form_data = new FormData($('#frm_member_speak')[0]);
if(member_speak == '') {
$('#member_speak_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else if(member_speak.length > 200) {
$('#member_speak_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Sorry, Alumni speak can not be longer than 200 characters.</small>')
} else {
$('#member_speak_msg').html('');
$('#member_speak_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_member_speak').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxUpdateMemberSpeak',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
//$('#btn_member_speak').removeAttr('disabled');
$('#member_speak_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#member_speak').modal('hide')",delay_time)).done(function( x ) {
searchFilter(parseInt($('.sorting_1:first').text()) - 1);
});
} else {
$('#member_speak_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
function updateCustomFieldValue()
{
var default_value = $.trim($('#default_value_edit').val());
var form_data = new FormData($('#frm_custom_field_value_edit')[0]);
if(default_value == '') {
$('#custom_field_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else {
$('#custom_field_edit_msg').html('');
$('#custom_field_edit_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_custom_field_value_edit').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxCustomFieldValueUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
//$('#btn_custom_field_value_edit').removeAttr('disabled');
$('#custom_field_edit_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#custom_fields_edit').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#custom_field_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
/*function updateCustomFieldProEduValue()
{
var default_value = $.trim($('#default_value_pro_edu_edit').val());
var form_data = new FormData($('#frm_custom_field_pro_edu_value_edit')[0]);
if(default_value == '') {
$('#custom_field_pro_edu_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else {
$('#custom_field_pro_edu_edit_msg').html('');
$('#custom_field_pro_edu_edit_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_custom_field_pro_edu_value_edit').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxCustomFieldProEduValueUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
//$('#btn_custom_field_pro_edu_value_edit').removeAttr('disabled');
$('#custom_field_pro_edu_edit_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#custom_fields_pro_edu_edit').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#custom_field_pro_edu_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}*/
function memberRelationshipInfoEditModel()
{
$('#member_relationship_edit').modal('show');
}
function updateMemberRelationship()
{
var marital_status = $.trim($('#marital_status').val());
var form_data = new FormData($('#frm_member_relationship_edit')[0]);
if(marital_status == '') {
$('#member_relationship_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else {
$('#member_relationship_edit_msg').html('');
$('#member_relationship_edit_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_member_relationship_edit').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberRelationshipUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
//$('#btn_member_relationship_edit').removeAttr('disabled');
$('#member_relationship_edit_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#member_relationship_edit').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#member_relationship_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
function memberAlumniInfoEditModel()
{
$('#member_alumni_info_edit').modal('show');
}
function showHideGraduationYear(select_val)
{
var sel_arr = select_val.split('|');
if(sel_arr[1] == 1) {
$('#year_of_graduation').removeAttr('disabled');
} else if(sel_arr[1] == 2) {
$('#year_of_graduation').attr('disabled','disabled');
} else {
$('#year_of_graduation').attr('disabled','disabled');
}
}
function updateMemberAlumniInfo()
{
var year_of_graduation = $.trim($('#year_of_graduation').val());
var member_type_id = $.trim($('#member_type_id').val());
var form_data = new FormData($('#frm_member_alumni_info_edit')[0]);
if(year_of_graduation == '' || member_type_id == '') {
$('#member_alumni_info_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else {
$('#member_alumni_info_edit_msg').html('');
$('#member_alumni_info_edit_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_member_alumni_info_edit').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberAlumniInfoUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
//$('#btn_member_alumni_info_edit').removeAttr('disabled');
$('#member_alumni_info_edit_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#member_alumni_info_edit').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#member_alumni_info_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
function memberEducationInfoAddModel()
{
$('#education_info_add').modal('show');
}
function saveMemberEducationInfo()
{
var personal_member_id = $.trim($('#personal_member_id').val());
var course_id = $.trim($('#course_id').val());
var programme_id = $.trim($('#programme_id').val());
var institute_name = $.trim($('#institute_name').val());
var specialization = $.trim($('#specialization').val());
var is_currently_pursuing = $.trim($('#is_currently_pursuing').val());
var joining_year = $.trim($('#joining_year').val());
var completion_year = $.trim($('#completion_year').val());
var form_data = new FormData($('#frm_member_education_info_add')[0]);
if(course_id == '' || programme_id == '' || institute_name == '') {
$('#member_education_info_add_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else {
if(is_currently_pursuing == 2 && completion_year < joining_year) {
$('#member_education_info_add_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Sorry completion year should not be less than joining year.</small>')
} else {
$('#member_education_info_add_msg').html('');
$('#member_education_info_add_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_member_education_info_add').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberEducationInfoUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$('#course_id').val('');
$('#programme_id').val('');
$('#institute_name').val('');
$('#specialization').val('');
$('#joining_year').val('');
$('#completion_year').val('');
//$('#btn_member_education_info_add').removeAttr('disabled');
$('#member_education_info_add_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#education_info_add').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#member_education_info_add_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
}
function memberEducationEditModel(member_education_id, course_id, programme_id)
{
$('#member_education_id_edit').val(member_education_id);
$.ajax({
type: 'POST',
url: site_url+'members/ajaxMemberEducationById',
data: {member_education_id:member_education_id,course_id:course_id,programme_id:programme_id},
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
//alert(obj.education.course_id);
$('#course_id_edit').val(obj.education.course_id);
$('#programme_id_edit').val(obj.education.programme_id);
$('#institute_name_edit').val(obj.education.institute_name);
$('#specialization_edit').val(obj.education.specialization);
$('#location_edit').val(obj.education.location);
$('#joining_year_edit').val(obj.education.joining_year);
$('#completion_year_edit').val(obj.education.completion_year);
$('#is_currently_pursuing_edit').val(obj.education.is_currently_pursuing);
} else {
$('#member_professional_info_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
$('#education_info_edit').modal('show');
}
function updateMemberEducationInfo()
{
var personal_member_id = $.trim($('#personal_member_id').val());
var course_id = $.trim($('#course_id_edit').val());
var programme_id = $.trim($('#programme_id_edit').val());
var institute_name = $.trim($('#institute_name_edit').val());
var specialization = $.trim($('#specialization_edit').val());
var is_currently_pursuing = $.trim($('#is_currently_pursuing_edit').val());
var joining_year = $.trim($('#joining_year_edit').val());
var completion_year = $.trim($('#completion_year_edit').val());
var form_data = new FormData($('#frm_member_education_info_edit')[0]);
if(course_id == '' || programme_id == '' || institute_name == '') {
$('#member_education_info_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else {
if(is_currently_pursuing == 2 && completion_year < joining_year) {
$('#member_education_info_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Sorry completion year should not be less than joining year.</small>')
} else {
$('#member_education_info_edit_msg').html('');
$('#member_education_info_edit_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_member_education_info_edit').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberEducationInfoUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
//$('#btn_member_education_info_edit').removeAttr('disabled');
$('#member_education_info_edit_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#education_info_edit').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#member_education_info_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
}
function memberProfessionalAddModel()
{
$('#member_professional_info_add_msg').html('');
$('#member_professional_info_add').modal('show');
}
function saveMemberProfessionalInfo()
{
var personal_member_id = $.trim($('#personal_member_id').val());
var industry_id = $.trim($('#industry_id').val());
var designation_id = $.trim($('#designation_id').val());
var company_name = $.trim($('#company_name').val());
var role = $.trim($('#role').val());
var city = $.trim($('#city').val());
var from_year = $.trim($('#from_year').val());
var to_year = $.trim($('#to_year').val());
var is_currently_work_here = $('#is_currently_work_here').val();
var form_data = new FormData($('#frm_member_professional_info_add')[0]);
if(industry_id == '' || designation_id == '' || company_name == '' || role == '') {
$('#member_professional_info_add_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else {
if(from_year != '' && is_currently_work_here == 2 && to_year == '') {
$('#member_professional_info_add_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Please select to year.</small>');
} else if(is_currently_work_here == 2 && to_year < from_year) {
$('#member_professional_info_add_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Sorry to year should not be less than from year.</small>');
} else {
$('#member_professional_info_add_msg').html('');
$('#member_professional_info_add_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_member_professional_info_add').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberProfessionalInfoUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$('#industry_id').val('');
$('#designation_id').val('');
$('#company_name').val('');
$('#role').val('');
$('#city').val('');
//$('#btn_member_professional_info_add').removeAttr('disabled');
$('#member_professional_info_add_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#member_professional_info_add').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#member_professional_info_add_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
}
function memberProfessionalEditModel(member_professional_id)
{
$('#member_professional_info_edit_msg').html('');
$('#member_professional_id_edit').val(member_professional_id);
$.ajax({
type: 'POST',
url: site_url+'members/ajaxMemberProfessionById',
data: {member_professional_id:member_professional_id},
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$('#industry_id_edit').val(obj.profession.industry_id);
$('#designation_id_edit').val(obj.profession.designation_id);
$('#company_name_edit').val(obj.profession.company_name);
$('#role_edit').val(obj.profession.role);
$('#work_achievement_edit').val(obj.profession.work_achievement);
$('#p_city_edit').val(obj.profession.city);
$('#from_year_edit').val(obj.profession.from_year);
$('#to_year_edit').val(obj.profession.to_year);
$('#is_currently_work_here_edit').val(obj.profession.is_currently_work_here);
$('#is_entrepreneur_edit').val(obj.profession.is_entrepreneur);
$('#about_company_edit').val(obj.profession.about_company);
} else {
$('#member_professional_info_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
$('#member_professional_info_edit').modal('show');
}
function updateMemberProfessionalInfo()
{
var personal_member_id = $.trim($('#personal_member_id').val());
var industry_id = $.trim($('#industry_id_edit').val());
var designation_id = $.trim($('#designation_id_edit').val());
var company_name = $.trim($('#company_name_edit').val());
var role = $.trim($('#role_edit').val());
var city = $.trim($('#p_city_edit').val());
var from_year = $.trim($('#from_year_edit').val());
var to_year = $.trim($('#to_year_edit').val());
var is_currently_work_here = $('#is_currently_work_here_edit').val();
var form_data = new FormData($('#frm_member_professional_info_edit')[0]);
if(industry_id == '' || designation_id == '' || company_name == '' || role == '') {
$('#member_professional_info_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else {
if(from_year != '' && is_currently_work_here == 2 && to_year == '') {
$('#member_professional_info_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Please select to year.</small>');
} else if(is_currently_work_here == 2 && to_year < from_year) {
$('#member_professional_info_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Sorry to year should not be less than from year.</small>');
} else {
$('#member_professional_info_edit_msg').html('');
$('#member_professional_info_edit_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_member_professional_info_edit').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberProfessionalInfoUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$('#industry_id').val('');
$('#designation_id').val('');
$('#company_name').val('');
$('#role').val('');
$('#city').val('');
//$('#btn_member_professional_info_edit').removeAttr('disabled');
$('#member_professional_info_edit_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#member_professional_info_edit').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#member_professional_info_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
}
/*function memberProfessionalEditModel(member_professional_id, company_name)
{
$('#professional_info_edit').modal('show');
$('#member_professional_id').val(member_professional_id);
$('#mem_pro_title').html(company_name+' Edit');
}*/
function memberSocialEditModel(member_social_link_id, facebook, linkedin, twitter, gplus, skype)
{
$('#social_info_edit').modal('show');
$('#member_social_link_id').val(member_social_link_id);
$('#facebook').val(facebook);
$('#linkedin').val(linkedin);
$('#twitter').val(twitter);
$('#gplus').val(gplus);
$('#skype').val(skype);
}
function updateMemberSocialInfo()
{
var member_social_link_id = $.trim($('#member_social_link_id').val());
var facebook = $.trim($('#facebook').val());
var linkedin = $.trim($('#linkedin').val());
var twitter = $.trim($('#twitter').val());
var gplus = $.trim($('#gplus').val());
var skype = $.trim($('#skype').val());
var form_data = new FormData($('#frm_member_social_info_edit')[0]);
if(member_social_link_id == '') {
$('#member_social_info_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
} else {
$('#member_social_info_edit_msg').html('');
$('#member_social_info_edit_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
//$('#btn_member_social_info_edit').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberSocialInfoUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
//$('#btn_member_social_info_edit').removeAttr('disabled');
$('#member_social_info_edit_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#social_info_edit').modal('hide')",delay_time)).done(function( x ) {
setTimeout("window.location.reload()",delay_time);
});
} else {
$('#member_social_info_edit_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
}
}
function selectAllCheckbox(source)
{
var checkboxes = document.querySelectorAll('input[type="checkbox"]');
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i] != source && checkboxes[i] != document.getElementsByName('notify_type_push')[0])
checkboxes[i].checked = source.checked;
}
}
$(document).ready(function(){
$("#ckhCheckAll").click(function(){
//alert("just for check");
if(this.checked){
$('.check_mem').each(function(){
this.checked = true;
})
}else{
$('.check_mem').each(function(){
this.checked = false;
})
}
});
$('.checkbox_user').click(function(){
var tr_container = $(this).closest('tr');
var tot_checks = tr_container.find('input[type=checkbox]:checked').length;
//alert(tot_checks);
//alert(tr_container.data('head'));
if(tot_checks > 0)
{
tr_container.find('.view').prop('checked', 'checked');
$('#'+tr_container.data('head')).find('input[type=checkbox]').prop('checked', 'checked');
}
else
{
tr_container.find('.view').removeAttr('checked');
$('#'+tr_container.data('head')).find('input[type=checkbox]').removeAttr('checked');
}
});
});
function confirmBox(msg, url)
{
if(url === undefined) {
alert('href is undefined');
return false;
}
bootbox.confirm({
message: (msg==undefined)?"Are you sure to perform this action?":msg,
buttons: {
confirm: {
label: 'Yes',
className: 'btn-theme'
},
cancel: {
label: 'No',
className: 'btn-danger'
}
},
callback: function (result) {
if(result) {
window.location = url;
}
/*if(result == true) {
window.location = url;
} else if(result == false){
location.reload();
}*/
}
});
return false;
}
function confirmBoxFormSubmit(msg, url, frm_name)
{
if(url === undefined) {
alert('href is undefined');
return false;
}
bootbox.confirm({
message: (msg==undefined)?"Are you sure to perform this action?":msg,
buttons: {
confirm: {
label: 'Yes',
className: 'btn-theme'
},
cancel: {
label: 'No',
className: 'btn-danger'
}
},
callback: function (result) {
if(result) {
document.getElementById(frm_name).submit();
}
}
});
return false;
}
function imageZoom(image_path, header_title)
{
$('#image_zoom').modal('show');
$('#header_title').html('<h4 class="modal-title custom_align" id="Heading">'+header_title+'</h4>');
$('#image_path').attr('src',image_path);
$('#image_path').attr('alt',header_title);
}
function showServiceProRegisteredDevices(app_user_id, user_profile_name)
{
$('#dev_title').html('<h4 class="modal-title">'+user_profile_name+'</h4>');
var url = site_url+'serviceproviders/getRegisteredDevicesByUserId';
$.post(url,{app_user_id:app_user_id},function(data){
$('#ajax_dev_list').html(data);
});
$('#registered_devices').modal('show');
}
function showCustomerProRegisteredDevices(app_user_id, user_profile_name)
{
$('#dev_title').html('<h4 class="modal-title">'+user_profile_name+'</h4>');
var url = site_url+'customers/getRegisteredDevicesByCustomerId';
$.post(url,{app_user_id:app_user_id},function(data){
$('#ajax_dev_list').html(data);
});
$('#registered_devices').modal('show');
}
function showJobPostApplications(job_post_id, job_post_code)
{
$('#dev_title').html('<h4 class="modal-title">'+job_post_code+'</h4>');
var url = site_url+'jobs/showJobPostApplications';
$.post(url,{job_post_id:job_post_id},function(data){
$('#ajax_dev_list').html(data);
});
$('#registered_devices').modal('show');
}
function showJobActivitiesLog(job_post_id, job_post_code)
{
$('#job_activity_log_title').html('<h4 class="modal-title">Job Activities Log ('+job_post_code+')</h4>');
var url = site_url+'jobs/showJobActivitiesLog';
$.post(url,{job_post_id:job_post_id},function(data){
$('#ajax_job_activity_log').html(data);
});
$('#job_activity_log').modal('show');
}
function adminActionModal(member_id, member_name)
{
$('#admin_action_title').html('<h4 class="modal-title">'+member_name+' ( ADMIN ACTION )</h4>');
$('#member_id_admin_action').val(member_id);
$('#admin_action_msg').html('');
$.ajax({
type: 'POST',
url: site_url+'members/ajaxMemberToggleInfoById',
data: {member_id:member_id},
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
//alert(obj.member_toggle.toSource());
$('#selected_member_status').val(obj.member_toggle.member_status);
$('#selected_is_member_authorized').val(obj.member_toggle.is_member_authorized);
$('#member_status_admin_action').val(obj.member_toggle.member_status);
$('#communication_mode').val(obj.member_toggle.communication_mode);
$('#member_deceased').val(obj.member_toggle.member_deceased);
$('#achievement_level_admin_action').val(obj.member_toggle.achievement_level);
$('#enthusiasm_level_admin_action').val(obj.member_toggle.enthusiasm_level);
//$('#frm_admin_action').find('#is_member_authorized').val(obj.member_toggle.is_member_authorized);
$('#is_multiple_login_allowed').val(obj.member_toggle.is_multiple_login_allowed);
$('#member_comments_admin_action').val(obj.member_toggle.member_comments);
$('#last_contact_date').val(obj.member_toggle.last_contact_date);
} else {
$('#admin_action_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
$('#admin_action').modal('show');
}
function updateMemberToggleInfo()
{
if($('#member_status_admin_action').val() < 1)
{
$('#member_status_admin_action').addClass('alert-danger');
return false;
}
$('#member_status_admin_action').removeClass('alert-danger');
var communication_mode = $('#communication_mode').val();
var achievement_level = $('#achievement_level_admin_action').val();
var enthusiasm_level = $('#enthusiasm_level_admin_action').val();
var member_comments = $.trim($('#member_comments_admin_action').val());
var form_data = new FormData($('#frm_admin_action')[0]);
//if(communication_mode == 0 || achievement_level == 0 || enthusiasm_level == 0 || member_comments == '') {
//$('#admin_action_msg').html('<small class="text-danger"><i class="fa fa-close"></i> Required fields can not be blank.</small>')
//} else {
$('#admin_action_msg').html('');
$('#admin_action_msg').html('<i class="fa fa-cog fa-spin fa-3x fa-fw"></i> Wait...');
$('#btn_admin_action').attr('disabled','disabled');
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'members/ajaxMemberToggleInfoUpdate',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$('#btn_admin_action').removeAttr('disabled');
$('#admin_action_msg').html('<small class="text-success"><i class="fa fa-check"></i>' +obj.msg+'</small>');
$.when(setTimeout("$('#admin_action').modal('hide')",delay_time)).done(function( x ) {
searchFilter(parseInt($('.sorting_1:first').text()) - 1);
//setTimeout("window.location.reload()",delay_time);
});
} else {
$('#admin_action_msg').html('<small class="text-danger"><i class="fa fa-close"></i> '+obj.msg+'</small>');
}
}
});
//}
}
function setCustomerDeviceStatus(app_registration_id, app_user_id, device_status)
{
if(device_status == 1) var msg = 'Do you really want to activate this device?';
if(device_status == 2) var msg = 'Do you really want to block this device?';
var url = site_url+'customers/setDeviceStatusById';
if(url === undefined)
{
alert('href is undefined');
return false;
}
bootbox.confirm({
message: (msg==undefined)?"Are you sure to perform this action?":msg,
buttons: {
confirm: {
label: 'Yes',
className: 'btn-theme'
},
cancel: {
label: 'No',
className: 'btn-danger'
}
},
callback: function (result) {
if(result)
{
$.post(url,{app_registration_id:app_registration_id,device_status:device_status},function(data){
if(data == 'success') {
var url2 = site_url+'customers/getRegisteredDevicesByCustomerId';
$.post(url2,{app_user_id:app_user_id},function(data){
$('#ajax_dev_list').html(data);
});
} else {
}
});
}
}
});
return false;
}
function setServiceProDeviceStatus(app_registration_id, app_user_id, device_status)
{
if(device_status == 1) var msg = 'Do you really want to activate this device?';
if(device_status == 2) var msg = 'Do you really want to block this device?';
var url = site_url+'serviceproviders/setDeviceStatusById';
if(url === undefined)
{
alert('href is undefined');
return false;
}
bootbox.confirm({
message: (msg==undefined)?"Are you sure to perform this action?":msg,
buttons: {
confirm: {
label: 'Yes',
className: 'btn-theme'
},
cancel: {
label: 'No',
className: 'btn-danger'
}
},
callback: function (result) {
if(result)
{
$.post(url,{app_registration_id:app_registration_id,device_status:device_status},function(data){
if(data == 'success') {
var url2 = site_url+'serviceproviders/getRegisteredDevicesByUserId';
$.post(url2,{app_user_id:app_user_id},function(data){
$('#ajax_dev_list').html(data);
});
} else {
}
});
}
}
});
return false;
}
function getLocationDataByPinCode()
{
var college_pin = $.trim($('#college_pin').val());
if(college_pin != ''){
$('#pin_loc_msg').html('<i class="fa fa-spinner"></i> Wait...');
$.ajax({
type: 'POST',
url: site_url+'masters/getLocationDataByPinCode',
data: {college_pin:college_pin},
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$('#pin_loc_msg').html('');
$('#college_city').val(obj.location_info.city);
$('#college_state').val(obj.location_info.state);
} else {
$('#pin_loc_msg').html('<small class="text-danger">'+obj.msg+'</small>');
}
}
});
} else {
$('#pin_loc_msg').html('<small class="text-danger">Please enter valid Pin Code.</small>');
}
}
function getAppUsers()
{
var app_user_type = $('#app_user_type').val();
var user_mobile = $('#user_mobile').val();
var user_profile_name = $.trim($('#user_profile_name').val());
if(app_user_type == '' && user_mobile == '' && user_profile_name == '') {
$('#data_list').html('<small class="text-danger">Please enter atleast one parameter.</small>');
} else {
$('#data_list').html('<i class="fa fa-spinner"></i> Wait...');
$.ajax({
type: 'POST',
url: site_url+'notifications/ajaxGetAppUsers',
data: {
app_user_type:app_user_type,
user_mobile:user_mobile,
user_profile_name:user_profile_name
},
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$('#data_list').html(obj.customers);
} else {
$('#data_list').html('<small class="text-danger">'+obj.msg+'</small>');
}
}
});
}
}
function sendNotification()
{
var notification_alert_type = $.trim($('#notification_alert_type').val());
var notification_title = $.trim($('#notification_title').val());
var notify_message = $.trim($('#notify_message').val());
var form_data = new FormData($('#frm_send_notification')[0]);
if(notification_alert_type == '' || notify_message == '' || notification_title == '') {
$('#notify_msg').html('<small class="text-danger">Please enter required fields.</small>');
} else {
//$('#notify_msg').html('<i class="fa fa-spinner"></i> Wait...');
$('.loading').show();
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'notifications/ajaxSendNotification',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$('#notification_title').val('');
$('#notify_message').val('');
$('#push_image').val('');
$('#notify_msg').html('<small class="text-success"><i class="fa fa-check" aria-hidden="true"></i> '+obj.msg+'</small>');
$('.loading').fadeOut("slow");
//$('#notify_msg').delay(5000).fadeOut('slow');
//$('#notify_msg').show();
//window.location.href = site_url+'notifications/sendNotification';
} else {
$('#notify_msg').html('<small class="text-danger">'+obj.msg+'</small>');
}
}
});
}
}
function sendNotificationMemberList()
{
var member_ids = '';
$("[name='member_ids[]']:checked").each(function () {
if(this.value > 0) {
member_ids += this.value+',';
}
});
$('#mem_ids').val(member_ids);
var notification_alert_type = $.trim($('#notification_alert_type').val());
var notify_message = $.trim($('#notify_message').val());
var form_data = new FormData($('#frm_send_notification')[0]);
if(notification_alert_type == '' || notify_message == '') {
$('#notify_msg').html('<small class="text-danger">Please enter required fields.</small>');
} else {
$('#notify_msg').html('<i class="fa fa-spinner"></i> Wait...');
$('.loading').show();
$.ajax({
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
type: 'POST',
url: site_url+'notifications/ajaxSendNotificationAppUserList',
data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.status == 1){
$('#notification_title').val('');
$('#notify_message').val('');
$('#push_image').val('');
$('#notify_msg').html('<small class="text-success"><i class="fa fa-check" aria-hidden="true"></i> '+obj.msg+'</small>');
$('.loading').fadeOut("slow");
//$('#notify_msg').delay(5000).fadeOut('slow');
//$('#notify_msg').show();
//window.location.href = site_url+'notifications/sendNotification';
} else {
$('#notify_msg').html('<small class="text-danger">'+obj.msg+'</small>');
}
}
});
}
}
function showDeviceToken(device_token)
{
$('#dev_token').show(1000);
$('#dev_token_value').html(device_token);
}
function setFieldName(field_label)
{
var field_name;
field_label = $.trim(field_label);
field_name = field_label.replace(/ /g,"_");
$('#field_name').val(field_name.toLowerCase());
}
function memberEventDownloadCsv()
{
var event_id = $('#event_id').val();
if(event_id == '' || event_id == 0) {
$('#event_id_msg').html('<small class="text-danger">Please select event name</small>');
} else {
$('#event_id_msg').html('');
window.location.href = site_url+'events/memberEventDownloadCsv/'+event_id;
}
}
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+ d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function selectAllSpCheckbox(elem,obj)
{
if(obj.checked){
bootbox.confirm("You are about to perform a bulk action, changes will take effect when you will click 'Save Group'",
function(result){
if(result){
var memcheckbx = elem.find("input:checkbox");
memcheckbx.each(function(){
$(this).attr('checked','checked');
$(this).trigger('click');
})
$('#selallchkboxmem_div').hide();
} else obj.checked = false;
}
);
}
}
function toggleMoreFilters()
{
var btn_text = $('#btn_more_filter').text();
if(btn_text == 'Show More Filters') {
$('#btn_more_filter').text("Hide More Filters");
} else {
$('#btn_more_filter').text("Show More Filters");
}
$('#demo2').toggle(1000);
}
function toggleNotificationBox(btn)
{
$('#notify_msg').html('');
$(btn).hide();
$('#demo3').toggle(1000);
}
function enDeToYear(val, sel_id)
{
if(val == 1) {
$('#'+sel_id).attr('disabled','disabled');
$('#member_professional_info_add_msg').html('');
$('#member_professional_info_edit_msg').html('');
$('#member_education_info_add_msg').html('');
$('#member_education_info_edit_msg').html('');
} else {
$('#'+sel_id).removeAttr('disabled');
$('#member_professional_info_add_msg').html('');
$('#member_professional_info_edit_msg').html('');
$('#member_education_info_add_msg').html('');
$('#member_education_info_edit_msg').html('');
}
}
function editProfileImage()
{
memberPersonalEditModel();
$('.profile_img_focus').show();
}
function readURL(input,elem) {
if (input.files && input.files[0]) {
var extension = input.files[0].name.split('.').pop().toLowerCase(); //file extension from input file
var allowed_ext = group_file_ext;
var arr_allowed_ext = allowed_ext.split(',');
if($.inArray(extension,arr_allowed_ext) >-1){
var reader = new FileReader();
reader.onload = function (e) {
elem.html('<img src="'+e.target.result+'" width="100" height="150">');
};
reader.readAsDataURL(input.files[0]);
} else alert('Image format is incorrect');
}
}
// new
function changeServiceOrder(service_id)
{
var display_order = $('#display_order_'+service_id).val();
if(display_order == '' || display_order == 0) {
$('#dis_ord_'+service_id).html('<small class="text-danger"><i class="fa fa-spinner"></i> Input Error !</small>');
} else {
$('#dis_ord_'+service_id).html('<small class="text-danger"><i class="fa fa-spinner"></i> Wait...</small>');
var url = site_url+'services/changeServiceOrder';
$.post(url,{service_id:service_id,display_order:display_order},function(data){
$('#dis_ord_'+service_id).html(data);
});
}
}
function changeQuestionnaireOrder(questionnaire_id)
{
var display_order = $('#display_order_'+questionnaire_id).val();
if(display_order == '' || display_order == 0) {
$('#dis_ord_'+questionnaire_id).html('<small class="text-danger"><i class="fa fa-spinner"></i> Input Error !</small>');
} else {
$('#dis_ord_'+questionnaire_id).html('<small class="text-danger"><i class="fa fa-spinner"></i> Wait...</small>');
var url = site_url+'services/changeQuestionnaireOrder';
$.post(url,{questionnaire_id:questionnaire_id,display_order:display_order},function(data){
$('#dis_ord_'+questionnaire_id).html(data);
});
}
}
function showInAppStatus(shown_in_app_val, service_id)
{
if(shown_in_app_val == 1) var msg = 'Do you really want to show this service in app?';
if(shown_in_app_val == 2) var msg = 'Do you really want to hide this service in app?';
var url = site_url+'services/showInAppStatus';
bootbox.confirm({
message: (msg==undefined)?"Are you sure to perform this action?":msg,
buttons: {
confirm: {
label: 'Yes',
className: 'btn-theme'
},
cancel: {
label: 'No',
className: 'btn-danger'
}
},
callback: function (result) {
if(result) {
$('#show_in_app_'+service_id).html('<small class="text-danger"><i class="fa fa-spinner"></i> Wait...</small>');
$.post(url,{shown_in_app_val:shown_in_app_val,service_id:service_id},function(data){
$('#show_in_app_'+service_id).html(data);
});
}
}
});
return false;
}
function showAsFeatured(shown_in_app_val, service_id)
{
if(shown_in_app_val == 1) var msg = 'Do you really want to set the service as featured in app?';
if(shown_in_app_val == 0) var msg = 'Do you really want to hide this service as featured in app?';
var url = site_url+'services/setFeaturedStatCategories';
bootbox.confirm({
message: (msg==undefined)?"Are you sure to perform this action?":msg,
buttons: {
confirm: {
label: 'Yes',
className: 'btn-theme'
},
cancel: {
label: 'No',
className: 'btn-danger'
}
},
callback: function (result) {
if(result) {
$('#is_feat_'+service_id).html('<small class="text-danger"><i class="fa fa-spinner"></i> Wait...</small>');
$.post(url,{is_featured:shown_in_app_val,service_id:service_id},function(data){
$('#is_feat_'+service_id).html(data);
});
}
}
});
return false;
}
function serviceTypeToggle(service_id)
{
if(service_id == 1) {
$('#note_service_img').html('<small class="text-danger">[** Image Dimension 200 X 100]</small>');
} else if(service_id == 2) {
$('#note_service_img').html('<small class="text-danger">[** Image Dimension 100 X 100]</small>');
}
}
function displayQuestionnaireOptionDiv(field_type_val)
{
if(field_type_val == 1) {
$('#option_div').hide(1000);
} else if(field_type_val == 2) {
$('#option_div').show(1000);
}
}
function customerStatus(cus_status_val, app_user_id)
{
if(cus_status_val == 1) var msg = 'Do you really want to activate this customer?';
if(cus_status_val == 2) var msg = 'Do you really want to block this customer?';
var url = site_url+'members/customerStatus';
bootbox.confirm({
message: (msg==undefined)?"Are you sure to perform this action?":msg,
buttons: {
confirm: {
label: 'Active',
className: 'btn-theme'
},
cancel: {
label: 'Block',
className: 'btn-danger'
}
},
callback: function (result) {
if(result) {
$('#show_in_app_'+app_user_id).html('<small class="text-danger"><i class="fa fa-spinner"></i> Wait...</small>');
$.post(url,{cus_status_val:cus_status_val,app_user_id:app_user_id},function(data){
$('#show_in_app_'+app_user_id).html(data);
});
}
}
});
return false;
}
function changeCustomerStatus(customer_status, app_user_id)
{
var url = site_url+'customers/changeCustomerStatus/'+customer_status+'/'+app_user_id;
var msg = 'Do you want to change the customer status?';
confirmBox(msg, url);
}
function changeSupportStatus(support_status, msg_id)
{
var url = site_url+'supports/changeSupportStatus/'+support_status+'/'+msg_id;
var msg = 'Do you want to change the status?';
confirmBox(msg, url);
}
function changeServiceProviderStatus(service_provider_status, app_user_id)
{
var url = site_url+'serviceproviders/changeServiceProviderStatus/'+service_provider_status+'/'+app_user_id;
var msg = 'Do you want to change the customer status?';
confirmBox(msg, url);
}
function changeJobStatus(job_status, job_post_id)
{
var url = site_url+'jobs/changeJobStatus/'+job_status+'/'+job_post_id;
var msg = 'Do you want to change the job status?';
confirmBox(msg, url);
}
function jobTransferDetailModel()
{
$('#job_transfer_detail').modal('show');
$('.profile_img_focus').hide();
}
function selectAllCheckboxUser(source)
{
var checkboxes = document.querySelectorAll('input[type="checkbox"]');
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i] != source)
checkboxes[i].checked = source.checked;
}
}
function customRedirect(fun_url)
{
$('#frm_search_filter').attr('action',fun_url);
$('#frm_search_filter').submit();
}
function sendInvitation()
{
var error = 0;
var error_msg = '';
var mtype = $('#msg_type').val();
var sendtype = $("input[name='sendtype']:checked").val();
if(sendtype == 2){
if($('#sendtype_data').val().length < 1){
error = 1;
error_msg += mtype == 1 ? '\nMobile No. cannot be blank' : '\n Email cannot be blank';
}
} else {
if($('#allmember').is(':checked') == false && $('[name="member[]"]:checked').length < 1 ){
error = 1;
error_msg += '\nSelect cumtomer to send message';
}
}
if($('#msg_type').val() == 2){
if($('#msg_subject').val().length < 1)
{
error = 1;
error_msg += '\nSubject cannot be blank';
}
}
if($('#msg_user_type').val().length < 1){
error = 1;
error_msg += '\nUser Type cannot be blank';
}
if($('#msg_message').val().length < 1){
error = 1;
error_msg += '\nMessage cannot be blank';
}
if(error == 1){
alert(error_msg);
return false;
}
var formObj = {};
var msgFrm = $('#frm_send_notification').serializeArray();
$.each(msgFrm, function(i,mObj){
formObj[mObj.name] = mObj.value;
});
if($('#allmember').is(':checked'))
{
var inputs = $('#frm_search_filter').serializeArray();
$.each(inputs, function (i, input) {
formObj[input.name] = input.value;
});
} else {
var members = [];
$('.msgmember').each(function(){
if($(this).is(':checked')){
members.push($(this).val());
}
})
}
formObj['member_id'] = members;
$('.loading').fadeIn("slow");
$.ajax({ type : 'post', url : site_url+'invitation/sendmessage', data : formObj ,
success : function(msg)
{
//console.log(msg);
window.location.href = site_url+'invitation/index/'+mtype;
$('.loading').fadeOut("slow");
},
error : function()
{
alert('Something went wrong');
$('.loading').fadeOut("slow");
}
});
console.log(formObj);
}
function setInvitationMsg(type_id,user_type_id)
{
if(user_type_id == ""){
$('#msg_subject').val('');
$('#msg_message').val('');
} else {
if(user_type_id == 2) $('#rolediv').show();
else $('#rolediv').hide();
if(type_id == 2) $('#msg_subject').val('Join FLYngener');
var role = $('#role').val();
var msg2 = '';
if(role.length > 1) msg2 = "as "+role;
var msg = user_type_id == 1 ? "Looking for expert services for your home or office? Join FLYngener App now https://bit.ly/2G8XrYR" : "Looking for more Work Opportunities "+msg2+"? Join FLYngener App now and find unlimited opportunities https://bit.ly/2G8XrYR";
$('#msg_message').val(msg);
}
}
function setInvitationMsgOnChange(role,msg_user_type)
{
var msg = '';
if(msg_user_type == 1){
msg = "Looking for expert services for your home or office? Join FLYngener App now https://bit.ly/2G8XrYR";
} else {
msg = "Looking for more Work Opportunities as "+role+"? Join FLYngener App now and find unlimited opportunities https://bit.ly/2G8XrYR";
}
$('#msg_message').val(msg);
}
function showsendtype(type)
{
$('#msgdivs').show();
if(type == 2){
$('#sendtype_div').show();
} else $('#sendtype_div').hide();
}
if($(".product-form").length){
var myarray1 = ['4','5','6'];
$('.food_type_field').on('change', function() {
if(myarray1.includes(this.value) == true){
//alert('in array : '+this.value);
$('.inventery-div').css('display','block');
}else{
$('.inventery-div').css('display','none');
//alert('not in array : '+this.value);
}
/*
alert("acbd : "+jQuery.inArray(this.value,myarray));
if(jQuery.inArray(this.value,myarray)) {
//console.log("is in array");
alert('in array'+this.value);
}else{
//console.log("is not in array");
alert('not in array'+this.value);
}
*/
});
}
function productAddFuncInc(productId,productQty){
var current_page_no = $('#current_page_no').val();
if(productQty == 0){
$.ajax({ type : 'post', url : site_url+'order/productRemoveToCartFunc/',data :{
productId : productId,
quantity : productQty
},success : function(msg){
searchFilter(current_page_no);
var data = jQuery.parseJSON(msg);
if(data.status == 1){
$('.success_message').html(data.msg);
}else{
$('.error_message').html(data.msg);
}
},
error:function(){
searchFilter(current_page_no);
}
});
}else{
$.ajax({ type : 'post', url : site_url+'order/productAddToCartFunc/',data :{
productId : productId,
quantity : productQty
},success : function(msg){
searchFilter(current_page_no);
var data = jQuery.parseJSON(msg);
if(data.status == 1){
$('.success_message').html(data.msg);
}else{
$('.error_message').html(data.msg);
}
},
error:function(){
searchFilter(current_page_no);
}
});
}
}
function cartItemsReset(){
var current_page_no = $('#current_page_no').val();
var result = confirm("Are you sure you want to reset cart items?");
if (result==true) {
$.ajax({ type : 'post', url : site_url+'order/cartItemsReset/',data :{
},success : function(msg){
searchFilter(current_page_no);
var data = jQuery.parseJSON(msg);
if(data.status == 1){
$('.success_message').html(data.msg);
}else{
$('.error_message').html(data.msg);
}
},
error:function(){
searchFilter(current_page_no);
}
});
}
}
$("#bill-generate").on("click", function(){
var room_no = $("#room_no").val();
var customer_name = $("#customer-name").val();
var payment_mode = $.map($('input[name="payment_mode"]:checked'), function(c){return c.value; });
// if(room_no < 0 || room_no == '' || room_no == null || room_no == undefined){
// alert("Please select room no.");
// return false;
// }
// if( (room_no < 1) && (customer_name == '' || customer_name == null || customer_name == undefined)){
// alert("Please fill customer name");
// return false;
// }
if(room_no =='' && customer_name == ''){
alert("Please fill customer name or select room no.");
return false;
}
if(payment_mode == ''){
alert("Please select payment mode");
return false;
}
$('#order_form_submit').submit();
});
$(document).ready(function() {
$('#reportDate').change(function() {
$('#report_form_submit').submit();
});
});