assignments
6 years ago
earning
6 years ago
enrolled-courses
6 years ago
instructor
6 years ago
reviews
6 years ago
settings
6 years ago
withdraw-method-fields
6 years ago
assignments.php
6 years ago
create-course.php
6 years ago
dashboard.php
6 years ago
earning.php
6 years ago
enrolled-courses.php
6 years ago
index.php
6 years ago
logged-in.php
6 years ago
my-courses.php
6 years ago
my-profile.php
6 years ago
purchase_history.php
6 years ago
quiz-attempts.php
6 years ago
registration.php
6 years ago
reviews.php
6 years ago
settings.php
6 years ago
wishlist.php
6 years ago
withdraw.php
6 years ago
dashboard.php
91 lines
| 1 | <h3><?php _e('Dashboard', 'tutor') ?></h3> |
| 2 | |
| 3 | <div class="tutor-dashboard-content-inner"> |
| 4 | |
| 5 | <?php |
| 6 | $enrolled_course = tutor_utils()->get_enrolled_courses_by_user(); |
| 7 | $completed_courses = tutor_utils()->get_completed_courses_ids_by_user(); |
| 8 | $total_students = tutor_utils()->get_total_students_by_instructor(get_current_user_id()); |
| 9 | $my_courses = tutor_utils()->get_courses_by_instructor(get_current_user_id(), 'any'); |
| 10 | $earning_sum = tutor_utils()->get_earning_sum(); |
| 11 | |
| 12 | $enrolled_course_count = $enrolled_course ? $enrolled_course->post_count : 0; |
| 13 | $completed_course_count = count($completed_courses); |
| 14 | $active_course_count = $enrolled_course_count - $completed_course_count; |
| 15 | ?> |
| 16 | |
| 17 | <div class="tutor-dashboard-info-cards"> |
| 18 | <div class="tutor-dashboard-info-card"> |
| 19 | <p> |
| 20 | <span><?php _e('Enrolled Course', 'tutor'); ?></span> |
| 21 | <span class="tutor-dashboard-info-val"><?php echo esc_html($enrolled_course_count); ?></span> |
| 22 | </p> |
| 23 | </div> |
| 24 | <div class="tutor-dashboard-info-card"> |
| 25 | <p> |
| 26 | <span><?php _e('Active Course', 'tutor'); ?></span> |
| 27 | <span class="tutor-dashboard-info-val"><?php echo esc_html($active_course_count); ?></span> |
| 28 | </p> |
| 29 | </div> |
| 30 | <div class="tutor-dashboard-info-card"> |
| 31 | <p> |
| 32 | <span><?php _e('Completed Course', 'tutor'); ?></span> |
| 33 | <span class="tutor-dashboard-info-val"><?php echo esc_html($completed_course_count); ?></span> |
| 34 | </p> |
| 35 | </div> |
| 36 | |
| 37 | <?php |
| 38 | if(current_user_can(tutor()->instructor_role)) : |
| 39 | ?> |
| 40 | |
| 41 | <div class="tutor-dashboard-info-card"> |
| 42 | <p> |
| 43 | <span><?php _e('Total Students', 'tutor'); ?></span> |
| 44 | <span class="tutor-dashboard-info-val"><?php echo esc_html($total_students); ?></span> |
| 45 | </p> |
| 46 | </div> |
| 47 | <div class="tutor-dashboard-info-card"> |
| 48 | <p> |
| 49 | <span><?php _e('Total Courses', 'tutor'); ?></span> |
| 50 | <span class="tutor-dashboard-info-val"><?php echo esc_html(count($my_courses)); ?></span> |
| 51 | </p> |
| 52 | </div> |
| 53 | <div class="tutor-dashboard-info-card"> |
| 54 | <p> |
| 55 | <span><?php _e('Total Earning', 'tutor'); ?></span> |
| 56 | <span class="tutor-dashboard-info-val"><?php echo tutor_utils()->tutor_price($earning_sum->instructor_amount); ?></span> |
| 57 | </p> |
| 58 | </div> |
| 59 | <?php |
| 60 | endif; |
| 61 | ?> |
| 62 | </div> |
| 63 | |
| 64 | <?php |
| 65 | $instructor_course = tutor_utils()->get_courses_for_instructors(get_current_user_id()); |
| 66 | if(count($instructor_course)) { |
| 67 | ?> |
| 68 | |
| 69 | <div class="tutor-dashboard-info-table-wrap"> |
| 70 | <h3><?php _e('Most Popular Courses', 'tutor'); ?></h3> |
| 71 | <table class="tutor-dashboard-info-table"> |
| 72 | <thead> |
| 73 | <tr> |
| 74 | <td><?php _e('Course Name', 'tutor'); ?></td> |
| 75 | <td><?php _e('Enrolled', 'tutor'); ?></td> |
| 76 | </tr> |
| 77 | </thead> |
| 78 | <tbody> |
| 79 | <?php |
| 80 | $instructor_course = tutor_utils()->get_courses_for_instructors(get_current_user_id()); |
| 81 | foreach ($instructor_course as $course){ |
| 82 | $enrolled = tutor_utils()->count_enrolled_users_by_course($course->ID); |
| 83 | echo "<tr><td>$course->post_title</td><td>$enrolled</td></tr>"; |
| 84 | } |
| 85 | ?> |
| 86 | </tbody> |
| 87 | </table> |
| 88 | </div> |
| 89 | <?php } ?> |
| 90 | |
| 91 | </div> |