<?php function opt_ajax_optin_links_dropdown() { if( !isset( $_POST['opt_nonce'] ) || !wp_verify_nonce($_POST['opt_nonce'], 'opt-nonce') ) die(); global $wpdb; if(is_numeric($_POST['args'])) { $sort_campaign_id = $_POST['args']; unset($options); $options[0]['name'] = 'Filter Stats By Ad'; $options[0]['value'] = 'none'; echo opt_dropdown_from_table('opt_optin_links','name',$options,'name','','','style="margin:0"','sort_ad_id',' WHERE opt_campaign_id = '.$sort_campaign_id.' AND deleted != 1'); } else { $args = explode('-',$_POST['args']); if(is_numeric($args[1]) || $args[1]=='none') { unset($options); $options[0]['name'] = $args[0]; $options[0]['value'] = 'none'; echo opt_dropdown_from_table('opt_optin_links','name',$options,'name','','','style="margin:0; width:300px;"','opt_ad_id',' WHERE opt_campaign_id = '.$args[1].' AND deleted != 1'); } } die(); } add_action('wp_ajax_opt_ajax_optin_link_dropdown', 'opt_ajax_optin_link_dropdown'); function opt_ajax_secure_link_dropdown() { if(isset($_POST['args']) && is_numeric($_POST['args'])) { global $wpdb; $campaign_id = $_POST['args']; unset($options); echo opt_dropdown_from_table('opt_secured_pages','name','','name','','','style="margin:0; width:100%"','optin_link_secure_link',' WHERE url NOT LIKE "%*%" AND id IN (SELECT opt_secured_page_id FROM '.OPT_DB_PREFIX.'opt_pages_to_campaigns WHERE opt_campaign_id = '.$campaign_id.')'); } die(); } add_action('wp_ajax_opt_ajax_secure_link_dropdown', 'opt_ajax_secure_link_dropdown'); ?>