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
my-courses.php
104 lines
| 1 | <h3><?php _e('My Courses', 'tutor'); ?></h3> |
| 2 | |
| 3 | <div class="tutor-dashboard-content-inner"> |
| 4 | |
| 5 | <?php |
| 6 | $my_courses = tutor_utils()->get_courses_by_instructor(null, array('publish', 'draft', 'pending')); |
| 7 | |
| 8 | if (is_array($my_courses) && count($my_courses)): |
| 9 | global $post; |
| 10 | foreach ($my_courses as $post): |
| 11 | setup_postdata($post); |
| 12 | |
| 13 | $avg_rating = tutor_utils()->get_course_rating()->rating_avg; |
| 14 | $tutor_course_img = get_tutor_course_thumbnail_src(); |
| 15 | ?> |
| 16 | |
| 17 | <div id="tutor-dashboard-course-<?php the_ID(); ?>" class="tutor-mycourse-wrap tutor-mycourse-<?php the_ID(); ?>"> |
| 18 | <div class="tutor-mycourse-thumbnail" style="background-image: url(<?php echo esc_url($tutor_course_img); ?>)"></div> |
| 19 | <div class="tutor-mycourse-content"> |
| 20 | <div class="tutor-mycourse-rating"> |
| 21 | <?php |
| 22 | tutor_utils()->star_rating_generator($avg_rating); |
| 23 | ?> |
| 24 | </div> |
| 25 | <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </h3> |
| 26 | <div class="tutor-meta tutor-course-metadata"> |
| 27 | <?php |
| 28 | $total_lessons = tutor_utils()->get_lesson_count_by_course(); |
| 29 | $completed_lessons = tutor_utils()->get_completed_lesson_count_by_course(); |
| 30 | |
| 31 | $course_duration = get_tutor_course_duration_context(); |
| 32 | $course_students = tutor_utils()->count_enrolled_users_by_course(); |
| 33 | ?> |
| 34 | <ul> |
| 35 | <li> |
| 36 | <?php |
| 37 | _e('Status:', 'tutor'); |
| 38 | $status = ucwords($post->post_status); |
| 39 | echo "<span>$status</span>"; |
| 40 | ?> |
| 41 | </li> |
| 42 | <li> |
| 43 | <?php |
| 44 | _e('Duration:', 'tutor'); |
| 45 | echo "<span>$course_duration</span>"; |
| 46 | ?> |
| 47 | </li> |
| 48 | <li> |
| 49 | <?php |
| 50 | _e('Students:', 'tutor'); |
| 51 | echo "<span>$course_students</span>"; |
| 52 | ?> |
| 53 | </li> |
| 54 | </ul> |
| 55 | </div> |
| 56 | |
| 57 | <div class="mycourse-footer"> |
| 58 | <div class="tutor-mycourses-stats"> |
| 59 | <?php echo tutor_utils()->tutor_price(tutor_utils()->get_course_price()); ?> |
| 60 | <a href="<?php echo tutor_utils()->course_edit_link($post->ID); ?>" class="tutor-mycourse-edit"> <i |
| 61 | class="tutor-icon-pencil"></i> |
| 62 | Edit</a> |
| 63 | <a href="#tutor-course-delete" class="tutor-mycourse-delete-btn" data-course-id="<?php echo $post->ID; ?>"> |
| 64 | <i class="tutor-icon-garbage"></i> Delete |
| 65 | </a> |
| 66 | </div> |
| 67 | </div> |
| 68 | </div> |
| 69 | |
| 70 | </div> |
| 71 | <?php |
| 72 | endforeach; |
| 73 | else : ?> |
| 74 | <div> |
| 75 | <h2><?php _e("Not Found" , 'tutor'); ?></h2> |
| 76 | <p><?php _e("Sorry, but you are looking for something that isn't here." , 'tutor'); ?></p> |
| 77 | </div> |
| 78 | <?php endif; ?> |
| 79 | |
| 80 | |
| 81 | <div class="tutor-frontend-modal" data-popup-rel="#tutor-course-delete" style="display: none"> |
| 82 | <div class="tutor-frontend-modal-overlay"></div> |
| 83 | <div class="tutor-frontend-modal-content"> |
| 84 | <button class="tm-close tutor-icon-line-cross"></button> |
| 85 | |
| 86 | <div class="tutor-modal-body tutor-course-delete-popup"> |
| 87 | <img src="<?php echo tutor()->url . 'assets/images/delete-icon.png' ?>" alt=""> |
| 88 | <h3><?php _e('Delete This Course?', 'tutor'); ?></h3> |
| 89 | <p><?php _e("You are going to delete this course, it can't be undone", 'tutor'); ?></p> |
| 90 | <div class="tutor-modal-button-group"> |
| 91 | <form action="" id="tutor-delete-course-form"> |
| 92 | <input type="hidden" name="action" value="tutor_delete_dashboard_course"> |
| 93 | <input type="hidden" name="course_id" id="tutor-course-delete-id" value=""> |
| 94 | <button type="button" class="tutor-modal-btn-cancel"><?php _e('Cancel', 'tutor') ?></button> |
| 95 | <button type="submit" class="tutor-danger tutor-modal-course-delete-btn"><?php _e('Yes, Delete Course', 'tutor') ?></button> |
| 96 | </form> |
| 97 | </div> |
| 98 | </div> |
| 99 | |
| 100 | </div> <!-- tutor-frontend-modal-content --> |
| 101 | </div> <!-- tutor-frontend-modal --> |
| 102 | |
| 103 | </div> |
| 104 |