</span>
						<span class="count-status-desc"><?php 
echo _n('Company', 'Companies', $companies, 'jobboard');
?>
</span>
					</div><!-- /.account-status-item -->

					<?php 
if (jobboard_package_is_enabled('_package_resume_view')) {
    ?>

					<!-- Remaining resume view -->
					<div class="account-status-item" id="status-limit-entry">
						<span class="count-status-number">
							<?php 
    $count = jobboard_get_user_view_remaining(get_current_user_id(), 'resume');
    $unlimited = '';
    if (empty($count)) {
        echo 0;
    }
    if (!empty($count) && $count != 'unlimited' && !($count < 0)) {
        echo $count;
    }
    if ($count < 0) {
        echo 0;
    }
    if ($count == 'unlimited' && !empty($count)) {
        $unlimited = 'Unlimited ';
        echo '<i class="fa fa-refresh"></i>';
    }
    /*
Example #2
0
/**
 * Payment
 */
function jobboard_active_package_html($user_id, $cpt_args)
{
    $cpt = '';
    $package_heading = '';
    if (!empty($cpt_args) && ($cpt_args = array('resume_view'))) {
        if (jobboard_get_user_type($user_id) == 'job_lister') {
            $cpt = '_resume_subscription';
            $package_heading = __('Resume View Packages:', 'jobboard');
        }
    } else {
        if (jobboard_get_user_type($user_id) == 'job_lister') {
            $cpt = '_package_job';
            $package_heading = __('Job Packages:', 'jobboard');
        }
        if (jobboard_get_user_type($user_id) == 'job_seeker') {
            $cpt = '_package_resume';
            $package_heading = __('Resume Packages:', 'jobboard');
        }
    }
    $package_data = jobboard_get_packages_obj($cpt);
    $active_pack = jobboard_get_user_active_package_data($user_id, $cpt);
    $active_pack_id = $active_pack->ID;
    /**
     * Form processing
     */
    if (isset($_POST['update-package-frontend'])) {
        update_user_meta($user_id, 'jobboard_user' . $cpt, $_POST['jobboard_user' . $cpt]);
        wp_redirect(get_permalink());
        exit;
    }
    /**
     * Paypal payment starts
    */
    $action = '';
    if ('1' == jobboard_option('activate_payment')) {
        $action = jobboard_get_payment_mode();
        $custom = $cpt;
        $listener_url = add_query_arg('action', 'payment_success', esc_url(home_url('/')));
        $args = array('action' => 'payment_success', 'do' => 'update_package');
        $return_url = add_query_arg($args, esc_url(jobboard_get_permalink('dashboard')));
        ?>
			<div class="package-tabs">

			<?php 
        /** Tab Menu **/
        echo '<ul>';
        echo '<h4 class="package-heading">' . $package_heading . '</h4>';
        $user_package = jobboard_get_user_package($user_id, $cpt);
        if (!$user_package) {
            echo '<p class="active-note innactive">' . __('You don\'t have an active package. Please, select one of these available packages!', 'jobboard') . '</p>';
        }
        foreach ($package_data as $post) {
            setup_postdata($post);
            $checked = '';
            if ($post->ID == $active_pack_id) {
                $checked = 'checked="checked"';
            }
            $fieldname = 'jobboard_user' . $cpt;
            $package_info = array('ID' => $post->ID, 'name' => $post->post_title, 'price' => get_post_meta($post->ID, '_jboard' . $cpt . '_price', true));
            $active = '';
            if ($post->ID == $active_pack_id) {
                $active = 'class="ui-tabs-active ui-state-active"';
            }
            ?>


				<li <?php 
            echo $active;
            ?>
><a href="#package-<?php 
            echo $package_info['ID'];
            ?>
"><?php 
            echo $package_info['name'];
            ?>
</a></li>


			<?php 
        }
        wp_reset_postdata($post);
        echo '</ul><!-- /.package-menu -->';
        /** Tab Menu Ends **/
        ?>

			<?php 
        /** Tab Content **/
        foreach ($package_data as $post) {
            setup_postdata($post);
            $package_info = array('ID' => $post->ID, 'name' => $post->post_title, 'price' => get_post_meta($post->ID, '_jboard' . $cpt . '_price', true), 'notes' => get_post_meta($post->ID, '_jboard' . $cpt . '_notes', true), 'limit' => get_post_meta($post->ID, '_jboard' . $cpt . '_limit', true));
            // Unlimited is set
            $unlimited = get_post_meta($post->ID, '_jboard' . $cpt . '_is_unlimited', true);
            if ($unlimited == '1') {
                $package_info['limit'] = 'unlimited';
            }
            $button_text = __('Buy Package', 'jobboard');
            if ($cpt_args != '') {
                $subscription_id = get_user_meta($user_id, 'jobboard_user' . $cpt);
                if (empty($subscription_id)) {
                    $subscription_id = null;
                }
                $subscription_limit = get_user_meta($user_id, 'jobboard_user' . $cpt . '_max_entry');
                $disabled_view_pack = 'disabled';
                $active_note = '';
                $active_note_pack = '';
                if (empty($subscription_limit) || jobboard_get_user_view_remaining($user_id, 'resume') == '0') {
                    $disabled_view_pack = '';
                    $active_note_pack = '<span class="active-note innactive">' . __('Status: Innactive', 'jobboard') . '</span>';
                } else {
                    $active_note_pack = '<span class="active-note">' . __('Status: Active', 'jobboard') . '</span>';
                }
            } else {
                $subscription_id = null;
                $subscription_limit = '';
                $is_limit = jobboard_package_is_limit($user_id, $cpt);
                $disabled = 'disabled';
                if ($is_limit) {
                    $disabled = '';
                }
                $active_note = '';
                if ($post->ID == $active_pack_id && !$is_limit) {
                    $active_note = '<span class="active-note">' . __('Status: Active', 'jobboard') . '</span>';
                }
                if ($post->ID == $active_pack_id && $is_limit) {
                    $active_note = '<span class="active-note innactive">' . __('Status: Innactive', 'jobboard') . '</span>';
                    // $disabled = 'disabled';
                }
            }
            ?>


				<div id="package-<?php 
            echo $package_info['ID'];
            ?>
" class="package-details">


					<?php 
            if ((int) $subscription_id[0] == $package_info['ID']) {
                echo $active_note_pack;
            } else {
                echo $active_note;
            }
            ?>


					<div class="package-notes">
						<?php 
            echo $package_info['notes'];
            ?>
					</div><!-- /.package-notes -->

					<!-- Payment form -->

						<form id="paypal_approval" name="paypal_approval" action="<?php 
            echo esc_url($action);
            ?>
" method="POST" class="payment-button">
							<input type="hidden" name="cmd" value="_xclick" />
							<input class="package-price" type="hidden" name="amount" value="<?php 
            echo $package_info['price'];
            ?>
" />
							<input type="hidden" name="business" value="<?php 
            echo jobboard_option('paypal_email');
            ?>
" />
							<input class="package-name" type="hidden" name="item_name" value="<?php 
            echo $package_info['name'];
            ?>
" />
							<input class="package-id" type="hidden" name="item_number" value="<?php 
            echo $package_info['ID'];
            ?>
" />
							<input type="hidden" name="no_shipping" value="1" />
							<input type="hidden" name="no_note" value="1" />
							<input type="hidden" name="currency_code" value="<?php 
            echo jobboard_option('payment_currency');
            ?>
" />
							<input type="hidden" name="charset" value="UTF-8" />
							<input type="hidden" name="custom" value="<?php 
            echo esc_attr($custom . ', ' . $package_info['limit']);
            ?>
" />
							<input type="hidden" name="rm" value="2" />
							<input type="hidden" name="cbt" value="<?php 
            echo sprintf(__('Click here to complete the purchase on %s', 'jobboard'), esc_attr(get_bloginfo('name')));
            ?>
" />
							<input type="hidden" name="return" value="<?php 
            echo esc_url($return_url);
            ?>
" />
							<input type="hidden" name="notify_url" value="<?php 
            echo esc_url($listener_url);
            ?>
" />

							<?php 
            if ($cpt_args != '') {
                ?>

								<button <?php 
                echo $disabled_view_pack;
                ?>
 type="submit" name="paynow" class="btn btn-paypal"><?php 
                echo $button_text;
                ?>
</button>

							<?php 
            } else {
                ?>

							<button <?php 
                echo $disabled;
                ?>
 type="submit" name="paynow" class="btn btn-paypal"><?php 
                echo $button_text;
                ?>
</button>

							<?php 
            }
            ?>

					</form>

					<!-- Payment form ends -->


				</div><!-- /.package-details -->


			<?php 
        }
        /** Tab Content Ends **/
        echo '</div><!-- /.package-tabs -->';
        ?>


<?php 
        /**
         * Paypal payment ends
        */
    }
}