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.2 3.2.3 3.3.0 3.3.1 3.4.0 3.4.1 3.4.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 / templates / dashboard / withdraw.php
tutor / templates / dashboard Last commit date
announcements 5 years ago assignments 5 years ago earning 5 years ago enrolled-courses 5 years ago instructor 5 years ago my-quiz-attempts 5 years ago notifications 5 years ago question-answer 5 years ago quiz-attempts 5 years ago reviews 5 years ago settings 5 years ago withdraw-method-fields 5 years ago announcements.php 5 years ago assignments.php 5 years ago create-course.php 5 years ago dashboard.php 5 years ago earning.php 5 years ago enrolled-courses.php 5 years ago index.php 5 years ago logged-in.php 5 years ago my-courses.php 5 years ago my-profile.php 5 years ago my-quiz-attempts.php 5 years ago purchase_history.php 5 years ago question-answer.php 5 years ago quiz-attempts.php 5 years ago registration.php 5 years ago reviews.php 5 years ago settings.php 5 years ago wishlist.php 5 years ago withdraw.php 5 years ago
withdraw.php
267 lines
1 <?php
2
3 /**
4 * @package TutorLMS/Templates
5 * @version 1.4.3
6 */
7
8 $earning_sum = tutor_utils()->get_earning_sum();
9 $min_withdraw = tutor_utils()->get_option('min_withdraw_amount');
10 $formatted_min_withdraw_amount = tutor_utils()->tutor_price($min_withdraw);
11
12 $saved_account = tutor_utils()->get_user_withdraw_method();
13 $withdraw_method_name = tutor_utils()->avalue_dot('withdraw_method_name', $saved_account);
14
15 $user_id = get_current_user_id();
16 $balance_formatted = tutor_utils()->tutor_price($earning_sum->balance);
17 $is_balance_sufficient = true; //$earning_sum->balance >= $min_withdraw;
18 $all_histories = tutor_utils()->get_withdrawals_history($user_id, array('status' => array('pending', 'approved', 'rejected')));
19
20 $image_base = tutor()->url . '/assets/images/';
21 $method_icons = array(
22 'bank_transfer_withdraw' => $image_base . 'icon-bank.svg',
23 'echeck_withdraw' => $image_base . 'icon-echeck.svg',
24 'paypal_withdraw' => $image_base . 'icon-paypal.svg'
25 );
26
27 $status_message = array(
28 'rejected' => __('Please contact the site administrator for more information.', 'tutor'),
29 'pending' => __('Withdrawal request is pending for approval, please hold tight.', 'tutor')
30 );
31
32 $currency_symbol = '';
33 if(function_exists('get_woocommerce_currency_symbol')){
34 $currency_symbol=get_woocommerce_currency_symbol();
35 }
36 else if(function_exists('edd_currency_symbol')){
37 $currency_symbol=edd_currency_symbol();
38 }
39
40 ?>
41
42 <div class="tutor-dashboard-content-inner tutor-frontend-dashboard-withdrawal">
43 <h4><?php echo __('Withdrawal', 'tutor'); ?></h4>
44
45 <div class="tutor-component-three-col-action">
46 <img src="<?php echo $image_base; ?>wallet.svg" />
47
48 <div>
49 <small><?php _e('Current Balance', 'tutor'); ?></small>
50 <p>
51 <?php
52 if ($is_balance_sufficient) {
53 echo sprintf(__('You currently have %s %s %s ready to withdraw', 'tutor'), "<strong class='available_balance'>", $balance_formatted, '</strong>');
54 } else {
55 echo sprintf(__('You currently have %s %s %s and this is insufficient balance to withdraw', 'tutor'), "<strong class='available_balance'>", $balance_formatted, '</strong>');
56 }
57 ?>
58 </p>
59 </div>
60
61 <?php
62 if ($is_balance_sufficient && $withdraw_method_name) {
63 ?>
64 <button class="tutor-button tutor-button-primary open-withdraw-form-btn">
65 <?php _e('Withdrawal Request', 'tutor'); ?>
66 </button>
67 <?php
68 }
69 ?>
70 </div>
71
72 <div class="current-withdraw-account-wrap withdrawal-preference inline-image-text">
73 <img src="<?php echo $image_base; ?>info-icon-question.svg" />
74 <span>
75 <?php
76 $my_profile_url = tutor_utils()->get_tutor_dashboard_page_permalink('settings/withdraw-settings');
77 echo $withdraw_method_name ? sprintf(__('The preferred payment method is selected as %s. ', 'tutor'), $withdraw_method_name) : '';
78 echo sprintf(__('You can change your %s withdrawal preference %s', 'tutor'), "<a href='{$my_profile_url}'>", '</a>');
79 ?>
80 </span>
81 </div>
82
83 <?php
84 if ($is_balance_sufficient && $withdraw_method_name) {
85 ?>
86
87 <div class="tutor-earning-withdraw-form-wrap">
88 <div>
89 <div class="tutor-withdrawal-pop-up-success">
90 <div>
91 <i class="tutor-icon-line-cross close-withdraw-form-btn" data-reload="yes"></i>
92 <br />
93 <br />
94 <div style="text-align:center">
95 <img src="<?php echo $image_base; ?>icon-cheers.svg" />
96 <h3><?php _e('Your withdrawal request has been successfully accepted', 'tutor'); ?></h3>
97 <p><?php _e('Please check your transaction notification on your connected withdrawal method', 'tutor'); ?></p>
98 </div>
99 <br />
100 <br />
101 <div class="tutor-withdraw-form-response"></div>
102 </div>
103 </div>
104 <div class="tutor-withdrawal-op-up-frorm">
105 <div>
106 <i class="tutor-icon-line-cross close-withdraw-form-btn"></i>
107 <img src="<?php echo $image_base; ?>wallet.svg" />
108 <h3><?php _e('Withdrawal Request', 'tutor'); ?></h3>
109 <p><?php _e('Please enter withdrawal amount and click the submit request button', 'tutor'); ?></p>
110 <table>
111 <tbody>
112 <tr>
113 <td>
114 <span><?php _e('Current Balance', 'tutor'); ?></span><br />
115 <b><?php echo $balance_formatted; ?></b>
116 </td>
117 <td>
118 <span><?php _e('Selected Payment Method', 'tutor'); ?></span><br />
119 <b><?php echo $withdraw_method_name; ?></b>
120 </td>
121 </tr>
122 </tbody>
123 </table>
124 </div>
125 <div>
126 <?php
127 /**
128 * @since 1.8.1
129 * set min value for withdraw input field as per settings
130 * field req step .01
131 */
132
133 ?>
134 <form id="tutor-earning-withdraw-form" action="" method="post">
135 <?php wp_nonce_field(tutor()->nonce_action, tutor()->nonce); ?>
136 <input type="hidden" value="tutor_make_an_withdraw" name="action" />
137 <?php do_action('tutor_withdraw_form_before'); ?>
138 <div class="withdraw-form-field-row">
139 <label for="tutor_withdraw_amount"><?php _e('Amount', 'tutor') ?></label>
140 <div class="withdraw-form-field-amount">
141 <span>
142 <span><?php echo $currency_symbol; ?></span>
143 </span>
144 <input type="number" min="<?php echo esc_attr($min_withdraw); ?>" name="tutor_withdraw_amount" id="tutor_withdraw_amount" step=".01" required>
145 </div>
146 <div class="inline-image-text">
147 <img src="<?php echo $image_base; ?>info-icon-question.svg" />
148 <span>Minimum withdraw amount is <?php echo strip_tags($formatted_min_withdraw_amount); ?></span>
149 </div>
150 </div>
151
152 <div class="tutor-withdraw-button-container">
153 <button class="tutor-btn tutor-btn-secondary close-withdraw-form-btn"><?php _e('Cancel', 'tutor'); ?></button>
154 <button class="tutor-btn" type="submit" id="tutor-earning-withdraw-btn" name="withdraw-form-submit"><?php _e('Submit Request', 'tutor'); ?></button>
155 </div>
156
157 <div class="tutor-withdraw-form-response"></div>
158
159 <?php do_action('tutor_withdraw_form_after'); ?>
160 </form>
161 </div>
162 </div>
163 </div>
164 </div>
165
166 <?php
167 }
168 ?>
169
170 <div class="withdraw-history-table-wrap tutor-tooltip-inside">
171 <div class="withdraw-history-table-title">
172 <h4> <?php _e('Withdrawal History', 'tutor'); ?></h4>
173 </div>
174
175 <?php
176 if (tutor_utils()->count($all_histories->results)) {
177 ?>
178 <table class="withdrawals-history tutor-table">
179 <thead>
180 <tr>
181 <th><?php _e('Withdrawal Method', 'tutor') ?></th>
182 <th width="30%"><?php _e('Requested On', 'tutor') ?></th>
183 <th width="15%"><?php _e('Amount', 'tutor') ?></th>
184 <th width="15%"><?php _e('Status', 'tutor') ?></th>
185 <th></th>
186 </tr>
187 </thead>
188 <tbody>
189 <?php
190 foreach ($all_histories->results as $withdraw_history) {
191 ?>
192 <tr>
193 <td>
194 <?php
195 $method_data = maybe_unserialize($withdraw_history->method_data);
196 $method_key = $method_data['withdraw_method_key'];
197 $method_title = '';
198
199 switch($method_key) {
200 case 'bank_transfer_withdraw':
201 $method_title = $method_data['account_number']['value'];
202 $method_title = substr_replace($method_title, '****', 2, strlen($method_title)-4);
203 break;
204 case 'paypal_withdraw':
205 $method_title = $method_data['paypal_email']['value'];
206 $email_base = substr($method_title, 0, strpos($method_title, '@'));
207 $method_title = substr_replace($email_base, '****', 2, strlen($email_base)-3) . substr($method_title, strpos($method_title, '@'));
208 break;
209 }
210 ?>
211 <div class="inline-image-text is-inline-block">
212 <img src="<?php echo isset($method_icons[$method_key]) ? $method_icons[$method_key] : ''; ?>" />
213 &nbsp;
214 <span>
215 <?php
216 echo '<strong class="withdraw-method-name">', tutor_utils()->avalue_dot('withdraw_method_name', $method_data), '</strong>';
217 echo '<small>', $method_title, '</small>';
218 ?>
219 </span>
220 </div>
221 </td>
222 <td>
223 <?php
224 echo date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($withdraw_history->created_at));
225 ?>
226 </td>
227 <td>
228 <strong><?php echo tutor_utils()->tutor_price($withdraw_history->amount); ?></strong>
229 </td>
230 <td>
231 <span class="inline-image-text is-inline-block">
232 <span class="tutor-status-text status-<?php echo $withdraw_history->status; ?>">
233 <?php echo __(ucfirst($withdraw_history->status), 'tutor'); ?>
234 </span>
235 </span>
236 </td>
237 <td>
238 <?php
239 if ($withdraw_history->status !== 'approved' && isset($status_message[$withdraw_history->status])) {
240 ?>
241 <span class="tutor-status-text-container">
242 <span class="tool-tip-container">
243 <img src="<?php echo $image_base; ?>info-icon.svg" />
244 <span class="tooltip tip-left" role="tooltip">
245 <?php echo $status_message[$withdraw_history->status]; ?>
246 </span>
247 </span>
248 </span>
249 <?php
250 }
251 ?>
252 </td>
253 </tr>
254 <?php
255 }
256 ?>
257 </tbody>
258 </table>
259 <?php
260 } else {
261 ?>
262 <p><?php _e('No withdrawal yet', 'tutor'); ?></p>
263 <?php
264 }
265 ?>
266 </div>
267 </div>