Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( $tab_content['selected_donation_form'] ) :
- $form_query = new WP_Query(
- array(
- 'posts_per_page' => 1,
- 'post_type' => 'give_forms',
- 'p' => $tab_content['selected_donation_form'],
- )
- );
- while ( $form_query->have_posts() ) : $form_query->the_post();
- $stats = give_goal_progress_stats( get_the_ID() );
- if ( $stats['raw_actual'] != 0 ) {
- $bar_width = $stats['goal'] ? (int) ( $stats['raw_actual'] / $stats['raw_goal'] * 100 ) : 0;
- }
- $lack_value = give_format_amount( $stats['raw_goal'] - $stats['raw_actual'] );
- if ( 'amount' === $stats['format'] ) {
- $lack_amount = give_currency_filter( $lack_value );
- } else {
- $lack_amount = $lack_value;
- }
- ?>
- <?php if ( $stats['raw_actual'] != 0 ) : ?>
- <div class="cr-donation-progress-bar">
- <div class="cr-donation-bar-container" style="width:<?php echo $bar_width; ?>%">
- <span class="cr-donation-bar-label"><?php echo $bar_width; ?>%</span>
- </div>
- </div>
- <?php endif; ?>
- <div class="status">
- <ul class="cr-list-style cr-list-inline">
- <li><span class="label">goal</span><span class="amount"><?php echo $stats['goal']; ?></span></li>
- <li><span class="label">Raised</span><span class="amount"><?php echo $stats['actual']; ?></span></li>
- <li><span class="label">To Go</span><span class="amount"><?php echo $lack_amount; ?></span></li>
- </ul>
- </div>
- <?php endwhile;
- wp_reset_query(); endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement