function _ajax_fetch_custom_list_day_callback() { global $pro_ads_statistics, $hook_suffix; $arr = array('type' => array('slug' => $_POST['type']), 'name' => $pro_ads_statistics->stat_types($_POST['type']), 'day' => $_POST['day'], 'month' => $_POST['month'], 'year' => $_POST['year']); $wp_list_table = new Pro_Ad_Stats_Day_List_Table(); $wp_list_table->ajax_response($arr); exit; }
public function get_stats_table($arr = array()) { global $hook_suffix, $pro_ads_main; $array = array('type' => array('slug' => 'click'), 'range' => 'month', 'rid' => 3, 'day' => $pro_ads_main->time_by_timezone('d'), 'month' => $pro_ads_main->time_by_timezone('m'), 'year' => $pro_ads_main->time_by_timezone('Y'), 'group' => '', 'group_id' => ''); $res = array_merge($array, $arr); echo '<div class="pro_ad_stats_table">'; if ($res['rid'] == 1) { $statsTable = new Pro_Ad_All_Stats_List_Table(); $filter_str = 'all-stats-filter'; $range = 'all'; } elseif ($res['rid'] == 2) { $statsTable = new Pro_Ad_Stats_Year_List_Table(); $filter_str = 'year-stats-filter'; $range = 'year'; } elseif ($res['rid'] == 3) { $statsTable = new Pro_Ad_Stats_List_Table(); $filter_str = 'month-stats-filter'; $range = 'month'; } elseif ($res['rid'] == 4) { $statsTable = new Pro_Ad_Stats_Day_List_Table(); $filter_str = 'day-stats-filter'; $range = 'day'; } $statsTable->prepare_items($res); echo '<form id="' . $filter_str . '" class="stats-filter" range="' . $range . '" rid="' . $res['rid'] . '" type="' . $res['type']['slug'] . '" day="' . $res['day'] . '" month="' . $res['month'] . '" year="' . $res['year'] . '" group="' . $res['group'] . '" group_id="' . $res['group_id'] . '" method="get">'; //echo '<input type="hidden" name="page" value="'.$_REQUEST['page'].'" />'; $statsTable->display(); echo '</form>'; echo '</div>'; }