| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
|
| 6 |
$classname = 'frm-counter-card-wrapper frm-flex-box'; |
| 7 |
?> |
| 8 |
|
| 9 |
<?php if ( ! empty( $template ) && isset( $template['counters'] ) && is_array( $template['counters'] ) ) : ?> |
| 10 |
<div class="<?php echo esc_attr( $classname ); ?>"> |
| 11 |
|
| 12 |
<?php foreach ( $template['counters'] as $counter ) : ?> |
| 13 |
<div class="frm-counter-card frm-dashboard-widget frm-card-item"> |
| 14 |
<h4><?php echo esc_html( $counter['heading'] ); ?></h4> |
| 15 |
<?php if ( isset( $counter['cta'] ) && isset( $counter['cta']['display'] ) && true === $counter['cta']['display'] ) : ?> |
| 16 |
<a href="<?php echo esc_url( $counter['cta']['link'] ); ?>"><?php echo esc_attr( $counter['cta']['title'] ); ?></a> |
| 17 |
<?php else : ?> |
| 18 |
<?php if ( 'currency' === $counter['type'] ) : ?> |
| 19 |
<div class="frm-flex-box frm-gap-md"> |
| 20 |
<?php foreach ( $counter['items'] as $item ) : ?> |
| 21 |
<b> |
| 22 |
<?php echo esc_attr( $item['counter_label']['symbol_left'] ); ?> |
| 23 |
<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $item['counter']; ?>"><?php echo (int) $item['counter']; ?></span> |
| 24 |
<?php echo esc_attr( $item['counter_label']['symbol_right'] ); ?> |
| 25 |
</b> |
| 26 |
<?php endforeach; ?> |
| 27 |
</div> |
| 28 |
<?php else : ?> |
| 29 |
<b> |
| 30 |
<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span> |
| 31 |
</b> |
| 32 |
<?php endif; ?> |
| 33 |
<?php endif; ?> |
| 34 |
</div> |
| 35 |
<?php endforeach; ?> |
| 36 |
</div> |
| 37 |
<?php endif; ?> |
| 38 |
|