?>
</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><?php 
echo $rcp_checkout_details['DESC'];
?>
</td>
			<?php 
if (!empty($_GET['rcp-recurring'])) {
    ?>
				<td>
					<?php 
    printf(__('Every %d %s', 'rcp'), esc_html($rcp_checkout_details['subscription']['duration']), rcp_filter_duration_unit(esc_html($rcp_checkout_details['subscription']['duration_unit']), esc_html($rcp_checkout_details['subscription']['duration'])));
    ?>
				</td>
			<?php 
}
?>
			<?php 
if (!empty($_GET['rcp-recurring']) && !empty($rcp_checkout_details['subscription']['fee'])) {
    ?>
				<td>
					<?php 
    echo rcp_currency_filter($rcp_checkout_details['subscription']['fee']);
    ?>
				</td>
			<?php 
}
    }
    ?>
		</div>

		<fieldset class="rcp_level_details_fieldset">
			<p id="rcp_level_details_wrap" class="rcp_level" rel="<?php 
    echo esc_attr($level->price);
    ?>
">
				<span class="rcp_price"><?php 
    echo rcp_currency_filter($level->price);
    ?>
</span>
				<span class="rcp_sep">&nbsp;/&nbsp;</span>
				<span class="rcp_duration"><?php 
    echo $level->duration > 0 ? $level->duration . '&nbsp;' . rcp_filter_duration_unit($level->duration_unit, $level->duration) : __('unlimited', 'rcp');
    ?>
</span>
			</p>
		</fieldset>

	<?php 
}
?>

	<?php 
do_action('rcp_before_registration_submit_field');
?>

	<p id="rcp_submit_wrap">
		<input type="hidden" name="rcp_level" value="<?php 
function after_register()
{
    $_GET['level'] = get_usermeta($_GET['id'], 'reg_type');
    $levels = rcp_get_subscription_levels('active');
    $gateways = rcp_get_enabled_payment_gateways();
    rcp_show_error_messages('register');
    ?>


<form id="rcp_registration_form" class="rcp_form" method="POST" action="<?php 
    echo esc_url(rcp_get_current_url());
    if (isset($_GET['id'])) {
        echo '?id=' . $_GET['id'];
    }
    ?>
">
<div class="saloginwrapper">
<h2 class="section-title"><span>Successful Registration!</span></h2>
<div class="clear"></div>

		<ul id="rcp_subscription_levels" style="display:none;">
			<?php 
    foreach ($levels as $key => $level) {
        ?>
				<?php 
        if (rcp_show_subscription_level($level->id)) {
            ?>
				<li id="rcp_subscription_level_<?php 
            echo $level->id;
            ?>
" class="rcp_subscription_level">
					<input type="radio" class="required rcp_level" <?php 
            if (isset($_GET['level']) && $_GET['level'] == $level->id) {
                echo 'checked="checked"';
            }
            ?>
 name="rcp_level" rel="<?php 
            echo esc_attr($level->price);
            ?>
" value="<?php 
            echo esc_attr(absint($level->id));
            ?>
" <?php 
            if ($level->duration == 0) {
                echo 'data-duration="forever"';
            }
            ?>
/>&nbsp;
					<span class="rcp_subscription_level_name"><?php 
            echo rcp_get_subscription_name($level->id);
            ?>
</span><span class="rcp_separator">&nbsp;-&nbsp;</span><span class="rcp_price" rel="<?php 
            echo esc_attr($level->price);
            ?>
"><?php 
            echo $level->price > 0 ? rcp_currency_filter($level->price) : __('free', 'rcp');
            ?>
<span class="rcp_separator">&nbsp;-&nbsp;</span></span>
					<span class="rcp_level_duration"><?php 
            echo $level->duration > 0 ? $level->duration . '&nbsp;' . rcp_filter_duration_unit($level->duration_unit, $level->duration) : __('unlimited', 'rcp');
            ?>
</span>
					<div class="rcp_level_description"> <?php 
            echo rcp_get_subscription_description($level->id);
            ?>
</div>
				</li>
				<?php 
        }
        ?>
			<?php 
    }
    ?>
		</ul>
    <?php 
    $gateways = rcp_get_enabled_payment_gateways();
    if (count($gateways) > 1) {
        $display = rcp_has_paid_levels() ? '' : ' style="display: none;"';
        ?>
		<fieldset class="rcp_gateways_fieldset">
            <p>
            <label><?php 
        _e('Choose Your Payment Method', 'rcp');
        ?>
</label>
            </p>
			<p id="rcp_payment_gateways"<?php 
        echo $display;
        ?>
>
				<select name="rcp_gateway" id="rcp_gateway" style="float:left; position:relative;">
					<?php 
        foreach ($gateways as $key => $gateway) {
            ?>
						<option value="<?php 
            echo esc_attr($key);
            ?>
"><?php 
            echo esc_html($gateway);
            ?>
</option>
					<?php 
        }
        ?>
				</select>
				
			</p>
		</fieldset>
	<?php 
    }
    ?>
    
<?php 
    do_action('rcp_before_registration_submit_field', $levels);
    ?>

	<p id="rcp_submit_wrap">
		<input type="hidden" name="rcp_register_nonce" value="<?php 
    echo wp_create_nonce('rcp-register-nonce');
    ?>
"/>
		<input type="submit" name="rcp_submit_registration" id="rcp_submit" value="<?php 
    echo apply_filters('rcp_registration_register_button', __('Register', 'rcp'));
    ?>
"/>
	</p>
<div class="clear"></div>
</div></form>
    <?php 
}
							<?php endforeach; ?>
						</select>
						<label for="rcp_gateway"><?php _e( 'Choose Your Payment Method', 'rcp' ); ?></label>
					</p>
				</fieldset>
			<?php else: ?>
				<?php foreach( $gateways as $key => $gateway ) : $recurring = rcp_gateway_supports( $key, 'recurring' ) ? 'yes' : 'no'; ?>
					<input type="hidden" name="rcp_gateway" value="<?php echo esc_attr( $key ); ?>" data-supports-recurring="<?php echo esc_attr( $recurring ); ?>"/>
				<?php endforeach; ?>
			<?php endif; ?>
		</div>

		<fieldset class="rcp_level_details_fieldset">
			<p id="rcp_level_details_wrap" class="rcp_level" rel="<?php echo esc_attr( $level->price ); ?>">
				<span class="rcp_price"><?php echo rcp_currency_filter( $level->price ); ?></span>
				<span class="rcp_sep">&nbsp;/&nbsp;</span>
				<span class="rcp_duration"><?php echo $level->duration > 0 ? $level->duration . '&nbsp;' . rcp_filter_duration_unit( $level->duration_unit, $level->duration ) : __( 'unlimited', 'rcp' ); ?></span>
			</p>
		</fieldset>

	<?php endif; ?>

	<?php do_action( 'rcp_before_registration_submit_field' ); ?>

	<p id="rcp_submit_wrap">
		<input type="hidden" name="rcp_level" value="<?php echo absint( $rcp_level ); ?>"/>
		<input type="hidden" name="rcp_register_nonce" value="<?php echo wp_create_nonce('rcp-register-nonce' ); ?>"/>
		<input type="submit" name="rcp_submit_registration" id="rcp_submit" value="<?php echo apply_filters ( 'rcp_registration_register_button', __( 'Register', 'rcp' ) ); ?>"/>
	</p>
</form>
/**
 * Get formatted recurring total for this registration
 *
 * @since      2.5
 * @param bool $echo
 *
 * @return mixed|string|void
 */
function rcp_registration_recurring_total($echo = true)
{
    $total = rcp_get_registration_recurring_total();
    // the registration has not been setup yet
    if (false === $total) {
        return false;
    }
    if (0 < $total) {
        $total = number_format($total, rcp_currency_decimal_filter());
        $total = rcp_currency_filter($total);
        $subscription = rcp_get_subscription_details(rcp_get_registration()->get_subscription());
        if ($subscription->duration == 1) {
            $total .= '/' . rcp_filter_duration_unit($subscription->duration_unit, 1);
        } else {
            $total .= sprintf(__(' every %s %s', 'rcp'), $subscription->duration, rcp_filter_duration_unit($subscription->duration_unit, $subscription->duration));
        }
    } else {
        $total = __('free', 'rcp');
    }
    $total = apply_filters('rcp_registration_recurring_total', $total);
    if ($echo) {
        echo $total;
    }
    return $total;
}
	<?php 
}
?>

	<fieldset class="rcp_level_details_fieldset">
		<?php 
$level = rcp_get_subscription_details($rcp_level);
?>
		<p id="rcp_level_details_wrap">
			<span class="rcp_price"><?php 
echo rcp_currency_filter($level->price);
?>
</span>
			<span class="rcp_sep">&nbsp;/&nbsp;</span>
			<span class="rcp_duration"><?php 
echo $level->duration . ' ' . rcp_filter_duration_unit($level->duration_unit, $level->duration);
?>
</span>
		</p>
	</fieldset>

	<?php 
do_action('rcp_before_registration_submit_field');
?>

	<p id="rcp_submit_wrap">
		<input type="hidden" name="rcp_level" value="<?php 
echo absint($rcp_level);
?>
"/>
		<input type="hidden" name="rcp_register_nonce" value="<?php 
function rcp_member_levels_page()
{
    global $rcp_options, $rcp_db_name, $wpdb;
    $page = admin_url('/admin.php?page=rcp-member-levels');
    ?>
	<div class="wrap">
		<?php 
    if (isset($_GET['edit_subscription'])) {
        include 'edit-subscription.php';
    } else {
        ?>
			<h2><?php 
        _e('Subscription Levels', 'rcp');
        ?>
</h2>
			<table class="wp-list-table widefat fixed posts rcp-subscriptions">
				<thead>
					<tr>
						<th scope="col" class="rcp-sub-name-col column-primary"><?php 
        _e('Name', 'rcp');
        ?>
</th>
						<th scope="col" class="rcp-sub-desc-col"><?php 
        _e('Description', 'rcp');
        ?>
</th>
						<th scope="col" class="rcp-sub-level-col"><?php 
        _e('Access Level', 'rcp');
        ?>
</th>
						<th scope="col" class="rcp-sub-duration-col"><?php 
        _e('Duration', 'rcp');
        ?>
</th>
						<th scope="col" class="rcp-sub-price-col"><?php 
        _e('Price', 'rcp');
        ?>
</th>
						<th scope="col" class="rcp-sub-subs-col"><?php 
        _e('Subscribers', 'rcp');
        ?>
</th>
						<?php 
        do_action('rcp_levels_page_table_header');
        ?>
						<th scope="col" class="rcp-sub-order-col"><?php 
        _e('Order', 'rcp');
        ?>
</th>
					</tr>
				</thead>
				<tbody id="the-list">
				<?php 
        $levels = rcp_get_subscription_levels('all');
        ?>
				<?php 
        if ($levels) {
            $i = 1;
            foreach ($levels as $key => $level) {
                ?>
						<tr id="recordsArray_<?php 
                echo $level->id;
                ?>
" class="rcp-subscription rcp_row <?php 
                if (rcp_is_odd($i)) {
                    echo 'alternate';
                }
                ?>
">
							<td class="rcp-sub-name-col column-primary has-row-actions" data-colname="<?php 
                _e('Name', 'rcp');
                ?>
">
								<strong><a href="<?php 
                echo esc_url(add_query_arg('edit_subscription', $level->id, $page));
                ?>
"><?php 
                echo stripslashes($level->name);
                ?>
</a></strong>
								<?php 
                if (current_user_can('rcp_manage_levels')) {
                    ?>
									<div class="row-actions">
										<span class="rcp-sub-id-col" data-colname="<?php 
                    _e('ID:', 'rcp');
                    ?>
"> <?php 
                    echo __('ID:', 'rcp') . ' ' . $level->id;
                    ?>
 | </span>
										<a href="<?php 
                    echo esc_url(add_query_arg('edit_subscription', $level->id, $page));
                    ?>
"><?php 
                    _e('Edit', 'rcp');
                    ?>
</a> |
										<?php 
                    if ($level->status != 'inactive') {
                        ?>
											<a href="<?php 
                        echo esc_url(add_query_arg('deactivate_subscription', $level->id, $page));
                        ?>
"><?php 
                        _e('Deactivate', 'rcp');
                        ?>
</a> |
										<?php 
                    } else {
                        ?>
											<a href="<?php 
                        echo esc_url(add_query_arg('activate_subscription', $level->id, $page));
                        ?>
"><?php 
                        _e('Activate', 'rcp');
                        ?>
</a> |
										<?php 
                    }
                    ?>
										<a href="<?php 
                    echo esc_url(add_query_arg('delete_subscription', $level->id, $page));
                    ?>
" class="rcp_delete_subscription"><?php 
                    _e('Delete', 'rcp');
                    ?>
</a>
									</div>
								<?php 
                }
                ?>
								<button type="button" class="toggle-row"><span class="screen-reader-text"><?php 
                _e('Show more details', 'rcp');
                ?>
</span></button>
							</td>
							<td class="rcp-sub-desc-col" data-colname="<?php 
                _e('Description', 'rcp');
                ?>
"><?php 
                echo stripslashes($level->description);
                ?>
</td>
							<td class="rcp-sub-level-col" data-colname="<?php 
                _e('Access Level', 'rcp');
                ?>
"><?php 
                echo $level->level != '' ? $level->level : __('none', 'rcp');
                ?>
</td>
							<td class="rcp-sub-duration-col" data-colname="<?php 
                _e('Duration', 'rcp');
                ?>
">
								<?php 
                if ($level->duration > 0) {
                    echo $level->duration . ' ' . rcp_filter_duration_unit($level->duration_unit, $level->duration);
                } else {
                    echo __('unlimited', 'rcp');
                }
                ?>
							</td>
							<td class="rcp-sub-price-col" data-colname="<?php 
                _e('Price', 'rcp');
                ?>
">
								<?php 
                $price = rcp_get_subscription_price($level->id);
                if (!$price) {
                    echo __('Free', 'rcp');
                } else {
                    echo rcp_currency_filter($price);
                }
                ?>
							</td>
							<td class="rcp-sub-subs-col" data-colname="<?php 
                _e('Subscribers', 'rcp');
                ?>
">
								<?php 
                if ($price || $level->duration > 0) {
                    echo rcp_get_subscription_member_count($level->id, 'active');
                } else {
                    echo rcp_get_subscription_member_count($level->id, 'free');
                }
                ?>
							</td>
							<?php 
                do_action('rcp_levels_page_table_column', $level->id);
                ?>
							<td class="rcp-sub-order-col"><a href="#" class="dragHandle"></a></td>
						</tr>
					<?php 
                $i++;
            }
        } else {
            ?>
					<tr><td colspan="9"><?php 
            _e('No subscription levels added yet.', 'rcp');
            ?>
</td></tr>
				<?php 
        }
        ?>
				</tbody>
				<tfoot>
					<tr>
						<th scope="col" class="rcp-sub-name-col column-primary"><?php 
        _e('Name', 'rcp');
        ?>
</th>
						<th scope="col" class="rcp-sub-desc-col"><?php 
        _e('Description', 'rcp');
        ?>
</th>
						<th scope="col" class="rcp-sub-level-col"><?php 
        _e('Access Level', 'rcp');
        ?>
</th>
						<th scope="col" class="rcp-sub-duration-col"><?php 
        _e('Duration', 'rcp');
        ?>
</th>
						<th scope="col" class="rcp-sub-price-col"><?php 
        _e('Price', 'rcp');
        ?>
</th>
						<th scope="col" class="rcp-sub-subs-col"><?php 
        _e('Subscribers', 'rcp');
        ?>
</th>
						<?php 
        do_action('rcp_levels_page_table_footer');
        ?>
						<th scope="col" class="rcp-sub-order-col"><?php 
        _e('Order', 'rcp');
        ?>
</th>
					</tr>
				</tfoot>
			</table>
			<?php 
        do_action('rcp_levels_below_table');
        ?>
			<?php 
        if (current_user_can('rcp_manage_levels')) {
            ?>
				<h3><?php 
            _e('Add New Level', 'rcp');
            ?>
</h3>
				<form id="rcp-member-levels" action="" method="post">
					<table class="form-table">
						<tbody>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-name"><?php 
            _e('Name', 'rcp');
            ?>
</label>
								</th>
								<td>
									<input type="text" id="rcp-name" name="name" value="" style="width: 300px;"/>
									<p class="description"><?php 
            _e('The name of the membership level.', 'rcp');
            ?>
</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-description"><?php 
            _e('Description', 'rcp');
            ?>
</label>
								</th>
								<td>
									<textarea id="rcp-description" name="description" style="width: 300px;"></textarea>
									<p class="description"><?php 
            _e('Membership level description. This is shown on the registration form.', 'rcp');
            ?>
</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-level"><?php 
            _e('Access Level', 'rcp');
            ?>
</label>
								</th>
								<td>
									<select id="rcp-level" name="level">
										<?php 
            $access_levels = rcp_get_access_levels();
            foreach ($access_levels as $access) {
                echo '<option value="' . $access . '">' . $access . '</option>';
            }
            ?>
									</select>
									<p class="description">
										<?php 
            _e('Level of access this subscription gives. Leave None for default or you are unsure what this is.', 'rcp');
            ?>
										<span alt="f223" class="rcp-help-tip dashicons dashicons-editor-help" title="<?php 
            _e('<strong>Access Level</strong>: refers to a tiered system where a member\'s ability to view content is determined by the access level assigned to their account. A member with an access level of 5 can view content assigned to access levels of 5 and lower, whereas a member with an access level of 4 can only view content assigned to levels of 4 and lower.', 'rcp');
            ?>
"></span>
									</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-duration"><?php 
            _e('Duration', 'rcp');
            ?>
</label>
								</th>
								<td>
									<input type="text" id="rcp-duration" style="width: 40px;" name="duration" value="0"/>
									<select name="duration_unit" id="rcp-duration-unit">
										<option value="day"><?php 
            _e('Day(s)', 'rcp');
            ?>
</option>
										<option value="month"><?php 
            _e('Month(s)', 'rcp');
            ?>
</option>
										<option value="year"><?php 
            _e('Year(s)', 'rcp');
            ?>
</option>
									</select>
									<p class="description">
										<?php 
            _e('Length of time for this membership level. Enter 0 for unlimited.', 'rcp');
            ?>
										<span alt="f223" class="rcp-help-tip dashicons dashicons-editor-help" title="<?php 
            _e('<strong>Example</strong>: setting this to 1 month would make memberships last 1 month, after which they will renew automatically or be marked as expired.', 'rcp');
            ?>
"></span>
									</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-price"><?php 
            _e('Price', 'rcp');
            ?>
</label>
								</th>
								<td>
									<input type="text" id="rcp-price" name="price" value="0" pattern="^(\d+\.\d{2})|(\d+)$" style="width: 40px;"/>
									<select name="rcp-price-select" id="rcp-price-select">
										<option value="normal"><?php 
            echo rcp_get_currency();
            ?>
</option>
										<option value="free"><?php 
            _e('Free', 'rcp');
            ?>
</option>
									</select>
									<p class="description">
										<?php 
            _e('The price of this membership level. Enter 0 for free.', 'rcp');
            ?>
										<span alt="f223" class="rcp-help-tip dashicons dashicons-editor-help" title="<?php 
            _e('This price refers to the amount paid per duration period. For example, if duration period is set to 1 month, this would be the amount charged each month.', 'rcp');
            ?>
"></span>
									</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-fee"><?php 
            _e('Signup Fee', 'rcp');
            ?>
</label>
								</th>
								<td>
									<input type="text" id="rcp-fee" name="fee" value="0" style="width: 40px;"/>
									<p class="description"><?php 
            _e('Optional signup fee to charge subscribers for the first billing cycle. Enter a negative number to give a discount on the first payment.', 'rcp');
            ?>
</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-status"><?php 
            _e('Status', 'rcp');
            ?>
</label>
								</th>
								<td>
									<select name="status" id="rcp-status">
										<option value="active"><?php 
            _e('Active', 'rcp');
            ?>
</option>
										<option value="inactive"><?php 
            _e('Inactive', 'rcp');
            ?>
</option>
									</select>
									<p class="description"><?php 
            _e('Members may only sign up for active subscription levels.', 'rcp');
            ?>
</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-role"><?php 
            _e('User Role', 'rcp');
            ?>
</label>
								</th>
								<td>
									<select name="role" id="rcp-role">
										<?php 
            wp_dropdown_roles('subscriber');
            ?>
									</select>
									<p class="description"><?php 
            _e('The user role given to the member after signing up.', 'rcp');
            ?>
</p>
								</td>
							</tr>
							<?php 
            do_action('rcp_add_subscription_form');
            ?>
						</tbody>
					</table>
					<p class="submit">
						<input type="hidden" name="rcp-action" value="add-level"/>
						<input type="submit" value="<?php 
            _e('Add Membership Level', 'rcp');
            ?>
" class="button-primary"/>
					</p>
					<?php 
            wp_nonce_field('rcp_add_level_nonce', 'rcp_add_level_nonce');
            ?>
				</form>
			<?php 
        }
        ?>
		<?php 
    }
    ?>
	</div><!--end wrap-->

	<?php 
}
function rcp_member_levels_page()
{
    global $rcp_options, $rcp_db_name, $wpdb;
    $page = admin_url('/admin.php?page=rcp-member-levels');
    ?>
	<div class="wrap">
		<?php 
    if (isset($_GET['edit_subscription'])) {
        include 'edit-subscription.php';
    } else {
        ?>
			<h2><?php 
        _e('Subscription Levels', 'rcp');
        ?>
</h2>

			<table class="wp-list-table widefat fixed posts rcp-subscriptions">
				<thead>
					<tr>
						<th class="rcp-sub-order-col"><?php 
        _e('Order', 'rcp');
        ?>
</th>
						<th class="rcp-sub-id-col"><?php 
        _e('ID', 'rcp');
        ?>
</th>
						<th class="rcp-sub-name-col"><?php 
        _e('Name', 'rcp');
        ?>
</th>
						<th class="rcp-sub-desc-col"><?php 
        _e('Description', 'rcp');
        ?>
</th>
						<th class="rcp-sub-level-col"><?php 
        _e('Access Level', 'rcp');
        ?>
</th>
						<th class="rcp-sub-duration-col"><?php 
        _e('Duration', 'rcp');
        ?>
</th>
						<th class="rcp-sub-price-col"><?php 
        _e('Price', 'rcp');
        ?>
</th>
						<th class="rcp-sub-subs-col"><?php 
        _e('Subscribers', 'rcp');
        ?>
</th>
						<?php 
        do_action('rcp_levels_page_table_header');
        ?>
						<?php 
        if (current_user_can('rcp_manage_levels')) {
            ?>
							<th class="rcp-sub-actions-col"><?php 
            _e('Actions', 'rcp');
            ?>
</th>
						<?php 
        }
        ?>
					</tr>
				</thead>
				<tfoot>
					<tr>
						<th class="rcp-sub-order-col"><?php 
        _e('Order', 'rcp');
        ?>
</th>
						<th class="rcp-sub-id-col"><?php 
        _e('ID', 'rcp');
        ?>
</th>
						<th class="rcp-sub-name-col"><?php 
        _e('Name', 'rcp');
        ?>
</th>
						<th class="rcp-sub-desc-col" style="width: 300px;"><?php 
        _e('Description', 'rcp');
        ?>
</th>
						<th class="rcp-sub-level-col"><?php 
        _e('Access Level', 'rcp');
        ?>
</th>
						<th class="rcp-sub-duration-col"><?php 
        _e('Duration', 'rcp');
        ?>
</th>
						<th class="rcp-sub-price-col"><?php 
        _e('Price', 'rcp');
        ?>
</th>
						<th class="rcp-sub-subs-col"><?php 
        _e('Subscribers', 'rcp');
        ?>
</th>
						<?php 
        do_action('rcp_levels_page_table_footer');
        ?>
						<?php 
        if (current_user_can('rcp_manage_levels')) {
            ?>
							<th class="rcp-sub-actions-col"><?php 
            _e('Actions', 'rcp');
            ?>
</th>
						<?php 
        }
        ?>
					</tr>
				</tfoot>
				<tbody>
				<?php 
        $levels = rcp_get_subscription_levels('all');
        ?>
				<?php 
        if ($levels) {
            $i = 1;
            foreach ($levels as $key => $level) {
                ?>
						<tr id="recordsArray_<?php 
                echo $level->id;
                ?>
" class="rcp-subscription rcp_row <?php 
                if (rcp_is_odd($i)) {
                    echo 'alternate';
                }
                ?>
">
							<td class="rcp-sub-order-col"><a href="#" class="dragHandle"></a></td>
							<td class="rcp-sub-id-col"><?php 
                echo $level->id;
                ?>
</td>
							<td class="rcp-sub-name-col"><?php 
                echo stripslashes($level->name);
                ?>
</td>
							<td class="rcp-sub-desc-col"><?php 
                echo stripslashes($level->description);
                ?>
</td>
							<td class="rcp-sub-level-col"><?php 
                echo $level->level != '' ? $level->level : __('none', 'rcp');
                ?>
</td>
							<td class="rcp-sub-duration-col">
								<?php 
                if ($level->duration > 0) {
                    echo $level->duration . ' ' . rcp_filter_duration_unit($level->duration_unit, $level->duration);
                } else {
                    echo __('unlimited', 'rcp');
                }
                ?>
							</td>
							<td class="rcp-sub-price-col">
								<?php 
                $price = rcp_get_subscription_price($level->id);
                if (!$price) {
                    echo __('Free', 'rcp');
                } else {
                    echo rcp_currency_filter($price);
                }
                ?>
							</td>
							<td class="rcp-sub-subs-col">
								<?php 
                if ($price || $level->duration > 0) {
                    echo rcp_count_members($level->id, 'active');
                } else {
                    echo rcp_count_members($level->id, 'free');
                }
                ?>
							</td>
							<?php 
                do_action('rcp_levels_page_table_column', $level->id);
                ?>
							<?php 
                if (current_user_can('rcp_manage_levels')) {
                    ?>
								<td class="rcp-sub-actions-col">
									<a href="<?php 
                    echo esc_url(add_query_arg('edit_subscription', $level->id, $page));
                    ?>
"><?php 
                    _e('Edit', 'rcp');
                    ?>
</a> |
									<?php 
                    if ($level->status != 'inactive') {
                        ?>
										<a href="<?php 
                        echo esc_url(add_query_arg('deactivate_subscription', $level->id, $page));
                        ?>
"><?php 
                        _e('Deactivate', 'rcp');
                        ?>
</a> |
									<?php 
                    } else {
                        ?>
										<a href="<?php 
                        echo esc_url(add_query_arg('activate_subscription', $level->id, $page));
                        ?>
"><?php 
                        _e('Activate', 'rcp');
                        ?>
</a> |
									<?php 
                    }
                    ?>
									<a href="<?php 
                    echo esc_url(add_query_arg('delete_subscription', $level->id, $page));
                    ?>
" class="rcp_delete_subscription"><?php 
                    _e('Delete', 'rcp');
                    ?>
</a>
								</td>
							<?php 
                }
                ?>
						</tr>
					<?php 
                $i++;
            }
        } else {
            ?>
					<tr><td colspan="9"><?php 
            _e('No subscription levels added yet.', 'rcp');
            ?>
</td>
				<?php 
        }
        ?>
			</table>
			<?php 
        do_action('rcp_levels_below_table');
        ?>
			<?php 
        if (current_user_can('rcp_manage_levels')) {
            ?>
				<h3><?php 
            _e('Add New Level', 'rcp');
            ?>
</h3>
				<form id="rcp-member-levels" action="" method="post">
					<table class="form-table">
						<tbody>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-name"><?php 
            _e('Name', 'rcp');
            ?>
</label>
								</th>
								<td>
									<input type="text" id="rcp-name" name="name" value="" style="width: 300px;"/>
									<p class="description"><?php 
            _e('The name of the membership level.', 'rcp');
            ?>
</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-description"><?php 
            _e('Description', 'rcp');
            ?>
</label>
								</th>
								<td>
									<textarea id="rcp-description" name="description" style="width: 300px;"></textarea>
									<p class="description"><?php 
            _e('Membership level description. This is shown on the registration form.', 'rcp');
            ?>
</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-level"><?php 
            _e('Access Level', 'rcp');
            ?>
</label>
								</th>
								<td>
									<select id="rcp-level" name="level">
										<?php 
            $access_levels = rcp_get_access_levels();
            foreach ($access_levels as $access) {
                echo '<option value="' . $access . '">' . $access . '</option>';
            }
            ?>
									</select>
									<p class="description"><?php 
            _e('Level of access this subscription gives. Leave None for default or you are unsure what this is.', 'rcp');
            ?>
</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-duration"><?php 
            _e('Duration', 'rcp');
            ?>
</label>
								</th>
								<td>
									<input type="text" id="rcp-duration" style="width: 40px;" name="duration" value=""/>
									<select name="duration_unit" id="rcp-duration-unit">
										<option value="day"><?php 
            _e('Day(s)', 'rcp');
            ?>
</option>
										<option value="month"><?php 
            _e('Month(s)', 'rcp');
            ?>
</option>
										<option value="year"><?php 
            _e('Year(s)', 'rcp');
            ?>
</option>
									</select>
									<p class="description"><?php 
            _e('Length of time for this membership level. Enter 0 for unlimited.', 'rcp');
            ?>
</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-price"><?php 
            _e('Price', 'rcp');
            ?>
</label>
								</th>
								<td>
									<input type="text" id="rcp-price" name="price" value="" style="width: 40px;"/>
									<select name="rcp-price-select" id="rcp-price-select">
										<option value="normal"><?php 
            echo isset($rcp_options['currency']) ? $rcp_options['currency'] : 'USD';
            ?>
</option>
										<option value="free"><?php 
            _e('Free', 'rcp');
            ?>
</option>
									</select>
									<p class="description"><?php 
            _e('The price of this membership level. Enter 0 for free.', 'rcp');
            ?>
</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-fee"><?php 
            _e('Signup Fee', 'rcp');
            ?>
</label>
								</th>
								<td>
									<input type="text" id="rcp-fee" name="fee" value="" style="width: 40px;"/>
									<p class="description"><?php 
            _e('Optional signup fee to charge subscribers for the first billing cycle. Enter a negative number to give a discount on the first payment. This only applies to recurring subscriptions.', 'rcp');
            ?>
</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-status"><?php 
            _e('Status', 'rcp');
            ?>
</label>
								</th>
								<td>
									<select name="status" id="rcp-status">
										<option value="active"><?php 
            _e('Active', 'rcp');
            ?>
</option>
										<option value="inactive"><?php 
            _e('Inactive', 'rcp');
            ?>
</option>
									</select>
									<p class="description"><?php 
            _e('Members may only sign up for active subscription levels.', 'rcp');
            ?>
</p>
								</td>
							</tr>
							<tr class="form-field">
								<th scope="row" valign="top">
									<label for="rcp-role"><?php 
            _e('User Role', 'rcp');
            ?>
</label>
								</th>
								<td>
									<select name="role" id="rcp-role">
										<?php 
            wp_dropdown_roles('subscriber');
            ?>
									</select>
									<p class="description"><?php 
            _e('The user role given to the member after signing up.', 'rcp');
            ?>
</p>
								</td>
							</tr>
							<?php 
            do_action('rcp_add_subscription_form');
            ?>
						</tbody>
					</table>
					<p class="submit">
						<input type="hidden" name="rcp-action" value="add-level"/>
						<input type="submit" value="<?php 
            _e('Add Membership Level', 'rcp');
            ?>
" class="button-primary"/>
					</p>
				</form>
			<?php 
        }
        ?>
		<?php 
    }
    ?>
	</div><!--end wrap-->

	<?php 
}
    /**
     * widget function.
     *
     * @see WP_Widget
     * @access public
     * @param array $args
     * @param array $instance
     * @return void
     */
    function widget($args, $instance)
    {
        if ($this->get_cached_widget($args)) {
            return;
        }
        ob_start();
        extract($args);
        $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
        $description = $instance['description'];
        $levels = rcp_get_subscription_levels('active');
        if (!$levels) {
            return;
        }
        $content = ob_get_clean();
        echo $before_widget;
        ?>

		<div class="container">

			<?php 
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>

			<?php 
        if ($description) {
            ?>
				<p class="homepage-widget-description"><?php 
            echo $description;
            ?>
</p>
			<?php 
        }
        ?>

			<div class="job-packages row">

				<?php 
        foreach ($levels as $key => $level) {
            ?>
					<?php 
            if (rcp_show_subscription_level($level->id)) {
                ?>

					<div class="col-lg-4 col-md-6 col-sm-12 pricing-table-widget-wrapper">
						<div class="pricing-table-widget rcp_subscription_level rcp_subscription_level_fake" data-href="<?php 
                echo esc_url(get_permalink(jobify_find_page_with_shortcode(array('register_form'))));
                ?>
">
							<div class="pricing-table-widget-title">
								<span class="rcp_subscription_level_name"><?php 
                echo stripslashes($level->name);
                ?>
</span>
							</div>

							<div class="pricing-table-widget-description">
								<h2>
									<span class="rcp_price" rel="<?php 
                echo esc_attr($level->price);
                ?>
">
										<?php 
                if ($level->fee) {
                    ?>
											<?php 
                    $adjusted_price = $level->price + $level->fee;
                    ?>
											<?php 
                    echo $adjusted_price > 0 ? rcp_currency_filter($adjusted_price) : __('free', 'jobify');
                    ?>
											</h2>
											<small>
												<?php 
                    $promo_duration = sprintf(_n('%2$s', '%1$s %2$ss', $level->duration, 'jobify'), $level->duration, $level->duration_unit);
                    ?>
												<?php 
                    printf(__('* %s after first %s', 'jobify'), rcp_currency_filter($level->price), $promo_duration);
                    ?>
											</small>
										<?php 
                } else {
                    ?>
											<?php 
                    $adjusted_price = $level->price;
                    ?>
											<?php 
                    echo $adjusted_price > 0 ? rcp_currency_filter($adjusted_price) : __('free', 'jobify');
                    ?>
											</h2>
										<?php 
                }
                ?>
									</span>
								</h2>

								<p><span class="rcp_level_duration"><?php 
                echo $level->duration > 0 ? $level->duration . '&nbsp;' . rcp_filter_duration_unit($level->duration_unit, $level->duration) : __('unlimited', 'jobify');
                ?>
</span></p>

								<?php 
                echo wpautop(wp_kses(stripslashes($level->description), rcp_allowed_html_tags()));
                ?>

								<p><a href="#" class="rcp-select button"><?php 
                _e('Get Started', 'jobify');
                ?>
</a></p>
							</div>
						</div>
					</div>
					<?php 
            }
            ?>
				<?php 
        }
        ?>
			</div>

		</div>

		<?php 
        echo $after_widget;
        echo $content;
        $this->cache_widget($args, $content);
    }
</th>
			<th><?php 
rcp_registration_total();
?>
</th>
		</tr>

		<?php 
if (rcp_registration_is_recurring()) {
    ?>
			<?php 
    $subscription = rcp_get_subscription_details(rcp_get_registration()->get_subscription());
    if ($subscription->duration == 1) {
        $label = sprintf(__('Total Recurring Per %s', 'rcp'), rcp_filter_duration_unit($subscription->duration_unit, 1));
    } else {
        $label = sprintf(__('Total Recurring Every %s %s', 'rcp'), $subscription->duration, rcp_filter_duration_unit($subscription->duration_unit, $subscription->duration));
    }
    ?>
			<tr class="rcp-recurring-total">
				<th><?php 
    echo $label;
    ?>
</th>
				<th><?php 
    rcp_registration_recurring_total();
    ?>
</th>
			</tr>
		<?php 
}
?>
Пример #11
0
    /**
     * widget function.
     *
     * @see WP_Widget
     * @access public
     * @param array $args
     * @param array $instance
     * @return void
     */
    function widget($args, $instance)
    {
        if ($this->get_cached_widget($args)) {
            return;
        }
        ob_start();
        extract($args);
        $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
        $description = $instance['description'];
        $levels = rcp_get_subscription_levels('active');
        if (!$levels) {
            return;
        }
        $content = ob_get_clean();
        echo $before_widget;
        ?>

		<div class="container">

			<?php 
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>

			<?php 
        if ($description) {
            ?>
				<p class="homepage-widget-description"><?php 
            echo $description;
            ?>
</p>
			<?php 
        }
        ?>

			<div class="pricing-table-widget-<?php 
        echo count($levels);
        ?>
">
				<?php 
        foreach ($levels as $key => $level) {
            ?>
					<?php 
            if (rcp_show_subscription_level($level->id)) {
                ?>
					<div id="rcp_subscription_level_<?php 
                echo $level->id;
                ?>
" class="pricing-table-widget rcp_subscription_level_fake" data-href="<?php 
                echo esc_url(get_permalink(jobify_find_page_with_shortcode(array('register_form'))));
                ?>
">
						<div class="pricing-table-widget-title" style="background-color: #01da90">
							<span class="rcp_subscription_level_name"><?php 
                echo stripslashes($level->name);
                ?>
</span>
						</div>

						<div class="pricing-table-widget-description">
							<h2><span class="rcp_price" rel="<?php 
                echo esc_attr($level->price);
                ?>
"><?php 
                echo $level->price > 0 ? rcp_currency_filter($level->price) : __('free', 'jobify');
                ?>
</h2>

							<p><span class="rcp_level_duration"><?php 
                echo $level->duration > 0 ? $level->duration . '&nbsp;' . rcp_filter_duration_unit($level->duration_unit, $level->duration) : __('unlimited', 'jobify');
                ?>
</span></p>

							<?php 
                echo wpautop(wp_kses($level->description, rcp_allowed_html_tags()));
                ?>
						</div>
					</div>
					<?php 
            }
            ?>
				<?php 
        }
        ?>
			</div>

		</div>

		<?php 
        echo $after_widget;
        echo $content;
        $this->cache_widget($args, $content);
    }