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.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / templates / dashboard / reviews / given-reviews.php
tutor / templates / dashboard / reviews Last commit date
edit-review-form.php 3 years ago given-reviews.php 3 months ago
given-reviews.php
163 lines
1 <?php
2 /**
3 * My Own reviews
4 *
5 * @package Tutor\Templates
6 * @subpackage Dashboard\Reviews
7 * @author Themeum <support@themeum.com>
8 * @link https://themeum.com
9 * @since 1.1.2
10 */
11
12 use TUTOR\Input;
13
14 // Pagination Variable.
15 $per_page = tutor_utils()->get_option( 'pagination_per_page', 20 );
16 $current_page = max( 1, Input::get( 'current_page', 0, Input::TYPE_INT ) );
17 $offset = ( $current_page - 1 ) * $per_page;
18
19
20 $all_reviews = tutor_utils()->get_reviews_by_user( 0, $offset, $per_page, true );
21 $review_count = $all_reviews->count;
22 $reviews = $all_reviews->results;
23 $received_count = tutor_utils()->get_reviews_by_instructor( 0, 0, 0 )->count;
24 ?>
25
26 <div class="tutor-dashboard-content-inner">
27 <div class="tutor-fs-5 tutor-fw-medium tutor-color-black tutor-mb-24"><?php esc_html_e( 'Reviews', 'tutor' ); ?></div>
28 <?php if ( current_user_can( tutor()->instructor_role ) ) : ?>
29 <div class="tutor-mb-32">
30 <ul class="tutor-nav">
31 <li class="tutor-nav-item">
32 <a class="tutor-nav-link" href="<?php echo esc_url( tutor_utils()->get_tutor_dashboard_page_permalink( 'reviews' ) ); ?>"> <?php esc_html_e( 'Received', 'tutor' ); ?> (<?php echo esc_html( $received_count ); ?>)</a>
33 </li>
34 <li class="tutor-nav-item">
35 <a class="tutor-nav-link is-active" 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( $review_count ); ?>)</a>
36 </li>
37 </ul>
38 </div>
39 <?php endif; ?>
40
41 <div class="tutor-dashboard-reviews-wrap">
42 <?php if ( ! is_array( $reviews ) || ! count( $reviews ) ) : ?>
43 <div class="tutor-dashboard-content-inner">
44 <?php tutor_utils()->tutor_empty_state( tutor_utils()->not_found_text() ); ?>
45 </div>
46 <?php endif; ?>
47
48 <div class="tutor-dashboard-reviews">
49 <?php
50 foreach ( $reviews as $review ) :
51 $profile_url = tutor_utils()->profile_url( $review->user_id, false );
52 $update_id = 'tutor_review_update_' . $review->comment_ID;
53 $delete_id = 'tutor_review_delete_' . $review->comment_ID;
54 $row_id = 'tutor_review_row_' . $review->comment_ID;
55 ?>
56 <div id="<?php echo esc_html( $row_id ); ?>" class="tutor-card tutor-dashboard-single-review tutor-review-<?php echo esc_html( $review->comment_ID ); ?> tutor-mb-32">
57 <div class="tutor-card-header">
58 <h4 class="tutor-card-title">
59 <?php esc_html_e( 'Course: ', 'tutor' ); ?>
60 <span class="tutor-fs-6 tutor-fw-medium" data-href="<?php echo esc_url( get_the_permalink( $review->comment_post_ID ) ); ?>">
61 <?php echo esc_html( get_the_title( $review->comment_post_ID ) ); ?>
62 </span>
63 </h4>
64 </div>
65
66 <div class="tutor-card-body">
67 <div class="tutor-row tutor-align-center tutor-mb-24">
68 <div class="tutor-col">
69 <?php tutor_utils()->star_rating_generator_v2( $review->rating, null, true ); ?>
70 </div>
71
72 <div class="tutor-col-auto">
73 <div class="tutor-given-review-actions tutor-d-flex">
74 <span class="tutor-btn tutor-btn-ghost" data-tutor-modal-target="<?php echo esc_html( $update_id ); ?>" role="button">
75 <i class="tutor-icon-edit tutor-mr-8" aria-hidden="true"></i>
76 <span><?php esc_html_e( 'Edit', 'tutor' ); ?></span>
77 </span>
78
79 <span class="tutor-btn tutor-btn-ghost tutor-ml-16" data-tutor-modal-target="<?php echo esc_html( $delete_id ); ?>" role="button">
80 <i class="tutor-icon-trash-can-line tutor-mr-8" aria-hidden="true"></i>
81 <span><?php esc_html_e( 'Delete', 'tutor' ); ?></span>
82 </span>
83 </div>
84 </div>
85 </div>
86
87 <div class="tutor-fs-6 tutor-color-muted">
88 <?php echo esc_textarea( htmlspecialchars( stripslashes( $review->comment_content ) ) ); ?>
89 </div>
90 </div>
91
92 <!-- Edit Review Modal -->
93 <form class="tutor-modal" id="<?php echo esc_html( $update_id ); ?>" role="dialog" aria-modal="true" aria-labelledby="<?php echo esc_html( $update_id ); ?>-title" aria-hidden="true">
94 <div class="tutor-modal-overlay"></div>
95 <div class="tutor-modal-window">
96 <div class="tutor-modal-content tutor-modal-content-white">
97 <button type="button" class="tutor-iconic-btn tutor-modal-close-o" data-tutor-modal-close aria-label="<?php esc_attr_e( 'Close', 'tutor' ); ?>">
98 <span class="tutor-icon-times" aria-hidden="true"></span>
99 </button>
100
101 <div class="tutor-modal-body tutor-text-center">
102 <div id="<?php echo esc_html( $update_id ); ?>-title" class="tutor-fs-3 tutor-fw-medium tutor-color-black tutor-mt-48 tutor-mb-12"><?php esc_html_e( 'How would you rate this course?', 'tutor' ); ?></div>
103 <div class="tutor-fs-6 tutor-color-muted"><?php esc_html_e( 'Select Rating', 'tutor' ); ?></div>
104
105 <input type="hidden" name="course_id" value="<?php echo esc_html( $review->comment_post_ID ); ?>"/>
106 <input type="hidden" name="review_id" value="<?php echo esc_html( $review->comment_ID ); ?>"/>
107 <input type="hidden" name="action" value="tutor_place_rating" />
108
109 <div class="tutor-ratings tutor-ratings-xl tutor-ratings-selectable tutor-justify-center tutor-mt-16" tutor-ratings-selectable>
110 <?php
111 tutor_utils()->star_rating_generator( tutor_utils()->get_rating_value( $review->rating ) );
112 ?>
113 </div>
114
115 <textarea class="tutor-form-control tutor-mt-28" name="review" aria-label="<?php esc_attr_e( 'Update your review', 'tutor' ); ?>" placeholder="<?php esc_html_e( 'write a review', 'tutor' ); ?>"><?php echo esc_html( stripslashes( $review->comment_content ) ); ?></textarea>
116
117 <div class="tutor-d-flex tutor-justify-center tutor-my-48">
118 <button type="button" class="tutor-btn tutor-btn-outline-primary" data-tutor-modal-close data-action="back">
119 <?php esc_html_e( 'Cancel', 'tutor' ); ?>
120 </button>
121 <button type="submit" class="tutor_submit_review_btn tutor-btn tutor-btn-primary tutor-ml-20" data-action="next">
122 <?php esc_html_e( 'Update Review', 'tutor' ); ?>
123 </button>
124 </div>
125 </div>
126 </div>
127 </div>
128 </form>
129
130 <!-- Delete Modal -->
131 <?php
132 tutor_load_template(
133 'modal.confirm',
134 array(
135 'id' => $delete_id,
136 'image' => 'icon-trash.svg',
137 'title' => __( 'Do You Want to Delete This Review?', 'tutor' ),
138 'content' => __( 'Are you sure you want to delete this review permanently from the site? Please confirm your choice.', 'tutor' ),
139 'yes' => array(
140 'text' => __( 'Yes, Delete This', 'tutor' ),
141 'class' => 'tutor-list-ajax-action',
142 'attr' => array( 'data-request_data=\'{"action":"delete_tutor_review", "review_id":"' . $review->comment_ID . '"}\'', 'data-delete_element_id="' . $row_id . '"' ),
143 ),
144 )
145 );
146 ?>
147 </div>
148 <?php endforeach; ?>
149 </div>
150 </div>
151 </div>
152 <?php
153 if ( $all_reviews->count > $per_page ) {
154 $pagination_data = array(
155 'total_items' => $all_reviews->count,
156 'per_page' => $per_page,
157 'paged' => $current_page,
158 );
159 $pagination_template_frontend = tutor()->path . 'templates/dashboard/elements/pagination.php';
160 tutor_load_template_from_custom_path( $pagination_template_frontend, $pagination_data );
161 }
162 ?>
163