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