'activeHelper_liveHelp_restrictedCountriesList', 'register' => 'activeHelper_liveHelp_restrictedCountriesRegister', ); if (!empty($_REQUEST['action']) && isset($actions[$_REQUEST['action']])) return $actions[$_REQUEST['action']](); return $actions['list'](); } function activeHelper_liveHelp_restrictedCountriesPost() { $actions = array( 'delete' => 'activeHelper_liveHelp_restrictedCountriesDeletePost', 'register' => 'activeHelper_liveHelp_restrictedCountriesRegisterPost' ); if (!empty($_REQUEST['action']) && isset($actions[$_REQUEST['action']])) return $actions[$_REQUEST['action']](); } function activeHelper_liveHelp_restrictedCountriesDeletePost() { global $wpdb, $activeHelper_liveHelp; $_REQUEST['id'] = !empty($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; if (empty($_REQUEST['id'])) { wp_redirect('admin.php?page=' . strtolower('activeHelper_liveHelp_restrictedCountries') . '&miss'); exit; } $wpdb->query(" DELETE FROM {$wpdb->prefix}livehelp_not_allowed_countries WHERE id = {$_REQUEST['id']} LIMIT 1 "); wp_redirect('admin.php?page=' . strtolower('activeHelper_liveHelp_restrictedCountries') . '&delete'); exit; } function activeHelper_liveHelp_restrictedCountriesList() { global $wpdb, $activeHelper_liveHelp; $restrictionsList = $wpdb->get_results(" SELECT jlnac.id AS restriction_id, jld.id_domain AS domain_id, jld.name AS domain_name, jlc.name AS country FROM {$wpdb->prefix}livehelp_not_allowed_countries AS jlnac, {$wpdb->prefix}livehelp_countries AS jlc, {$wpdb->prefix}livehelp_domains AS jld WHERE jlnac.id_domain = jld.id_domain AND jlnac.code = jlc.code GROUP BY 1 DESC ORDER BY jlnac.id ", ARRAY_A); echo '
' . sprintf(__('The %s was successfully registered.', 'activehelper_livehelp'), __('restriction', 'activehelper_livehelp')) . '
' . sprintf(__('The %s was deleted permanently.', 'activehelper_livehelp'), __('restriction', 'activehelper_livehelp')) . '
' . sprintf(__('The %s was not found.', 'activehelper_livehelp'), __('restriction', 'activehelper_livehelp')) . '