dialog-filter.php
3 years ago
emails-list.php
9 months ago
pagination-desktop.php
3 years ago
pagination-mobile.php
5 years ago
search-bar.php
3 years ago
pagination-desktop.php
235 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Title section. |
| 4 | * |
| 5 | * @var Hustle_Layout_Helper $this |
| 6 | * |
| 7 | * @package Hustle |
| 8 | * @since 4.0.0 |
| 9 | */ |
| 10 | |
| 11 | $total = $this->admin->filtered_total_entries(); |
| 12 | $is_filter_enabled = $this->admin->is_filter_box_enabled(); |
| 13 | $date_range = ''; |
| 14 | $date_created = isset( $this->admin->filters['date_created'] ) ? $this->admin->filters['date_created'] : ''; |
| 15 | |
| 16 | if ( is_array( $date_created ) && isset( $date_created[0] ) && isset( $date_created[1] ) ) { |
| 17 | $date_created[0] = date( 'm/d/Y', strtotime( $date_created[0] ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date |
| 18 | $date_created[1] = date( 'm/d/Y', strtotime( $date_created[1] ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date |
| 19 | $date_range = implode( ' - ', $date_created ); |
| 20 | } |
| 21 | |
| 22 | $search_email = isset( $this->admin->filters['search_email'] ) ? $this->admin->filters['search_email'] : ''; |
| 23 | $order_by = isset( $this->admin->order['order_by'] ) ? $this->admin->order['order_by'] : ''; |
| 24 | $order_filter = isset( $this->admin->order['order'] ) ? $this->admin->order['order'] : ''; |
| 25 | |
| 26 | $order_by_array = array( |
| 27 | 'entries.entry_id' => esc_html__( 'Id', 'hustle' ), |
| 28 | 'entries.date_created' => esc_html__( 'Date submitted', 'hustle' ), |
| 29 | ); |
| 30 | ?> |
| 31 | |
| 32 | <div class="hui-box-actions |
| 33 | <?php |
| 34 | if ( isset( $actions_class ) ) { |
| 35 | echo ' ' . esc_attr( $actions_class );} |
| 36 | ?> |
| 37 | "> |
| 38 | |
| 39 | <div class="hui-actions-bar"> |
| 40 | |
| 41 | <?php // ELEMENT: Bulk Actions. ?> |
| 42 | <form method="post" class="hustle-bulk-actions-container hui-bulk-actions"> |
| 43 | |
| 44 | <select |
| 45 | name="hustle_action" |
| 46 | id="hustle-select-bulk-actions-<?php echo $is_bottom ? 'bottom' : 'top'; ?>" |
| 47 | class="sui-select sui-select-sm" |
| 48 | data-placeholder="<?php esc_html_e( 'Bulk actions', 'hustle' ); ?>" |
| 49 | > |
| 50 | <option></option> |
| 51 | <option value="delete-all"><?php esc_html_e( 'Delete', 'hustle' ); ?></option> |
| 52 | </select> |
| 53 | |
| 54 | <input |
| 55 | type="hidden" |
| 56 | name="hustle_nonce" |
| 57 | value="<?php echo esc_attr( wp_create_nonce( 'hustle_entries_request' ) ); ?>" |
| 58 | /> |
| 59 | |
| 60 | <button |
| 61 | class="hustle-bulk-apply-button sui-button" |
| 62 | data-title="<?php esc_html_e( 'Delete Entries', 'hustle' ); ?>" |
| 63 | data-description="<?php esc_html_e( 'Are you sure you wish to permanently delete these entries?', 'hustle' ); ?>" |
| 64 | <?php disabled( true ); ?> |
| 65 | > |
| 66 | <?php esc_html_e( 'Apply', 'hustle' ); ?> |
| 67 | </button> |
| 68 | |
| 69 | </form> |
| 70 | |
| 71 | <?php // ELEMENT: Pagination (Desktop). ?> |
| 72 | <div class="hui-pagination hui-pagination-desktop"> |
| 73 | |
| 74 | <?php |
| 75 | $entries_per_page = $this->admin->get_per_page(); |
| 76 | |
| 77 | $this->render( |
| 78 | 'admin/commons/pagination', |
| 79 | array( |
| 80 | 'total' => $total, |
| 81 | 'entries_per_page' => $entries_per_page, |
| 82 | 'filterclass' => 'hustle-open-inline-filter', |
| 83 | 'filter' => array(), |
| 84 | ) |
| 85 | ); |
| 86 | ?> |
| 87 | |
| 88 | </div> |
| 89 | |
| 90 | </div> |
| 91 | |
| 92 | <div class="sui-pagination-filter"> |
| 93 | |
| 94 | <form method="get"> |
| 95 | |
| 96 | <input type="hidden" name="page" value="hustle_entries"> |
| 97 | <input type="hidden" name="module_type" value="<?php echo esc_attr( $this->admin->get_module_type() ); ?>"> |
| 98 | <input type="hidden" name="module_id" value="<?php echo esc_attr( $this->admin->get_module_id() ); ?>"> |
| 99 | |
| 100 | <div class="sui-row"> |
| 101 | |
| 102 | <div class="sui-col-md-6"> |
| 103 | |
| 104 | <div class="sui-form-field"> |
| 105 | <label class="sui-label"><?php esc_html_e( 'Email id has keyword', 'hustle' ); ?></label> |
| 106 | <div class="sui-control-with-icon"> |
| 107 | <input type="text" |
| 108 | name="search_email" |
| 109 | placeholder="<?php esc_html_e( 'E.g. gmail', 'hustle' ); ?>" |
| 110 | class="sui-form-control" |
| 111 | value="<?php echo esc_attr( $search_email ); ?>" /> |
| 112 | <span class="sui-icon-magnifying-glass-search" aria-hidden="true"></span> |
| 113 | </div> |
| 114 | </div> |
| 115 | |
| 116 | </div> |
| 117 | |
| 118 | <div class="sui-col-md-3"> |
| 119 | |
| 120 | <div class="sui-form-field"> |
| 121 | <label class="sui-label"><?php esc_html_e( 'Sort by', 'hustle' ); ?></label> |
| 122 | <select name="order_by" id="hustle-select-order-by-<?php echo $is_bottom ? 'bottom' : 'top'; ?>"> |
| 123 | <?php foreach ( $order_by_array as $key => $name ) { ?> |
| 124 | <option value="<?php echo esc_attr( $key ); ?>" <?php selected( $key, $order_by ); ?>><?php echo esc_html( $name ); ?></option> |
| 125 | <?php } ?> |
| 126 | </select> |
| 127 | </div> |
| 128 | |
| 129 | </div> |
| 130 | |
| 131 | <div class="sui-col-md-3"> |
| 132 | |
| 133 | <div class="sui-form-field"> |
| 134 | <label class="sui-label"><?php esc_html_e( 'Sort Order', 'hustle' ); ?></label> |
| 135 | <select id="forminator-forms-filter--sort-order" name="order"> |
| 136 | <option value="DESC" <?php selected( 'DESC', $order_filter ); ?>><?php esc_html_e( 'Descending', 'hustle' ); ?></option> |
| 137 | <option value="ASC" <?php selected( 'ASC', $order_filter ); ?>><?php esc_html_e( 'Ascending', 'hustle' ); ?></option> |
| 138 | </select> |
| 139 | </div> |
| 140 | |
| 141 | </div> |
| 142 | |
| 143 | </div> |
| 144 | |
| 145 | <div class="sui-row"> |
| 146 | |
| 147 | <div class="sui-col-md-6"> |
| 148 | |
| 149 | <div class="sui-form-field"> |
| 150 | <label class="sui-label"><?php esc_html_e( 'Conversion date range', 'hustle' ); ?></label> |
| 151 | <div class="sui-date"> |
| 152 | <span class="sui-icon-calendar" aria-hidden="true"></span> |
| 153 | <input type="text" |
| 154 | name="date_range" |
| 155 | value="<?php echo esc_attr( $date_range ); ?>" |
| 156 | placeholder="<?php esc_html_e( 'Pick a date range', 'hustle' ); ?>" |
| 157 | class="hustle-entries-filter-date sui-form-control" |
| 158 | autocomplete="off" |
| 159 | /> |
| 160 | </div> |
| 161 | </div> |
| 162 | |
| 163 | </div> |
| 164 | |
| 165 | </div> |
| 166 | |
| 167 | <div class="sui-filter-footer"> |
| 168 | |
| 169 | <button type="button" class="sui-button sui-button-ghost hustle-entries-clear-filter"> |
| 170 | <?php esc_html_e( 'Clear Filters', 'hustle' ); ?> |
| 171 | </button> |
| 172 | |
| 173 | <button class="sui-button"> |
| 174 | <?php esc_html_e( 'Apply', 'hustle' ); ?> |
| 175 | </button> |
| 176 | |
| 177 | </div> |
| 178 | |
| 179 | </form> |
| 180 | |
| 181 | </div> |
| 182 | |
| 183 | <?php |
| 184 | $get_order_by = filter_input( INPUT_GET, 'order_by', FILTER_SANITIZE_SPECIAL_CHARS ); |
| 185 | $ordered = ! is_null( $get_order_by ) && key_exists( $get_order_by, $order_by_array ); |
| 186 | |
| 187 | $order_direction = filter_input( INPUT_GET, 'order', FILTER_SANITIZE_SPECIAL_CHARS ); |
| 188 | if ( 'DESC' === $order_direction ) { |
| 189 | $direction = __( 'Descending', 'forminator' ); |
| 190 | } else { |
| 191 | $direction = __( 'Ascending', 'forminator' ); |
| 192 | } |
| 193 | |
| 194 | if ( $ordered || $search_email || $date_range || $order_direction ) { |
| 195 | ?> |
| 196 | |
| 197 | <div class="sui-pagination-filters-list"> |
| 198 | |
| 199 | <label class="sui-label"><?php esc_html_e( 'Active filters', 'hustle' ); ?></label> |
| 200 | |
| 201 | <div class="sui-pagination-active-filters"> |
| 202 | |
| 203 | <?php if ( $search_email ) { ?> |
| 204 | <span class="sui-active-filter"> |
| 205 | <?php esc_html_e( 'Has keyword:', 'hustle' ); ?> <?php echo esc_html( $search_email ); ?> |
| 206 | <span class="sui-active-filter-remove" data-filter="search_email" role="button"><span class="sui-screen-reader-text"><?php esc_html_e( 'Remove this filter', 'hustle' ); ?></span></span></span> |
| 207 | <?php } ?> |
| 208 | |
| 209 | <?php if ( $ordered ) { ?> |
| 210 | <span class="sui-active-filter"> |
| 211 | <?php esc_html_e( 'Sort by:', 'hustle' ); ?> <?php echo esc_html( $order_by_array[ $get_order_by ] ); ?> |
| 212 | <span class="sui-active-filter-remove" data-filter="order_by" role="button"><span class="sui-screen-reader-text"><?php esc_html_e( 'Remove this filter', 'hustle' ); ?></span></span></span> |
| 213 | <?php } ?> |
| 214 | |
| 215 | <?php if ( $order_direction ) { ?> |
| 216 | <span class="sui-active-filter"> |
| 217 | <?php esc_html_e( 'Sort Order:', 'hustle' ); ?> <?php echo esc_html( $direction ); ?> |
| 218 | <span class="sui-active-filter-remove" data-filter="order" role="button"><span class="sui-screen-reader-text"><?php esc_html_e( 'Remove this filter', 'hustle' ); ?></span></span></span> |
| 219 | <?php } ?> |
| 220 | |
| 221 | <?php if ( $date_range ) { ?> |
| 222 | <?php $date_range_to = str_replace( ' - ', __( ' to ', 'hustle' ), $date_range ); ?> |
| 223 | <span class="sui-active-filter"> |
| 224 | <?php esc_html_e( 'Submission date range:', 'hustle' ); ?> <?php echo esc_html( $date_range_to ); ?> |
| 225 | <span class="sui-active-filter-remove" data-filter="date_range" role="button"><span class="sui-screen-reader-text"><?php esc_html_e( 'Remove this filter', 'hustle' ); ?></span></span></span> |
| 226 | <?php } ?> |
| 227 | |
| 228 | </div> |
| 229 | |
| 230 | </div> |
| 231 | |
| 232 | <?php } ?> |
| 233 | |
| 234 | </div> |
| 235 |