chart-body.php
5 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
5 years ago
statement.php
4 years ago
statements.php
4 years ago
report-last_week.php
84 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 Week |
| 20 | */ |
| 21 | |
| 22 | $previous_week = strtotime("-1 week +1 day"); |
| 23 | $start_date = strtotime("last sunday midnight",$previous_week); |
| 24 | $end_date = strtotime("next saturday",$start_date); |
| 25 | $start_date = date("Y-m-d 00:00:00",$start_date); |
| 26 | $end_date = date("Y-m-d 23:59:59",$end_date); |
| 27 | |
| 28 | $stats = tutils()->get_earning_chart( $user_id, $start_date, $end_date ); |
| 29 | extract($stats); |
| 30 | |
| 31 | if ( ! $earning_sum){ |
| 32 | echo '<p>'.__('No Earning info available', 'tutor' ).'</p>'; |
| 33 | return; |
| 34 | } |
| 35 | ?> |
| 36 | |
| 37 | <div class="tutor-dashboard-earning-info-cards"> |
| 38 | <div class="tutor-dashboard-info-card" title="<?php _e('All time', 'tutor'); ?>"> |
| 39 | <p> |
| 40 | <span> <?php _e('My Earning', 'tutor'); ?> </span> |
| 41 | <span class="tutor-dashboard-info-val"><?php echo tutor_utils()->tutor_price($earning_sum->instructor_amount); ?></span> |
| 42 | </p> |
| 43 | </div> |
| 44 | <div class="tutor-dashboard-info-card" title="<?php _e('Based on course price', 'tutor'); ?>"> |
| 45 | <p> |
| 46 | <span> <?php _e('All time sales', 'tutor'); ?> </span> |
| 47 | <span class="tutor-dashboard-info-val"><?php echo tutor_utils()->tutor_price($earning_sum->course_price_total); ?></span> |
| 48 | </p> |
| 49 | </div> |
| 50 | <div class="tutor-dashboard-info-card"> |
| 51 | <p> |
| 52 | <span> <?php _e('Deducted Commissions', 'tutor'); ?> </span> |
| 53 | <span class="tutor-dashboard-info-val"><?php echo tutor_utils()->tutor_price($earning_sum->admin_amount); ?></span> |
| 54 | </p> |
| 55 | </div> |
| 56 | |
| 57 | |
| 58 | <?php if ($earning_sum->deduct_fees_amount > 0){ ?> |
| 59 | <div class="tutor-dashboard-info-card" title="<?php _e('Deducted Fees', 'tutor'); ?>"> |
| 60 | <p> |
| 61 | <span> <?php _e('Deducted Fees', 'tutor'); ?> </span> |
| 62 | <span class="tutor-dashboard-info-val"><?php echo tutor_utils()->tutor_price($earning_sum->deduct_fees_amount); ?></span> |
| 63 | </p> |
| 64 | </div> |
| 65 | <?php } ?> |
| 66 | </div> |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | <div class="tutor-dashboard-item-group"> |
| 74 | <h4><?php echo sprintf(__("Showing Result from %s to %s", 'tutor'), $begin->format('d F, Y'), $end->format('d F, Y')); ?></h4> |
| 75 | <?php |
| 76 | tutor_load_template('dashboard.earning.chart-body', compact('chartData', 'statements')); |
| 77 | ?> |
| 78 | </div> |
| 79 | |
| 80 | <div class="tutor-dashboard-item-group"> |
| 81 | <h4><?php _e('Sales statements for this period', 'tutor') ?></h4> |
| 82 | <?php tutor_load_template('dashboard.earning.statement', compact('chartData', 'statements')); ?> |
| 83 | </div> |
| 84 |