var ssdelid = 0; var ssrepid = 0; var ssaddqid = 0; var curr_service = ''; var curr_tabtype = 'Sent'; //re load ----------------------- var isreload = 0; function reloadret(search){ if( search == 'reload' ){ isreload = 1; search = ''; } else{ isreload = 0; } jQuery.ajax({ // url: postqpfunction.ajax_url, url: '/wp-admin/admin-ajax.php', type:'POST', dataType: 'json', data : { action : 'retajaxpost', }, success: function(response){ // alert(response); jQuery('.ret-tabs-box').html(response); } }); } //end re load ------------------- if( table_type == 'targets' ){ reloadret('reload'); } //com load ----------------------- function reloadcom(search){ jQuery.ajax({ // url: postqpfunction.ajax_url, url: '/wp-admin/admin-ajax.php', type:'POST', dataType: 'json', data : { action : 'comajaxpost', }, success: function(response){ // alert(response); jQuery('.com-tabs-box').html(response); } }); } //end com load ------------------- if( table_type == 'commissions' ){ reloadcom('comload'); } //com load ----------------------- function reloadleague(search){ jQuery.ajax({ // url: postqpfunction.ajax_url, url: '/wp-admin/admin-ajax.php', type:'POST', dataType: 'json', data : { action : 'leagueajaxpost', }, success: function(response){ // alert(response); jQuery('.league-tabs-box').html(response); } }); } //end com load ------------------- if( table_type == 'league' ){ reloadleague(''); } jQuery( document ).on( 'click', '.new_target_btn', function() { jQuery('.target_month').val(''); jQuery('.reward_name').val(''); jQuery('.target_description').val(''); jQuery('.new_recruits').val(''); jQuery('.new_comrades').val(''); jQuery('.target_id').val('0'); jQuery('.save-target-btn').html('Add New Target >'); jQuery('.modalttl').html('Add New Target'); var modal = document.getElementById('resendschedModal'); modal.style.display = "block"; return false; }); jQuery( document ).on( 'click', '.edit-btn', function() { var rewardname = jQuery(this).attr('rewardname'); var description = jQuery(this).attr('description'); var new_recruits = jQuery(this).attr('new_recruits'); var new_comrades = jQuery(this).attr('new_comrades'); var target_id = jQuery(this).attr('target_id'); var target_date = jQuery(this).attr('target_date'); var date_format = jQuery(this).attr('date_format'); jQuery('.reward_name').val(rewardname); jQuery('.target_description').val(description); jQuery('.new_recruits').val(new_recruits); jQuery('.new_comrades').val(new_comrades); jQuery('.target_id').val(target_id); jQuery('.save-target-btn').html('Update Target'); jQuery('.modalttl').html('Update Target'); jQuery('.ss-cancel').attr('target_month', target_date); jQuery('.target_month').append(jQuery('