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.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 / views / elements / filters.php
tutor / views / elements Last commit date
bulk-confirm-popup.php 3 years ago common-confirm-popup.php 3 years ago filters.php 3 years ago navbar.php 3 years ago pagination.php 3 years ago purchase-history-filter.php 3 years ago search-filter.php 3 years ago
filters.php
173 lines
1 <?php
2 /**
3 * Filter views
4 *
5 * A common filter element for all the backend pages
6 *
7 * @package Tutor\Views
8 * @subpackage Tutor\ViewElements
9 * @author Themeum <support@themeum.com>
10 * @link https://themeum.com
11 * @since 2.0.0
12 */
13
14 use TUTOR\Input;
15 use Tutor\Models\CourseModel;
16
17 if ( isset( $data ) ) : ?>
18 <div class="tutor-px-20">
19 <div class="tutor-wp-dashboard-filter tutor-d-flex tutor-align-end tutor-justify-<?php echo esc_attr( isset( $data['bulk_action'] ) && true === $data['bulk_action'] ? 'between' : 'end' ); ?>">
20 <?php if ( isset( $data['bulk_action'] ) && true === $data['bulk_action'] ) : ?>
21 <div class="tutor-wp-dashboard-filter-items tutor-d-flex tutor-flex-xl-nowrap tutor-flex-wrap">
22 <form id="tutor-admin-bulk-action-form" action method="post">
23 <input type="hidden" name="action" value="<?php echo esc_html( $data['ajax_action'] ); ?>" />
24 <div class="tutor-d-flex">
25 <div class="tutor-mr-12">
26 <select name="bulk-action" title="Please select an action" class="tutor-form-select">
27 <?php foreach ( $data['bulk_actions'] as $k => $v ) : ?>
28 <option value="<?php echo esc_attr( $v['value'] ); ?>">
29 <?php echo esc_html( $v['option'] ); ?>
30 </option>
31 <?php endforeach; ?>
32 </select>
33 </div>
34 <button class="tutor-btn tutor-btn-outline-primary" id="tutor-admin-bulk-action-btn" data-tutor-modal-target="tutor-bulk-confirm-popup">
35 <?php esc_html_e( 'Apply', 'tutor' ); ?>
36 </button>
37 </div>
38 </form>
39 </div>
40 <?php endif; ?>
41 <?php if ( isset( $data['filters'] ) && true === $data['filters'] ) : ?>
42 <?php
43 $courses = ( current_user_can( 'administrator' ) ) ? CourseModel::get_courses() : CourseModel::get_courses_by_instructor();
44 $terms_arg = array(
45 'taxonomy' => 'course-category',
46 'orderby' => 'term_id',
47 'order' => 'DESC',
48 );
49 $categories = get_terms( $terms_arg );
50 ?>
51
52 <div class="tutor-wp-dashboard-filter-items tutor-d-flex tutor-flex-xl-nowrap tutor-flex-wrap">
53 <div class="tutor-wp-dashboard-filter-item item-reset">
54 <label class="tutor-form-label">
55 </label>
56 <?php
57 $page = Input::get( 'page', '' );
58 $sub_page = Input::get( 'sub_page', '' );
59 $current_tab = Input::get( 'tab', '' );
60 if ( '' === $sub_page && '' !== $current_tab ) {
61 $sub_page = $current_tab;
62 }
63 $url = '';
64 /**
65 * Tab query param support added for reset link
66 *
67 * @since v2.1.0
68 */
69 if ( '' === $sub_page && '' === $current_tab ) {
70 $url = "?page=$page";
71 } elseif ( '' === $current_tab ) {
72 $url = "?page=$page&sub_page=$sub_page";
73 } else {
74 $url = "?page=$page&tab=$current_tab";
75 }
76
77 ?>
78 <a class="tutor-btn tutor-btn-ghost tutor-mt-sm-28" href="<?php echo esc_url( $url ); ?>">
79 <i class="tutor-icon-refresh tutor-mr-8" area-hidden="true"></i> <?php esc_html_e( 'Reset', 'tutor' ); ?>
80 </a>
81 </div>
82 <?php
83 $course_id = Input::get( 'course-id', 0, Input::TYPE_INT );
84 $order = Input::get( 'order', 'DESC' );
85 $date = Input::get( 'date', '' );
86 $search = Input::get( 'search', '' );
87 $category_slug = Input::get( 'category', '' );
88 ?>
89 <?php if ( isset( $data['course_filter'] ) && true === $data['course_filter'] ) : ?>
90 <div class="tutor-wp-dashboard-filter-item">
91 <label class="tutor-form-label">
92 <?php esc_html_e( 'Course', 'tutor' ); ?>
93 </label>
94 <select class="tutor-form-select" id="tutor-backend-filter-course">
95 <?php if ( count( $courses ) ) : ?>
96 <option value="">
97 <?php esc_html_e( 'All Courses', 'tutor' ); ?>
98 </option>
99 <?php foreach ( $courses as $course ) : ?>
100 <option value="<?php echo esc_attr( $course->ID ); ?>" <?php selected( $course_id, $course->ID, 'selected' ); ?>>
101 <?php echo esc_html( $course->post_title ); ?>
102 </option>
103 <?php endforeach; ?>
104 <?php else : ?>
105 <option value=""><?php esc_html_e( 'No course found', 'tutor' ); ?></option>
106 <?php endif; ?>
107 </select>
108 </div>
109 <?php endif; ?>
110 <?php if ( isset( $data['category_filter'] ) && true === $data['category_filter'] ) : ?>
111 <div class="tutor-wp-dashboard-filter-item">
112 <label class="tutor-form-label">
113 <?php esc_html_e( 'Category', 'tutor' ); ?>
114 </label>
115 <select class="tutor-form-select" id="tutor-backend-filter-category">
116 <?php if ( count( $categories ) ) : ?>
117 <option value="">
118 <?php esc_html_e( 'All Category', 'tutor' ); ?>
119 </option>
120 <?php foreach ( $categories as $category ) : ?>
121 <option value="<?php echo esc_attr( $category->slug ); ?>" <?php selected( $category_slug, $category->slug, 'selected' ); ?>>
122 <?php echo esc_html( $category->name ); ?>
123 </option>
124 <?php endforeach; ?>
125 <?php else : ?>
126 <option value=""><?php esc_html_e( 'No record found', 'tutor' ); ?></option>
127 <?php endif; ?>
128 </select>
129 </div>
130 <?php endif; ?>
131
132 <?php if ( ! isset( $data['sort_by'] ) || true == $data['sort_by'] ) : ?>
133 <div class="tutor-wp-dashboard-filter-item">
134 <label class="tutor-form-label">
135 <?php esc_html_e( 'Sort By', 'tutor' ); ?>
136 </label>
137 <select class="tutor-form-select" id="tutor-backend-filter-order" data-search="no">
138 <option value="DESC" <?php selected( $order, 'DESC', 'selected' ); ?>>
139 <?php esc_html_e( 'DESC', 'tutor' ); ?>
140 </option>
141 <option value="ASC" <?php selected( $order, 'ASC', 'selected' ); ?>>
142 <?php esc_html_e( 'ASC', 'tutor' ); ?>
143 </option>
144 </select>
145 </div>
146 <?php endif; ?>
147 <div class="tutor-wp-dashboard-filter-item">
148 <label class="tutor-form-label">
149 <?php esc_html_e( 'Date', 'tutor' ); ?>
150 </label>
151 <div class="tutor-v2-date-picker"></div>
152 </div>
153 <div class="tutor-wp-dashboard-filter-item">
154 <form action="" method="get" id="tutor-admin-search-filter-form">
155 <label class="tutor-form-label">
156 <?php esc_html_e( 'Search', 'tutor' ); ?>
157 </label>
158 <div class="tutor-form-wrap">
159 <span class="tutor-form-icon"><span class="tutor-icon-search" area-hidden="true"></span></span>
160 <input type="search" class="tutor-form-control" id="tutor-backend-filter-search" name="search" placeholder="<?php esc_html_e( 'Search...' ); ?>" value="<?php echo esc_html( wp_unslash( $search ) ); ?>" />
161 </div>
162 </form>
163 </div>
164 </div>
165 <?php endif; ?>
166 </div>
167 </div>
168 <?php endif; ?>
169
170 <?php
171 tutor_load_template_from_custom_path( tutor()->path . 'views/elements/bulk-confirm-popup.php' );
172 ?>
173