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.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 / templates / dashboard / withdraw.php
tutor / templates / dashboard Last commit date
announcements 4 years ago assignments 4 years ago elements 4 years ago enrolled-courses 4 years ago instructor 4 years ago my-courses 4 years ago my-quiz-attempts 4 years ago notifications 4 years ago question-answer 4 years ago quiz-attempts 4 years ago reviews 4 years ago settings 4 years ago withdraw-method-fields 4 years ago announcements.php 4 years ago assignments.php 4 years ago create-course.php 4 years ago dashboard-menu.php 4 years ago dashboard.php 4 years ago enrolled-courses.php 4 years ago index.php 4 years ago logged-in.php 4 years ago my-courses.php 4 years ago my-profile.php 4 years ago my-quiz-attempts.php 4 years ago purchase_history.php 4 years ago question-answer.php 4 years ago quiz-attempts.php 4 years ago registration.php 4 years ago reviews.php 4 years ago settings.php 4 years ago wishlist.php 4 years ago withdraw.php 4 years ago
withdraw.php
326 lines
1 <?php
2
3 /**
4 * @package TutorLMS/Templates
5 * @version 1.4.3
6 */
7
8 $per_page = tutor_utils()->get_option('statement_show_per_page', 20);
9 $current_page = max( 1, tutor_utils()->avalue_dot( 'current_page', tutor_sanitize_data($_GET) ) );
10 $offset = ( $current_page - 1 ) * $per_page;
11
12 $earning_sum = tutor_utils()->get_earning_sum();
13 $min_withdraw = tutor_utils()->get_option( 'min_withdraw_amount' );
14 $formatted_min_withdraw_amount = tutor_utils()->tutor_price( $min_withdraw );
15
16 $saved_account = tutor_utils()->get_user_withdraw_method();
17 $withdraw_method_name = tutor_utils()->avalue_dot( 'withdraw_method_name', $saved_account );
18
19 $user_id = get_current_user_id();
20 $balance_formatted = tutor_utils()->tutor_price( $earning_sum->balance );
21 $is_balance_sufficient = true; // $earning_sum->balance >= $min_withdraw;
22 $all_histories = tutor_utils()->get_withdrawals_history( $user_id, array( 'status' => array( 'pending', 'approved', 'rejected' ) ), $offset, $per_page );
23 $image_base = tutor()->url . '/assets/images/';
24 $method_icons = array(
25 'bank_transfer_withdraw' => $image_base . 'icon-bank.svg',
26 'echeck_withdraw' => $image_base . 'icon-echeck.svg',
27 'paypal_withdraw' => $image_base . 'icon-paypal.svg',
28 );
29
30 $status_message = array(
31 'rejected' => __( 'Please contact the site administrator for more information.', 'tutor' ),
32 'pending' => __( 'Withdrawal request is pending for approval, please hold tight.', 'tutor' ),
33 );
34
35 $currency_symbol = '';
36 if ( function_exists( 'get_woocommerce_currency_symbol' ) ) {
37 $currency_symbol = get_woocommerce_currency_symbol();
38 } elseif ( function_exists( 'edd_currency_symbol' ) ) {
39 $currency_symbol = edd_currency_symbol();
40 }
41
42 ?>
43
44 <div class="tutor-dashboard-content-inner tutor-frontend-dashboard-withdrawal tutor-color-black">
45 <div class="tutor-fs-5 tutor-fw-medium tutor-color-black tutor-mb-24"><?php echo __( 'Withdrawal', 'tutor' ); ?></div>
46
47 <div class="tutor-component-three-col-action">
48 <img src="<?php echo esc_url( $image_base ); ?>wallet.svg" />
49
50 <div class="tutor-mt-12 tutor-mt-sm-0">
51 <small><?php esc_html_e( 'Current Balance', 'tutor' ); ?></small>
52 <p>
53 <?php
54 if ( $is_balance_sufficient ) {
55 echo sprintf( __( 'You currently have %1$s %2$s %3$s ready to withdraw', 'tutor' ), "<strong class='available_balance'>", $balance_formatted, '</strong>' );
56 } else {
57 echo sprintf( __( 'You currently have %1$s %2$s %3$s and this is insufficient balance to withdraw', 'tutor' ), "<strong class='available_balance'>", $balance_formatted, '</strong>' );
58 }
59 ?>
60 </p>
61 </div>
62
63 <?php
64 if ( $is_balance_sufficient && $withdraw_method_name ) {
65 ?>
66 <button class="tutor-btn open-withdraw-form-btn tutor-mt-12 tutor-mt-sm-0">
67 <?php esc_html_e( 'Withdrawal Request', 'tutor' ); ?>
68 </button>
69 <?php
70 }
71 ?>
72 </div>
73
74 <div class="current-withdraw-account-wrap withdrawal-preference inline-image-text tutor-mt-20">
75 <!-- <img src="<?php echo esc_url( $image_base ); ?>info-icon-question.svg" /> -->
76 <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
77 <path fill-rule="evenodd" clip-rule="evenodd" d="M0.5 9.00005C0.5 4.31315 4.3131 0.5 9 0.5C13.6869 0.5 17.5 4.31315 17.5 9.00005C17.5 13.687 13.6869 17.5 9 17.5C4.3131 17.5 0.5 13.687 0.5 9.00005ZM2.04498 9.00036C2.04498 12.8351 5.16474 15.9549 8.99953 15.9549C12.8343 15.9549 15.9541 12.8351 15.9541 9.00036C15.9541 5.16562 12.8343 2.04576 8.99953 2.04576C5.16474 2.04576 2.04498 5.16562 2.04498 9.00036ZM8.99976 4.10617C8.43176 4.10617 7.96967 4.56857 7.96967 5.13694C7.96967 5.70479 8.43176 6.16678 8.99976 6.16678C9.56777 6.16678 10.0299 5.70479 10.0299 5.13694C10.0299 4.56857 9.56777 4.10617 8.99976 4.10617ZM8.22699 8.48481C8.22699 8.05806 8.57297 7.71208 8.99972 7.71208C9.42647 7.71208 9.77244 8.05806 9.77244 8.48481V13.1212C9.77244 13.5479 9.42647 13.8939 8.99972 13.8939C8.57297 13.8939 8.22699 13.5479 8.22699 13.1212V8.48481Z" fill="#212327"/>
78 </svg>
79 <span class="tutor-fs-7 tutor-fw-normal tutor-color-muted">
80 <?php
81 $my_profile_url = tutor_utils()->get_tutor_dashboard_page_permalink( 'settings/withdraw-settings' );
82 echo $withdraw_method_name ? sprintf( __( 'The preferred payment method is selected as %s. ', 'tutor' ), $withdraw_method_name ) : '';
83 echo sprintf( __( 'You can change your %1$s Withdraw Preference %2$s', 'tutor' ), "<a href='{$my_profile_url}'>", '</a>' );
84 ?>
85 </span>
86 </div>
87
88 <?php
89 if ( $is_balance_sufficient && $withdraw_method_name ) {
90 ?>
91
92 <div class="tutor-earning-withdraw-form-wrap">
93 <div>
94 <div class="tutor-withdrawal-pop-up-success">
95 <div>
96 <i class="tutor-icon-line-cross-line close-withdraw-form-btn tutor-color-black-40" data-reload="yes"></i>
97 <br />
98 <br />
99 <div style="text-align:center">
100 <img src="<?php echo $image_base; ?>icon-cheers.svg" />
101 <div class="tutor-fs-4 tutor-fw-normal"><?php esc_html_e( 'Your withdrawal request has been successfully accepted', 'tutor' ); ?></div>
102 <span class="tutor-fs-6 tutor-fw-normal tutor-color-black-60"><?php esc_html_e( 'Please check your transaction notification on your connected withdrawal method', 'tutor' ); ?></span>
103 </div>
104 <br />
105 <br />
106 <div class="tutor-withdraw-form-response"></div>
107 </div>
108 </div>
109 <div class="tutor-withdrawal-op-up-frorm ">
110 <i class="tutor-icon-line-cross-line close-withdraw-form-btn tutor-color-black-40"></i>
111 <div>
112 <img src="<?php echo $image_base; ?>wallet.svg" />
113 <div class="text-medium-h5 tutor-color-black tutor-mt-20">
114 <?php esc_html_e( 'Withdrawal Request', 'tutor' ); ?>
115 </div>
116 <p class="tutor-mb-40"><?php esc_html_e( 'Please enter withdrawal amount and click the submit request button', 'tutor' ); ?></p>
117 <table>
118 <tbody>
119 <tr>
120 <td>
121 <span><?php esc_html_e( 'Current Balance', 'tutor' ); ?></span><br />
122 <b><?php echo wp_kses_post( $balance_formatted ); ?></b>
123 </td>
124 <td>
125 <span><?php esc_html_e( 'Selected Payment Method', 'tutor' ); ?></span><br />
126 <b><?php esc_html_e( $withdraw_method_name ); ?></b>
127 </td>
128 </tr>
129 </tbody>
130 </table>
131 </div>
132 <div>
133 <?php
134 /**
135 * @since 1.8.1
136 * set min value for withdraw input field as per settings
137 * field req step .01
138 */
139
140 ?>
141 <form id="tutor-earning-withdraw-form" action="" method="post">
142 <?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
143 <input type="hidden" value="tutor_make_an_withdraw" name="action" />
144 <?php do_action( 'tutor_withdraw_form_before' ); ?>
145 <div class="withdraw-form-field-row">
146 <label for="tutor_withdraw_amount"><?php esc_html_e( 'Amount', 'tutor' ); ?></label>
147 <div class="withdraw-form-field-amount">
148 <span>
149 <span><?php echo esc_attr( $currency_symbol ); ?></span>
150 </span>
151 <input type="number" min="<?php echo esc_attr( $min_withdraw ); ?>" name="tutor_withdraw_amount" id="tutor_withdraw_amount" step=".01" required>
152 </div>
153 <div class="inline-image-text">
154 <img src="<?php echo $image_base; ?>info-icon-question.svg" />
155 <span>
156 <?php echo __( 'Minimum withdraw amount is', 'tutor' ) . ' ' . strip_tags( $formatted_min_withdraw_amount ); ?>
157 </span>
158 </div>
159 </div>
160
161 <div class="tutor-withdraw-button-container">
162 <button class="tutor-btn tutor-btn-secondary close-withdraw-form-btn"><?php esc_html_e( 'Cancel', 'tutor' ); ?></button>
163 <button class="tutor-btn" type="submit" id="tutor-earning-withdraw-btn" name="withdraw-form-submit"><?php esc_html_e( 'Submit Request', 'tutor' ); ?></button>
164 </div>
165
166 <div class="tutor-withdraw-form-response"></div>
167
168 <?php do_action( 'tutor_withdraw_form_after' ); ?>
169 </form>
170 </div>
171 </div>
172 </div>
173 </div>
174
175 <?php
176 }
177
178 if ( is_array( $all_histories->results ) && count ( $all_histories->results ) ) {
179 ?>
180 <div class="withdraw-history-table-wrap tutor-tooltip-inside tutor-mt-40">
181 <div class="withdraw-history-table-title">
182 <div class="tutor-fs-5 tutor-fw-medium tutor-color-black tutor-mb-24">
183 <?php esc_html_e( 'Withdrawal History', 'tutor' ); ?>
184 </div>
185 </div>
186
187 <table class="tutor-ui-table tutor-ui-table-responsive">
188 <thead>
189 <tr>
190 <th width="40%">
191 <div class="text-regular-small tutor-color-black-60">
192 <?php esc_html_e( 'Withdrawal Method', 'tutor' ); ?>
193 </div>
194 </th>
195 <th width="28%">
196 <div class="text-regular-small tutor-color-black-60">
197 <?php esc_html_e( 'Requested On', 'tutor' ); ?>
198 </div>
199 </th>
200 <th width="13%">
201 <div class="text-regular-small tutor-color-black-60">
202 <?php esc_html_e( 'Amount', 'tutor' ); ?>
203 </div>
204 </th>
205 <th width="13%">
206 <div class="text-regular-small tutor-color-black-60">
207 <?php esc_html_e( 'Status', 'tutor' ); ?>
208 </div>
209 </th>
210 <th></th>
211 </tr>
212 </thead>
213 <tbody>
214 <?php
215 foreach ( $all_histories->results as $withdraw_history ) {
216 ?>
217 <tr>
218 <td>
219 <?php
220 $method_data = maybe_unserialize( $withdraw_history->method_data );
221 $method_key = $method_data['withdraw_method_key'];
222 $method_title = '';
223
224 switch ( $method_key ) {
225 case 'bank_transfer_withdraw':
226 $method_title = $method_data['account_number']['value'];
227 $method_title = substr_replace( $method_title, '****', 2, strlen( $method_title ) - 4 );
228 break;
229 case 'paypal_withdraw':
230 $method_title = $method_data['paypal_email']['value'];
231 $email_base = substr( $method_title, 0, strpos( $method_title, '@' ) );
232 $method_title = substr_replace( $email_base, '****', 2, strlen( $email_base ) - 3 ) . substr( $method_title, strpos( $method_title, '@' ) );
233 break;
234 }
235 ?>
236 <div class="tutor-withdrawals-method">
237 <div class="tutor-withdrawals-method-icon">
238 <img src="<?php echo esc_url( isset( $method_icons[ $method_key ] ) ? $method_icons[ $method_key ] : '' ); ?>" />
239 </div>
240 <div class="tutor-withdrawals-method-name">
241 <div class="withdraw-method-name tutor-fs-6 tutor-fw-medium tutor-color-black">
242 <?php echo esc_html( tutor_utils()->avalue_dot( 'withdraw_method_name', $method_data ) ); ?>
243 </div>
244 <div class="tutor-fs-7 tutor-fw-normal tutor-color-muted">
245 <?php echo esc_html( $method_title ); ?>
246 </div>
247 </div>
248 </div>
249 </td>
250 <td>
251 <span class="color-text-primary">
252 <?php
253 echo esc_attr( date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), strtotime( $withdraw_history->created_at ) ) );
254 ?>
255 </span>
256 </td>
257 <td>
258 <div class="tutor-fs-7 tutor-fw-medium tutor-color-black">
259 <?php echo tutor_utils()->tutor_price( $withdraw_history->amount ); ?>
260 </div>
261 </td>
262 <td>
263 <span class="inline-image-text is-inline-block">
264 <span class="tutor-badge-label
265 <?php
266 if ( $withdraw_history->status == 'approved' ) {
267 echo 'label-success'; }
268 ?>
269 <?php
270 if ( $withdraw_history->status == 'pending' ) {
271 echo 'label-warning'; }
272 ?>
273 <?php
274 if ( $withdraw_history->status == 'rejected' ) {
275 echo 'label-danger'; }
276 ?>
277 ">
278 <?php echo __( ucfirst( $withdraw_history->status ), 'tutor' ); ?>
279 </span>
280 </span>
281 </td>
282 <td>
283 <?php
284 if ( $withdraw_history->status !== 'approved' && isset( $status_message[ $withdraw_history->status ] ) ) {
285 ?>
286 <span class="tool-tip-container">
287 <div class="tooltip-wrap tooltip-icon tutor-mt-12">
288 <span class="tooltip-txt tooltip-left">
289 <?php echo esc_html( $status_message[ $withdraw_history->status ] ); ?>
290 </span>
291 </div>
292 </span>
293 <?php
294 }
295 ?>
296 </td>
297 </tr>
298 <?php
299 }
300 ?>
301 </tbody>
302 </table>
303 </div>
304 <?php
305 } else {
306 tutor_utils()->tutor_empty_state( tutor_utils()->not_found_text() );
307 }
308 ?>
309 </div>
310
311 <div class="tutor-mt-25">
312 <?php
313 if($all_histories->count >= $per_page) {
314 $pagination_data = array(
315 'total_items' => $all_histories->count,
316 'per_page' => $per_page,
317 'paged' => $current_page,
318 );
319
320 tutor_load_template_from_custom_path(
321 tutor()->path . 'templates/dashboard/elements/pagination.php',
322 $pagination_data
323 );
324 }
325 ?>
326 </div>