bulk-confirm-popup.php
4 years ago
common-confirm-popup.php
4 years ago
elements_style.php
4 years ago
filters.php
4 years ago
navbar.php
3 years ago
pagination.php
4 years ago
purchase-history-filter.php
4 years ago
search-filter.php
4 years ago
filters.php
141 lines
| 1 | <?php if (isset($data)) : ?> |
| 2 | <div class="tutor-px-20"> |
| 3 | <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'); ?>"> |
| 4 | <?php if (isset($data['bulk_action']) && true === $data['bulk_action']) : ?> |
| 5 | <div class="tutor-wp-dashboard-filter-items tutor-d-flex tutor-flex-xl-nowrap tutor-flex-wrap"> |
| 6 | <form id="tutor-admin-bulk-action-form" action method="post"> |
| 7 | <input type="hidden" name="action" value="<?php esc_html_e($data['ajax_action']); ?>" /> |
| 8 | <div class="tutor-d-flex"> |
| 9 | <div class="tutor-mr-12"> |
| 10 | <select name="bulk-action" title="Please select an action" class="tutor-form-select"> |
| 11 | <?php foreach ($data['bulk_actions'] as $k => $v) : ?> |
| 12 | <option value="<?php echo esc_attr($v['value']); ?>"> |
| 13 | <?php echo esc_html($v['option']); ?> |
| 14 | </option> |
| 15 | <?php endforeach; ?> |
| 16 | </select> |
| 17 | </div> |
| 18 | <button class="tutor-btn tutor-btn-outline-primary" id="tutor-admin-bulk-action-btn" data-tutor-modal-target="tutor-bulk-confirm-popup"> |
| 19 | <?php esc_html_e('Apply', 'tutor'); ?> |
| 20 | </button> |
| 21 | </div> |
| 22 | </form> |
| 23 | </div> |
| 24 | <?php endif; ?> |
| 25 | <?php if (isset($data['filters']) && true === $data['filters']) : ?> |
| 26 | <?php |
| 27 | $courses = (current_user_can('administrator')) ? tutor_utils()->get_courses() : tutor_utils()->get_courses_by_instructor(); |
| 28 | $terms_arg = array( |
| 29 | 'taxonomy' => 'course-category', |
| 30 | 'orderby' => 'term_id', |
| 31 | 'order' => 'DESC', |
| 32 | ); |
| 33 | $categories = get_terms($terms_arg); |
| 34 | ?> |
| 35 | |
| 36 | <div class="tutor-wp-dashboard-filter-items tutor-d-flex tutor-flex-xl-nowrap tutor-flex-wrap"> |
| 37 | <div class="tutor-wp-dashboard-filter-item item-reset"> |
| 38 | <label class="tutor-form-label"> |
| 39 | </label> |
| 40 | <?php |
| 41 | $page = isset($_GET['page']) ? $_GET['page'] : ''; |
| 42 | $sub_page = isset($_GET['sub_page']) ? $_GET['sub_page'] : ''; |
| 43 | $url = '' === $sub_page ? "?page=$page" : "?page=$page&sub_page=$sub_page"; |
| 44 | |
| 45 | ?> |
| 46 | <a class="tutor-btn tutor-btn-ghost tutor-mt-28" href="<?php echo esc_url($url); ?>"> |
| 47 | <i class="tutor-icon-refresh tutor-mr-8" area-hidden="true"></i> <?php esc_html_e('Reset', 'tutor'); ?> |
| 48 | </a> |
| 49 | </div> |
| 50 | <?php |
| 51 | $course_id = isset($_GET['course-id']) ? esc_html__($_GET['course-id']) : ''; |
| 52 | $order = isset($_GET['order']) ? esc_html__($_GET['order']) : ''; |
| 53 | $date = isset($_GET['date']) ? esc_html__($_GET['date']) : ''; |
| 54 | $search = isset($_GET['search']) ? esc_html__($_GET['search']) : ''; |
| 55 | $category_slug = isset($_GET['category']) ? esc_html__($_GET['category']) : ''; |
| 56 | ?> |
| 57 | <?php if (isset($data['course_filter']) && true === $data['course_filter']) : ?> |
| 58 | <div class="tutor-wp-dashboard-filter-item"> |
| 59 | <label class="tutor-form-label"> |
| 60 | <?php esc_html_e('Course', 'tutor'); ?> |
| 61 | </label> |
| 62 | <select class="tutor-form-select" id="tutor-backend-filter-course"> |
| 63 | <?php if (count($courses)) : ?> |
| 64 | <option value=""> |
| 65 | <?php esc_html_e('All Courses', 'tutor'); ?> |
| 66 | </option> |
| 67 | <?php foreach ($courses as $course) : ?> |
| 68 | <option value="<?php echo esc_attr($course->ID); ?>" <?php selected($course_id, $course->ID, 'selected'); ?>> |
| 69 | <?php echo $course->post_title; ?> |
| 70 | </option> |
| 71 | <?php endforeach; ?> |
| 72 | <?php else : ?> |
| 73 | <option value=""><?php esc_html_e('No course found', 'tutor'); ?></option> |
| 74 | <?php endif; ?> |
| 75 | </select> |
| 76 | </div> |
| 77 | <?php endif; ?> |
| 78 | <?php if (isset($data['category_filter']) && true === $data['category_filter']) : ?> |
| 79 | <div class="tutor-wp-dashboard-filter-item"> |
| 80 | <label class="tutor-form-label"> |
| 81 | <?php esc_html_e('Category', 'tutor'); ?> |
| 82 | </label> |
| 83 | <select class="tutor-form-select" id="tutor-backend-filter-category"> |
| 84 | <?php if (count($categories)) : ?> |
| 85 | <option value=""> |
| 86 | <?php esc_html_e('All Category', 'tutor'); ?> |
| 87 | </option> |
| 88 | <?php foreach ($categories as $category) : ?> |
| 89 | <option value="<?php echo esc_attr($category->slug); ?>" <?php selected($category_slug, $category->slug, 'selected'); ?>> |
| 90 | <?php echo esc_html($category->name); ?> |
| 91 | </option> |
| 92 | <?php endforeach; ?> |
| 93 | <?php else : ?> |
| 94 | <option value=""><?php esc_html_e('No record found', 'tutor'); ?></option> |
| 95 | <?php endif; ?> |
| 96 | </select> |
| 97 | </div> |
| 98 | <?php endif; ?> |
| 99 | |
| 100 | <?php if (!isset($data['sort_by']) || $data['sort_by'] == true) : ?> |
| 101 | <div class="tutor-wp-dashboard-filter-item"> |
| 102 | <label class="tutor-form-label"> |
| 103 | <?php esc_html_e('Sort By', 'tutor'); ?> |
| 104 | </label> |
| 105 | <select class="tutor-form-select" id="tutor-backend-filter-order" data-search="no"> |
| 106 | <option value="DESC" <?php selected($order, 'DESC', 'selected'); ?>> |
| 107 | <?php esc_html_e('DESC', 'tutor'); ?> |
| 108 | </option> |
| 109 | <option value="ASC" <?php selected($order, 'ASC', 'selected'); ?>> |
| 110 | <?php esc_html_e('ASC', 'tutor'); ?> |
| 111 | </option> |
| 112 | </select> |
| 113 | </div> |
| 114 | <?php endif; ?> |
| 115 | <div class="tutor-wp-dashboard-filter-item"> |
| 116 | <label class="tutor-form-label"> |
| 117 | <?php esc_html_e('Date', 'tutor'); ?> |
| 118 | </label> |
| 119 | <div class="tutor-v2-date-picker"></div> |
| 120 | </div> |
| 121 | <div class="tutor-wp-dashboard-filter-item"> |
| 122 | <form action="" method="get" id="tutor-admin-search-filter-form"> |
| 123 | <label class="tutor-form-label"> |
| 124 | <?php esc_html_e('Search', 'tutor'); ?> |
| 125 | </label> |
| 126 | <div class="tutor-form-wrap"> |
| 127 | <span class="tutor-form-icon"><span class="tutor-icon-search" area-hidden="true"></span></span> |
| 128 | <input type="search" class="tutor-form-control" id="tutor-backend-filter-search" name="search" placeholder="<?php esc_html_e('Search...'); ?>" value="<?php esc_html_e(wp_unslash($search)); ?>" /> |
| 129 | </div> |
| 130 | </form> |
| 131 | </div> |
| 132 | </div> |
| 133 | <?php endif; ?> |
| 134 | </div> |
| 135 | </div> |
| 136 | <?php endif; ?> |
| 137 | |
| 138 | <?php |
| 139 | tutor_load_template_from_custom_path(tutor()->path . 'views/elements/bulk-confirm-popup.php'); |
| 140 | include tutor()->path . 'views/elements/elements_style.php'; |
| 141 | ?> |