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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 4 years ago given-reviews.php 4 years ago
given-reviews.php
161 lines
1 <?php
2 /**
3 * My Own reviews
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 * To be loaded for given review list in frontend dashboard
14 */
15
16 // Pagination Variable
17 $per_page = tutor_utils()->get_option( 'pagination_per_page', 20 );
18 $current_page = max( 1, tutor_utils()->avalue_dot( 'current_page', $_GET ) );
19 $offset = ( $current_page - 1 ) * $per_page;
20
21
22 $all_reviews = tutor_utils()->get_reviews_by_user( 0, $offset, $per_page, true );
23 $review_count = $all_reviews->count;
24 $reviews = $all_reviews->results;
25 $received_count = tutor_utils()->get_reviews_by_instructor( 0, 0, 0 )->count;
26 ?>
27
28 <div class="tutor-dashboard-content-inner">
29 <div class="tutor-fs-5 tutor-fw-medium tutor-color-black tutor-mb-24"><?php _e( 'Reviews', 'tutor' ); ?></div>
30 <?php if ( current_user_can( tutor()->instructor_role ) ) : ?>
31 <div class="tutor-mb-32">
32 <ul class="tutor-nav">
33 <li class="tutor-nav-item">
34 <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 $received_count; ?>)</a>
35 </li>
36 <li class="tutor-nav-item">
37 <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 $review_count; ?>)</a>
38 </li>
39 </ul>
40 </div>
41 <?php endif; ?>
42
43 <div class="tutor-dashboard-reviews-wrap">
44 <?php if ( ! is_array( $reviews ) || ! count( $reviews ) ) : ?>
45 <div class="tutor-dashboard-content-inner">
46 <?php tutor_utils()->tutor_empty_state( tutor_utils()->not_found_text() ); ?>
47 </div>
48 <?php endif; ?>
49
50 <div class="tutor-dashboard-reviews">
51 <?php
52 foreach ( $reviews as $review ) :
53 $profile_url = tutor_utils()->profile_url( $review->user_id, false );
54 $update_id = 'tutor_review_update_' . $review->comment_ID;
55 $delete_id = 'tutor_review_delete_' . $review->comment_ID;
56 $row_id = 'tutor_review_row_' . $review->comment_ID;
57 ?>
58 <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">
59 <div class="tutor-card-header">
60 <h4 class="tutor-card-title">
61 <?php esc_html_e( 'Course: ', 'tutor' ); ?>
62 <span class="tutor-fs-6 tutor-fw-medium" data-href="<?php echo esc_url( get_the_permalink( $review->comment_post_ID ) ); ?>">
63 <?php esc_html_e( get_the_title( $review->comment_post_ID ) ); ?>
64 </span>
65 </h4>
66 </div>
67
68 <div class="tutor-card-body">
69 <div class="tutor-row tutor-align-center tutor-mb-24">
70 <div class="tutor-col">
71 <?php tutor_utils()->star_rating_generator_v2( $review->rating, null, true ); ?>
72 </div>
73
74 <div class="tutor-col-auto">
75 <div class="tutor-given-review-actions tutor-d-flex">
76 <span class="tutor-btn tutor-btn-ghost" data-tutor-modal-target="<?php echo esc_html( $update_id ); ?>" role="button">
77 <i class="tutor-icon-edit tutor-mr-8" area-hidden="true"></i>
78 <span><?php esc_html_e( 'Edit', 'tutor' ); ?></span>
79 </span>
80
81 <span class="tutor-btn tutor-btn-ghost tutor-ml-16" data-tutor-modal-target="<?php echo esc_html( $delete_id ); ?>" role="button">
82 <i class="tutor-icon-trash-can-line tutor-mr-8" area-hidden="true"></i>
83 <span><?php esc_html_e( 'Delete', 'tutor' ); ?></span>
84 </span>
85 </div>
86 </div>
87 </div>
88
89 <div class="tutor-fs-6 tutor-color-muted">
90 <?php echo htmlspecialchars( stripslashes( $review->comment_content ) ); ?>
91 </div>
92 </div>
93
94 <!-- Edit Review Modal -->
95 <form class="tutor-modal" id="<?php echo esc_html( $update_id ); ?>">
96 <div class="tutor-modal-overlay"></div>
97 <div class="tutor-modal-window">
98 <div class="tutor-modal-content tutor-modal-content-white">
99 <button class="tutor-iconic-btn tutor-modal-close-o" data-tutor-modal-close>
100 <span class="tutor-icon-times" area-hidden="true"></span>
101 </button>
102
103 <div class="tutor-modal-body tutor-text-center">
104 <div class="tutor-fs-3 tutor-fw-medium tutor-color-black tutor-mt-48 tutor-mb-12"><?php _e("How would you rate this course?", "tutor"); ?></div>
105 <div class="tutor-fs-6 tutor-color-muted"><?php _e('Select Rating', 'tutor'); ?></div>
106
107 <input type="hidden" name="course_id" value="<?php echo esc_html( $review->comment_post_ID ); ?>"/>
108 <input type="hidden" name="review_id" value="<?php echo esc_html( $review->comment_ID ); ?>"/>
109 <input type="hidden" name="action" value="tutor_place_rating" />
110
111 <div class="tutor-ratings tutor-ratings-xl tutor-ratings-selectable tutor-justify-center tutor-mt-16" tutor-ratings-selectable>
112 <?php
113 tutor_utils()->star_rating_generator( tutor_utils()->get_rating_value( $review->rating ) );
114 ?>
115 </div>
116
117 <textarea class="tutor-form-control tutor-mt-28" name="review" placeholder="<?php _e( 'write a review', 'tutor' ); ?>"><?php esc_html_e( stripslashes( $review->comment_content ) ); ?></textarea>
118
119 <div class="tutor-d-flex tutor-justify-center tutor-my-48">
120 <button type="button" class="tutor-btn tutor-btn-outline-primary" data-tutor-modal-close data-action="back">
121 <?php esc_html_e( 'Cancel', 'tutor' ); ?>
122 </button>
123 <button type="submit" class="tutor_submit_review_btn tutor-btn tutor-btn-primary tutor-ml-20" data-action="next">
124 <?php esc_html_e( 'Update Review', 'tutor' ); ?>
125 </button>
126 </div>
127 </div>
128 </div>
129 </div>
130 </form>
131
132 <!-- Delete Modal -->
133 <?php
134 tutor_load_template( 'modal.confirm', 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 </div>
147 <?php endforeach; ?>
148 </div>
149 </div>
150 </div>
151 <?php
152 if($all_reviews->count > $per_page) {
153 $pagination_data = array(
154 'total_items' => $all_reviews->count,
155 'per_page' => $per_page,
156 'paged' => $current_page,
157 );
158 $pagination_template_frontend = tutor()->path . 'templates/dashboard/elements/pagination.php';
159 tutor_load_template_from_custom_path( $pagination_template_frontend, $pagination_data );
160 }
161 ?>