chart-body.php
4 years ago
earning-report-top-menu.php
4 years ago
report-date_range.php
4 years ago
report-last_month.php
4 years ago
report-last_week.php
4 years ago
report-last_year.php
4 years ago
report-this_month.php
4 years ago
report-this_week.php
4 years ago
report-this_year.php
4 years ago
report.php
4 years ago
statement.php
4 years ago
statements.php
4 years ago
report-this_year.php
77 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Template for displaying instructors earnings |
| 4 | * |
| 5 | * @since v.1.1.2 |
| 6 | * |
| 7 | * @author Themeum |
| 8 | * @url https://themeum.com |
| 9 | * |
| 10 | * @package TutorLMS/Templates |
| 11 | * @version 1.4.3 |
| 12 | */ |
| 13 | |
| 14 | global $wpdb; |
| 15 | |
| 16 | $user_id = get_current_user_id(); |
| 17 | |
| 18 | /** |
| 19 | * Getting the Last Month |
| 20 | */ |
| 21 | $year = date( 'Y' ); |
| 22 | |
| 23 | $stats = tutils()->get_earning_chart_yearly( $user_id, $year ); |
| 24 | extract( $stats ); |
| 25 | |
| 26 | if ( ! $earning_sum ) { |
| 27 | echo '<p>' . __( 'No Earning info available', 'tutor' ) . '</p>'; |
| 28 | return; |
| 29 | } |
| 30 | ?> |
| 31 | <div class="tutor-dashboard-earning-info-cards"> |
| 32 | <div class="tutor-dashboard-info-card" title="<?php _e( 'All time', 'tutor' ); ?>"> |
| 33 | <p> |
| 34 | <span> <?php _e( 'My Earning', 'tutor' ); ?> </span> |
| 35 | <span class="tutor-dashboard-info-val"><?php echo tutor_utils()->tutor_price( $earning_sum->instructor_amount ); ?></span> |
| 36 | </p> |
| 37 | </div> |
| 38 | <div class="tutor-dashboard-info-card" title="<?php _e( 'Based on course price', 'tutor' ); ?>"> |
| 39 | <p> |
| 40 | <span> <?php _e( 'All time sales', 'tutor' ); ?> </span> |
| 41 | <span class="tutor-dashboard-info-val"><?php echo tutor_utils()->tutor_price( $earning_sum->course_price_total ); ?></span> |
| 42 | </p> |
| 43 | </div> |
| 44 | <div class="tutor-dashboard-info-card"> |
| 45 | <p> |
| 46 | <span> <?php _e( 'Deducted Commissions', 'tutor' ); ?> </span> |
| 47 | <span class="tutor-dashboard-info-val"><?php echo tutor_utils()->tutor_price( $earning_sum->admin_amount ); ?></span> |
| 48 | </p> |
| 49 | </div> |
| 50 | |
| 51 | |
| 52 | <?php if ( $earning_sum->deduct_fees_amount > 0 ) { ?> |
| 53 | <div class="tutor-dashboard-info-card" title="<?php _e( 'Deducted Fees', 'tutor' ); ?>"> |
| 54 | <p> |
| 55 | <span> <?php _e( 'Deducted Fees', 'tutor' ); ?> </span> |
| 56 | <span class="tutor-dashboard-info-val"><?php echo tutor_utils()->tutor_price( $earning_sum->deduct_fees_amount ); ?></span> |
| 57 | </p> |
| 58 | </div> |
| 59 | <?php } ?> |
| 60 | </div> |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | <div class="tutor-dashboard-item-group"> |
| 67 | <h4><?php echo wp_sprintf( __( 'Earning Data for the year of %s', 'tutor' ), $year ); ?></h4> |
| 68 | <?php |
| 69 | tutor_load_template( 'dashboard.earning.chart-body', compact( 'chartData', 'statements' ) ); |
| 70 | ?> |
| 71 | </div> |
| 72 | |
| 73 | <div class="tutor-dashboard-item-group"> |
| 74 | <h4><?php _e( 'Sales statements for this period', 'tutor' ); ?></h4> |
| 75 | <?php tutor_load_template( 'dashboard.earning.statement', compact( 'chartData', 'statements' ) ); ?> |
| 76 | </div> |
| 77 |