| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for displaying the Instructors statistics dashboard tab. |
| 4 |
* |
| 5 |
* Data is rendered by assets/src/js/admin/statistics/tab-instructors.js from |
| 6 |
* the `dashboard` key of the instructor-statistics endpoint. |
| 7 |
* |
| 8 |
* @since 4.4.2 |
| 9 |
*/ |
| 10 |
|
| 11 |
defined( 'ABSPATH' ) || exit(); |
| 12 |
|
| 13 |
$kpi_cards = array( |
| 14 |
'active-instructors' => __( 'Active instructors', 'learnpress' ), |
| 15 |
'instructor-revenue' => __( 'Instructor revenue', 'learnpress' ), |
| 16 |
'courses-managed' => __( 'Courses managed', 'learnpress' ), |
| 17 |
'students-reached' => __( 'Students reached', 'learnpress' ), |
| 18 |
'avg-completion' => __( 'Avg. completion', 'learnpress' ), |
| 19 |
'needs-review' => __( 'Needs review', 'learnpress' ), |
| 20 |
); |
| 21 |
|
| 22 |
$operations = array( |
| 23 |
'top_revenue' => __( 'Top revenue', 'learnpress' ), |
| 24 |
'top_completion' => __( 'Best completion', 'learnpress' ), |
| 25 |
'most_pending' => __( 'Most pending review', 'learnpress' ), |
| 26 |
'no_new_enrollments' => __( 'No new enrollments', 'learnpress' ), |
| 27 |
'review_queue_count' => __( 'Review queue', 'learnpress' ), |
| 28 |
); |
| 29 |
|
| 30 |
// Section config filters — add/remove/relabel cards and lists. @since 4.4.2 |
| 31 |
$kpi_cards = (array) apply_filters( 'learn-press/statistics/instructors/kpi-cards', $kpi_cards ); |
| 32 |
$operations = (array) apply_filters( 'learn-press/statistics/instructors/operations', $operations ); |
| 33 |
?> |
| 34 |
<div class="lp-admin-statistics-tab-content lp-stats-tab-instructors"> |
| 35 |
<?php |
| 36 |
/** |
| 37 |
* Fires at the top of the Instructors statistics tab, inside the tab container. |
| 38 |
* |
| 39 |
* @since 4.4.2 |
| 40 |
*/ |
| 41 |
do_action( 'learn-press/statistics/instructors/before' ); |
| 42 |
|
| 43 |
learn_press_admin_view( 'statistics/parts/filter-bar' ); |
| 44 |
?> |
| 45 |
|
| 46 |
<div class="lp-stats-dashboard-body"> |
| 47 |
<div class="lp-stats-kpi-grid"> |
| 48 |
<?php |
| 49 |
foreach ( $kpi_cards as $key => $title ) { |
| 50 |
learn_press_admin_view( |
| 51 |
'statistics/parts/kpi-card', |
| 52 |
array( |
| 53 |
'key' => $key, |
| 54 |
'title' => $title, |
| 55 |
) |
| 56 |
); |
| 57 |
} |
| 58 |
?> |
| 59 |
</div> |
| 60 |
|
| 61 |
<div class="lp-stats-overview-grid lp-stats-overview-grid--chart"> |
| 62 |
<div class="lp-stats-section statistics-content"> |
| 63 |
<div class="lp-stats-section__header"> |
| 64 |
<div> |
| 65 |
<h3 class="lp-stats-section__title"><?php esc_html_e( 'Instructor revenue and enrollment', 'learnpress' ); ?></h3> |
| 66 |
<p class="lp-stats-section__description"><?php esc_html_e( 'Scoped sales and enrollment trend for instructor performance review.', 'learnpress' ); ?></p> |
| 67 |
</div> |
| 68 |
</div> |
| 69 |
<div id="instructor-chart" class="statistics-chart-wrapper"> |
| 70 |
<?php lp_skeleton_animation_html( 10, 100 ); ?> |
| 71 |
<canvas id="instructor-chart-content" style="display: none;"></canvas> |
| 72 |
</div> |
| 73 |
</div> |
| 74 |
|
| 75 |
<div class="lp-stats-section"> |
| 76 |
<div class="lp-stats-section__header"> |
| 77 |
<h3 class="lp-stats-section__title"><?php esc_html_e( 'Instructor operations', 'learnpress' ); ?></h3> |
| 78 |
</div> |
| 79 |
<?php lp_skeleton_animation_html( 5, 100 ); ?> |
| 80 |
<ul class="lp-stats-operations"> |
| 81 |
<?php foreach ( $operations as $op => $label ) : ?> |
| 82 |
<li class="lp-stats-operations__row" data-op="<?php echo esc_attr( $op ); ?>"> |
| 83 |
<span class="lp-stats-operations__label"><?php echo esc_html( $label ); ?></span> |
| 84 |
<span class="lp-stats-operations__value">–</span> |
| 85 |
<span class="lp-stats-operations__name"></span> |
| 86 |
</li> |
| 87 |
<?php endforeach; ?> |
| 88 |
</ul> |
| 89 |
</div> |
| 90 |
</div> |
| 91 |
|
| 92 |
<div class="lp-stats-overview-grid lp-stats-overview-grid--tables"> |
| 93 |
<div class="lp-stats-section"> |
| 94 |
<div class="lp-stats-section__header"> |
| 95 |
<h3 class="lp-stats-section__title"><?php esc_html_e( 'Instructor performance', 'learnpress' ); ?></h3> |
| 96 |
<button type="button" class="button-link lp-stats-section__action lp-stats-view-all-instructors"><?php esc_html_e( 'Open report', 'learnpress' ); ?></button> |
| 97 |
</div> |
| 98 |
<?php lp_skeleton_animation_html( 5, 100 ); ?> |
| 99 |
<div class="lp-stats-table-instructor-performance"></div> |
| 100 |
</div> |
| 101 |
|
| 102 |
<div class="lp-stats-section"> |
| 103 |
<div class="lp-stats-section__header"> |
| 104 |
<h3 class="lp-stats-section__title"><?php esc_html_e( 'Instructor course watchlist', 'learnpress' ); ?></h3> |
| 105 |
</div> |
| 106 |
<?php lp_skeleton_animation_html( 5, 100 ); ?> |
| 107 |
<div class="lp-stats-table-instructor-watchlist"></div> |
| 108 |
</div> |
| 109 |
</div> |
| 110 |
</div> |
| 111 |
|
| 112 |
<?php |
| 113 |
learn_press_admin_view( 'statistics/parts/report-modal' ); |
| 114 |
|
| 115 |
/** |
| 116 |
* Fires at the bottom of the Instructors statistics tab, inside the tab container. |
| 117 |
* |
| 118 |
* @since 4.4.2 |
| 119 |
*/ |
| 120 |
do_action( 'learn-press/statistics/instructors/after' ); |
| 121 |
?> |
| 122 |
</div> |
| 123 |
|