stat-card-hover.php
55 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Stat Card Hover Content |
| 4 | * |
| 5 | * @package Tutor\Templates |
| 6 | * @since 4.0.0 |
| 7 | */ |
| 8 | |
| 9 | defined( 'ABSPATH' ) || exit; |
| 10 | |
| 11 | use Tutor\Components\SvgIcon; |
| 12 | |
| 13 | $start_date = $data['start_date'] ?? ''; |
| 14 | $end_date = $data['end_date'] ?? ''; |
| 15 | $hover_content = $data['hover_content']; |
| 16 | $hover_amount = $data['hover_amount']; |
| 17 | $time_zone = wp_timezone(); |
| 18 | $previous_start_date = $hover_content['previous_start_date'] ?? ''; |
| 19 | $previous_end_date = $hover_content['previous_end_date'] ?? ''; |
| 20 | |
| 21 | ?> |
| 22 | |
| 23 | <div class="tutor-stat-card-hover tutor-m-1"> |
| 24 | <div class="tutor-stat-card-hover-wrap"> |
| 25 | <span class="stat-hover-trigger <?php echo esc_attr( $hover_content['class'] ?? '' ); ?>"> |
| 26 | <?php echo esc_html( $hover_content['percentage'] ); ?> |
| 27 | <?php SvgIcon::make()->name( $hover_content['icon'] )->size( 16 )->attr( 'class', $hover_content['icon_class'] ?? '' )->render(); ?> |
| 28 | </span> |
| 29 | |
| 30 | <div class="tutor-stat-card-hover-card"> |
| 31 | <div class="tutor-flex tutor-items-center tutor-gap-4 tutor-tiny tutor-text-secondary"> |
| 32 | <span> |
| 33 | <?php echo esc_html( tutor_i18n_get_formated_date( $previous_start_date, 'M j' ) ); ?> - |
| 34 | <?php echo esc_html( tutor_i18n_get_formated_date( $previous_end_date, 'M j Y' ) ); ?> |
| 35 | </span> |
| 36 | <span class="tutor-text-subdued"><?php echo esc_html_e( 'vs', 'tutor' ); ?></span> |
| 37 | <span> |
| 38 | <?php echo esc_html( tutor_i18n_get_formated_date( $start_date, 'M j' ) ); ?> - |
| 39 | <?php echo esc_html( tutor_i18n_get_formated_date( $end_date, 'M j Y' ) ); ?> |
| 40 | </span> |
| 41 | </div> |
| 42 | <div class="tutor-flex tutor-items-center tutor-gap-4 tutor-justify-between tutor-mt-5"> |
| 43 | <span class="tutor-font-semibold tutor-text-primary tutor-tiny"> |
| 44 | <?php echo wp_kses( $hover_amount, tutor_price_allowed_html() ); ?> |
| 45 | </span> |
| 46 | <span class="stat-hover-trigger <?php echo esc_attr( $hover_content['class'] ?? '' ); ?>"> |
| 47 | <?php echo esc_html( $hover_content['percentage'] ); ?> |
| 48 | <?php SvgIcon::make()->name( $hover_content['icon'] )->size( 16 )->attr( 'class', $hover_content['icon_class'] ?? '' )->render(); ?> |
| 49 | </span> |
| 50 | </div> |
| 51 | </div> |
| 52 | </div> |
| 53 | </div> |
| 54 | |
| 55 |