function rcp_export_page() { global $rcp_options, $rcp_db_name, $wpdb; $current_page = admin_url('/admin.php?page=rcp-export'); ?> <div class="wrap"> <h2><?php _e('Export', 'rcp'); ?> </h2> <?php do_action('rcp_export_page_top'); ?> <h3><?php _e('Members Export', 'rcp'); ?> </h3> <p><?php _e('Download member data as a CSV file. This is useful for tasks such as importing batch users into MailChimp, or other systems.', 'rcp'); ?> </p> <form id="rcp_export" action="<?php echo $current_page; ?> " method="post"> <p> <select name="rcp-subscription" id="rcp-subscription"> <option value="0"><?php _e('All', 'rcp'); ?> </option> <?php $levels = rcp_get_subscription_levels('all'); if ($levels) { foreach ($levels as $key => $level) { ?> <option value="<?php echo absint($level->id); ?> "><?php echo esc_html($level->name); ?> </option> <?php } } ?> </select> <label for="rcp-subscription"><?php _e('Choose the subscription to export members from', 'rcp'); ?> </label><br/> <select name="rcp-status" id="rcp-status"> <option value="active"><?php _e('Active', 'rcp'); ?> </option> <option value="pending"><?php _e('Pending', 'rcp'); ?> </option> <option value="expired"><?php _e('Expired', 'rcp'); ?> </option> <option value="cancelled"><?php _e('Cancelled', 'rcp'); ?> </option> <option value="free"><?php _e('Free', 'rcp'); ?> </option> </select> <label for="rcp-status"><?php _e('Choose the status to export', 'rcp'); ?> </label><br/> <input type="number" id="rcp-number" name="rcp-number" class="small-text" value="500" /> <label for="rcp-number"><?php _e('Maximum number of members to export', 'rcp'); ?> <br/> <input type="number" id="rcp-offset" name="rcp-offset" class="small-text" value="0" /> <label for="rcp-offset"><?php _e('The number of members to skip', 'rcp'); ?> </p> <p><?php _e('If you need to export a large number of members, export them in batches using the max and offset options', 'rcp'); ?> </p> <input type="hidden" name="rcp-action" value="export-members"/> <input type="submit" class="button-secondary" value="<?php _e('Download Member CSV', 'rcp'); ?> "/> </form> <!-- payments export --> <h3><?php _e('Payments Export', 'rcp'); ?> </h3> <p><?php _e('Download payment data as a CSV file. Use this file for your own record keeping or tracking.', 'rcp'); ?> </p> <form id="rcp_export" action="<?php echo esc_url($current_page); ?> " method="post"> <p> <select name="rcp-year" id="rcp-year"> <option value="0"><?php _e('All years', 'rcp'); ?> <?php $current = date('Y'); $year = $current; $end = $current - 5; while ($year >= $end) { ?> <option value="<?php echo $year; ?> "><?php echo $year; ?> </option> <?php $year--; } ?> </select> <select name="rcp-month" id="rcp-month"> <option value="0"><?php _e('All months', 'rcp'); ?> <?php for ($i = 1; $i <= 12; $i++) { ?> <option value="<?php echo $i; ?> "><?php echo rcp_get_month_name($i); ?> </option> <?php } ?> </select> </p> <p> <input type="submit" class="button-secondary" value="<?php _e('Download Payments CSV', 'rcp'); ?> "/> <input type="hidden" name="rcp-action" value="export-payments"/> </p> </form> <?php do_action('rcp_export_page_bottom'); ?> </div><!--end wrap--> <?php }
<input type="text" size="20" name="rcp_card_name" class="rcp_card_name card-name" /> </p> <p id="rcp_card_exp_wrap"> <label><?php _e('Expiration (MM/YYYY)', 'rcp'); ?> </label> <select name="rcp_card_exp_month" class="rcp_card_exp_month card-expiry-month"> <?php for ($i = 1; $i <= 12; $i++) { ?> <option value="<?php echo $i; ?> "><?php echo $i . ' - ' . rcp_get_month_name($i); ?> </option> <?php } ?> </select> <span class="rcp_expiry_separator"> / </span> <select name="rcp_card_exp_year" class="rcp_card_exp_year card-expiry-year"> <?php $year = date('Y'); for ($i = $year; $i <= $year + 10; $i++) { ?> <option value="<?php echo $i; ?>
/** * Show report graph date filters * * @since 1.8 * @return void */ function rcp_reports_graph_controls() { $date_options = apply_filters('rcp_report_date_options', array('this_week' => __('This Week', 'rcp'), 'last_week' => __('Last Week', 'rcp'), 'this_month' => __('This Month', 'rcp'), 'last_month' => __('Last Month', 'rcp'), 'this_quarter' => __('This Quarter', 'rcp'), 'last_quarter' => __('Last Quarter', 'rcp'), 'this_year' => __('This Year', 'rcp'), 'last_year' => __('Last Year', 'rcp'), 'other' => __('Custom', 'rcp'))); $dates = rcp_get_report_dates(); $display = $dates['range'] == 'other' ? '' : 'style="display:none;"'; $active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'earnings'; $selected_level = isset($_GET['subscription']) ? absint($_GET['subscription']) : false; ?> <form id="rcp-garphs-filter" method="get"> <div class="tablenav top"> <div class="alignleft actions"> <input type="hidden" name="page" value="rcp-reports"/> <select id="rcp-graphs-date-options" name="range"> <?php foreach ($date_options as $key => $option) { echo '<option value="' . esc_attr($key) . '" ' . selected($key, $dates['range']) . '>' . esc_html($option) . '</option>'; } ?> </select> <div id="rcp-date-range-options" <?php echo $display; ?> > <span><?php _e('From', 'rcp'); ?> </span> <select id="rcp-graphs-month-start" name="m_start"> <?php for ($i = 1; $i <= 12; $i++) { ?> <option value="<?php echo absint($i); ?> " <?php selected($i, $dates['m_start']); ?> ><?php echo rcp_get_month_name($i); ?> </option> <?php } ?> </select> <select id="rcp-graphs-year" name="year"> <?php for ($i = 2007; $i <= $dates['year_end']; $i++) { ?> <option value="<?php echo absint($i); ?> " <?php selected($i, $dates['year']); ?> ><?php echo $i; ?> </option> <?php } ?> </select> <span><?php _e('To', 'rcp'); ?> </span> <select id="rcp-graphs-month-start" name="m_end"> <?php for ($i = 1; $i <= 12; $i++) { ?> <option value="<?php echo absint($i); ?> " <?php selected($i, $dates['m_end']); ?> ><?php echo rcp_get_month_name($i); ?> </option> <?php } ?> </select> <select id="rcp-graphs-year" name="year_end"> <?php for ($i = 2007; $i <= $dates['year_end']; $i++) { ?> <option value="<?php echo absint($i); ?> " <?php selected($i, $dates['year_end']); ?> ><?php echo $i; ?> </option> <?php } ?> </select> </div> <?php if ('earnings' == $active_tab) { $levels = rcp_get_subscription_levels(); ?> <select id="rcp-graphs-subscriptions" name="subscription"> <option value="0"><?php _e('All Subscription Levels', 'rcp'); ?> </option> <?php foreach ($levels as $level) { ?> <option value="<?php echo $level->id; ?> "<?php selected($selected_level, $level->id); ?> ><?php echo $level->name; ?> </option> <?php } ?> </select> <?php } ?> <input type="hidden" name="rcp_action" value="" /> <input type="hidden" name="tab" value="<?php echo $active_tab; ?> " /> <input type="submit" class="button-secondary" value="<?php _e('Filter', 'rcp'); ?> "/> </div> </div> </form> <?php }