<?php /** * Reviews received * * @package Tutor\Templates * @subpackage Dashboard * @author Themeum <support@themeum.com> * @link https://themeum.com * @since 1.4.3 */ if ( ! tutor_utils()->is_instructor( 0, true ) ) { include __DIR__ . '/reviews/given-reviews.php'; return; } use TUTOR\Input; // Pagination Variable. $per_page = tutor_utils()->get_option( 'pagination_per_page', 20 ); $current_page = max( 1, Input::get( 'current_page', 1, Input::TYPE_INT ) ); $offset = ( $current_page - 1 ) * $per_page; $reviews = tutor_utils()->get_reviews_by_instructor( get_current_user_id(), $offset, $per_page ); $given_count = tutor_utils()->get_reviews_by_user( get_current_user_id(), 0, 0, true )->count; ?> <div class="tutor-dashboard-content-inner"> <div class="tutor-fs-5 tutor-fw-medium tutor-color-black tutor-mb-16"><?php esc_html_e( 'Reviews', 'tutor' ); ?></div> <?php if ( current_user_can( tutor()->instructor_role ) ) : ?> <div class="tutor-mb-32"> <ul class="tutor-nav"> <li class="tutor-nav-item"> <a class="tutor-nav-link is-active" href="<?php echo esc_url( tutor_utils()->get_tutor_dashboard_page_permalink( 'reviews' ) ); ?>"> <?php esc_html_e( 'Received', 'tutor' ); ?> (<?php echo esc_html( $reviews->count ); ?>) </a> </li> <?php if ( $given_count ) : ?> <li class="tutor-nav-item"> <a class="tutor-nav-link" href="<?php echo esc_url( tutor_utils()->get_tutor_dashboard_page_permalink( 'reviews/given-reviews' ) ); ?>"> <?php esc_html_e( 'Given', 'tutor' ); ?> (<?php echo esc_html( $given_count ); ?>) </a> </li> <?php endif; ?> </ul> </div> <?php endif; ?> <?php if ( $reviews->count ) : ?> <div class="tutor-table-responsive"> <table class="tutor-table table-reviews"> <thead> <tr> <th width="20%"> <?php esc_html_e( 'Student', 'tutor' ); ?> </th> <th width="25%"> <?php esc_html_e( 'Date', 'tutor' ); ?> </th> <th> <?php esc_html_e( 'Feedback', 'tutor' ); ?> </th> </tr> </thead> <tbody> <?php foreach ( $reviews->results as $review ) : ?> <?php $user_data = get_userdata( $review->user_id ); $student_name = $user_data->display_name; ?> <tr> <td class="tutor-td-top"> <div class="tutor-d-flex tutor-align-center"> <?php echo wp_kses( tutor_utils()->get_tutor_avatar( $review->user_id ), tutor_utils()->allowed_avatar_tags() ); ?> <span class="tutor-ml-16"> <?php echo esc_html( $student_name ); ?> </span> </div> </td> <td class="tutor-td-top"> <?php echo esc_html( tutor_i18n_get_formated_date( $review->comment_date ) ); ?> </td> <td class="tutor-td-top"> <?php tutor_utils()->star_rating_generator_v2( $review->rating, null, true ); ?> <div class="tutor-mt-8"> <?php echo wp_kses_post( htmlspecialchars( stripslashes( $review->comment_content ) ) ); ?> </div> <div class="tutor-fs-7 tutor-mt-8"> <span class="tutor-color-secondary"> <?php esc_html_e( 'Course:', 'tutor' ); ?> </span> <span class="tutor-fw-normal tutor-color-muted"> <?php echo esc_html( get_the_title( $review->comment_post_ID ) ); ?> </span> </div> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> <?php else : ?> <?php tutor_utils()->tutor_empty_state( tutor_utils()->not_found_text() ); ?> <?php endif; ?> <?php if ( $reviews->count > $per_page ) { $pagination_data = array( 'total_items' => $reviews->count, 'per_page' => $per_page, 'paged' => $current_page, ); $pagination_template_frontend = tutor()->path . 'templates/dashboard/elements/pagination.php'; tutor_load_template_from_custom_path( $pagination_template_frontend, $pagination_data ); } ?> </div>
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
announcements | Folder | 0755 |
|
|
assignments | Folder | 0755 |
|
|
elements | Folder | 0755 |
|
|
enrolled-courses | Folder | 0755 |
|
|
instructor | Folder | 0755 |
|
|
my-courses | Folder | 0755 |
|
|
my-quiz-attempts | Folder | 0755 |
|
|
notifications | Folder | 0755 |
|
|
question-answer | Folder | 0755 |
|
|
quiz-attempts | Folder | 0755 |
|
|
reviews | Folder | 0755 |
|
|
settings | Folder | 0755 |
|
|
withdraw-method-fields | Folder | 0755 |
|
|
announcements.php | File | 4.33 KB | 0644 |
|
assignments.php | File | 4.98 KB | 0644 |
|
create-course.php | File | 644 B | 0644 |
|
dashboard.php | File | 16.61 KB | 0644 |
|
enrolled-courses.php | File | 4.32 KB | 0644 |
|
index.php | File | 459 B | 0644 |
|
logged-in.php | File | 261 B | 0644 |
|
my-courses.php | File | 13.89 KB | 0644 |
|
my-profile.php | File | 2.07 KB | 0644 |
|
my-quiz-attempts.php | File | 1.79 KB | 0644 |
|
purchase_history.php | File | 10.45 KB | 0644 |
|
question-answer.php | File | 4.59 KB | 0644 |
|
quiz-attempts.php | File | 1.95 KB | 0644 |
|
registration.php | File | 6.16 KB | 0644 |
|
reviews.php | File | 3.84 KB | 0644 |
|
settings.php | File | 775 B | 0644 |
|
wishlist.php | File | 2.02 KB | 0644 |
|
withdraw.php | File | 13.21 KB | 0644 |
|