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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 / views / pages / ecommerce / order-list.php
tutor / views / pages / ecommerce Last commit date
coupon-list.php 1 year ago order-list.php 1 year ago
order-list.php
229 lines
1 <?php
2 /**
3 * Order List Template.
4 *
5 * @package Tutor\Views
6 * @author Themeum <support@themeum.com>
7 * @link https://themeum.com
8 * @since 2.0.0
9 */
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit;
13 }
14
15 use Tutor\Ecommerce\Ecommerce;
16 use Tutor\Ecommerce\OrderController;
17 use Tutor\Helpers\DateTimeHelper;
18 use TUTOR\Input;
19
20 /**
21 * Determine active tab
22 */
23 $active_tab = Input::get( 'data', 'all' );
24
25 $paged_filter = Input::get( 'paged', 1, Input::TYPE_INT );
26 $limit = (int) tutor_utils()->get_option( 'pagination_per_page', 10 );
27 $offset = ( $limit * $paged_filter ) - $limit;
28
29 $order_controller = new OrderController();
30
31 $get_orders = $order_controller->get_orders( $limit, $offset );
32 $orders = $get_orders['results'];
33 $total_items = $get_orders['total_count'];
34
35 $add_course_url = esc_url( admin_url( 'admin.php?page=create-course' ) );
36 $navbar_data = array(
37 'page_title' => $order_controller->page_title,
38 'tabs' => $order_controller->tabs_key_value(),
39 'active' => $active_tab,
40 'add_button' => false,
41 'button_title' => __( 'Add New', 'tutor' ),
42 'button_url' => $add_course_url,
43 );
44
45 /**
46 * Bulk action & filters
47 */
48 $filters = array(
49 'bulk_action' => true,
50 'bulk_actions' => $order_controller->prepare_bulk_actions(),
51 'ajax_action' => 'tutor_order_bulk_action',
52 'filters' => true,
53 );
54
55 $available_status = array(
56 'publish' => array( __( 'Publish', 'tutor' ), 'select-success' ),
57 'pending' => array( __( 'Pending', 'tutor' ), 'select-warning' ),
58 'trash' => array( __( 'Trash', 'tutor' ), 'select-danger' ),
59 'draft' => array( __( 'Draft', 'tutor' ), 'select-default' ),
60 'private' => array( __( 'Private', 'tutor' ), 'select-default' ),
61 );
62
63 ?>
64
65 <div class="tutor-admin-wrap">
66 <?php
67 /**
68 * Load Templates with data.
69 */
70 $navbar_template = tutor()->path . 'views/elements/navbar.php';
71 $filters_template = tutor()->path . 'views/elements/filters.php';
72 tutor_load_template_from_custom_path( $navbar_template, $navbar_data );
73 tutor_load_template_from_custom_path( $filters_template, $filters );
74 ?>
75 <div class="tutor-admin-body">
76 <div class="tutor-mt-24">
77 <div class="tutor-table-responsive">
78
79 <table class="tutor-table tutor-table-middle table-dashboard-course-list">
80 <thead class="tutor-text-sm tutor-text-400">
81 <tr>
82 <th>
83 <div class="tutor-d-flex">
84 <input type="checkbox" id="tutor-bulk-checkbox-all" class="tutor-form-check-input" />
85 </div>
86 </th>
87 <th class="tutor-table-rows-sorting">
88 <?php esc_html_e( 'ID', 'tutor' ); ?>
89 <span class="a-to-z-sort-icon tutor-icon-ordering-a-z"></span>
90 </th>
91 <th>
92 <?php esc_html_e( 'Name', 'tutor' ); ?>
93 </th>
94 <th class="tutor-table-rows-sorting">
95 <?php esc_html_e( 'Date', 'tutor' ); ?>
96 <span class="a-to-z-sort-icon tutor-icon-ordering-a-z"></span>
97 </th>
98 <th>
99 <?php esc_html_e( 'Method', 'tutor' ); ?>
100 </th>
101 <th>
102 <?php esc_html_e( 'Payment Status', 'tutor' ); ?>
103 </th>
104 <th>
105 <?php esc_html_e( 'Status', 'tutor' ); ?>
106 </th>
107 <th class="tutor-table-rows-sorting">
108 <?php esc_html_e( 'Total', 'tutor' ); ?>
109 <span class="a-to-z-sort-icon tutor-icon-ordering-a-z"></span>
110 </th>
111 <th width="10%">
112 <?php esc_html_e( 'Action', 'tutor' ); ?>
113 </th>
114 </tr>
115 </thead>
116
117 <tbody>
118 <?php if ( is_array( $orders ) && count( $orders ) ) : ?>
119 <?php
120 foreach ( $orders as $key => $order ) : //phpcs:ignore
121 $user_data = get_userdata( $order->user_id );
122 ?>
123 <tr>
124 <td>
125 <div class="td-checkbox tutor-d-flex ">
126 <input type="checkbox" class="tutor-form-check-input tutor-bulk-checkbox" name="tutor-bulk-checkbox-all" value="<?php echo esc_attr( $order->id ); ?>" />
127 </div>
128 </td>
129
130 <td>
131 <div class="tutor-fs-7">
132 <?php echo esc_html( '#' . $order->id ); ?>
133 </div>
134 </td>
135
136 <td>
137 <div class="tutor-d-flex tutor-align-center">
138 <?php
139 echo wp_kses(
140 tutor_utils()->get_tutor_avatar( $user_data, 'sm' ),
141 tutor_utils()->allowed_avatar_tags()
142 )
143 ?>
144 <div class="tutor-ml-12">
145 <a target="_blank" class="tutor-fs-7 tutor-table-link" href="<?php echo esc_url( tutor_utils()->profile_url( $user_data, true ) ); ?>">
146 <?php echo esc_html( $user_data ? $user_data->display_name : '' ); ?>
147 </a>
148 </div>
149 </div>
150 </td>
151
152 <td>
153 <span class="tutor-fw-normal tutor-fs-7">
154 <?php echo esc_attr( DateTimeHelper::get_gmt_to_user_timezone_date( $order->created_at_gmt ) ); ?>
155 </span>
156 </td>
157
158 <td>
159 <div class="tutor-fs-7">
160 <?php echo esc_html( Ecommerce::get_payment_method_label( $order->payment_method ?? '' ) ); ?>
161 <?php if ( ! empty( $order->transaction_id ) ) : ?>
162 <br>
163 <span class="tutor-fw-normal tutor-fs-8 tutor-color-muted">
164 <?php
165 /* translators: %s: transaction id */
166 echo esc_html( sprintf( __( 'Trx ID: %s', 'tutor' ), $order->transaction_id ) );
167 ?>
168 </span>
169 <?php endif; ?>
170 </div>
171 </td>
172
173 <td>
174 <?php echo wp_kses_post( tutor_utils()->translate_dynamic_text( $order->payment_status, true ) ); ?>
175 </td>
176
177 <td>
178 <?php echo wp_kses_post( tutor_utils()->translate_dynamic_text( $order->order_status, true ) ); ?>
179 </td>
180 <td>
181 <?php echo wp_kses_post( tutor_utils()->tutor_price( $order->total_price ) ); ?>
182 </td>
183 <td>
184 <a href="<?php echo esc_url( $order_controller->get_order_page_url() . '&action=edit&id=' . $order->id ); ?>" class="tutor-btn tutor-btn-outline-primary tutor-btn-sm">
185 <?php esc_html_e( 'Edit', 'tutor' ); ?>
186 </a>
187 </td>
188 </tr>
189 <?php endforeach; ?>
190 <?php else : ?>
191 <tr>
192 <td colspan="100%" class="column-empty-state">
193 <?php tutor_utils()->tutor_empty_state( tutor_utils()->not_found_text() ); ?>
194 </td>
195 </tr>
196 <?php endif; ?>
197 </tbody>
198 </table>
199
200 <div class="tutor-admin-page-pagination-wrapper tutor-mt-32">
201 <?php
202 /**
203 * Prepare pagination data & load template
204 */
205 if ( $total_items > $limit ) {
206 $pagination_data = array(
207 'total_items' => $total_items,
208 'per_page' => $limit,
209 'paged' => $paged_filter,
210 );
211 $pagination_template = tutor()->path . 'views/elements/pagination.php';
212 tutor_load_template_from_custom_path( $pagination_template, $pagination_data );
213 }
214 ?>
215 </div>
216 </div>
217 <!-- end table responsive -->
218 </div>
219 </div>
220 </div>
221
222 <?php
223 tutor_load_template_from_custom_path(
224 tutor()->path . 'views/elements/common-confirm-popup.php',
225 array(
226 'message' => __( 'Deletion of the course will erase all its topics, lessons, quizzes, events, and other information. Please confirm your choice.', 'tutor' ),
227 )
228 );
229