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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
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 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
257 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 = $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="withdraw-page-current-balance">
46 <div class="balance-info">
47 <img src="<?php echo $image_base; ?>wallet.svg" />
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 </div>
61 <div class="make-withdraw">
62 <?php
63 if ($is_balance_sufficient && $withdraw_method_name) { ?>
64 <a class="open-withdraw-form-btn" href="javascript:;"><?php _e('Make a withdraw', 'tutor'); ?></a> <?php
65 }
66 ?>
67 </div>
68 </div>
69
70 <div class="current-withdraw-account-wrap withdrawal-preference inline-image-text">
71 <img src="<?php echo $image_base; ?>info-icon-question.svg" />
72 <span>
73 <?php
74 $my_profile_url = tutor_utils()->get_tutor_dashboard_page_permalink('settings/withdraw-settings');
75 echo $withdraw_method_name ? sprintf(__('The preferred payment method is selected as %s. ', 'tutor'), $withdraw_method_name) : '';
76 echo sprintf(__('You can change your %s withdrawal preference %s', 'tutor'), "<a href='{$my_profile_url}'>", '</a>');
77 ?>
78 </span>
79 </div>
80
81 <?php
82 if ($earning_sum->balance >= $min_withdraw && $withdraw_method_name) {
83 ?>
84
85 <div class="tutor-earning-withdraw-form-wrap">
86 <div>
87 <div class="tutor-withdrawal-pop-up-success">
88 <div>
89 <i class="tutor-icon-line-cross close-withdraw-form-btn" data-reload="yes"></i>
90 <br />
91 <br />
92 <div style="text-align:center">
93 <img src="<?php echo $image_base; ?>icon-cheers.svg" />
94 <h3><?php _e('Your withdrawal request has been successfully accepted', 'tutor'); ?></h3>
95 <p><?php _e('Please check your transaction notification on your connected withdrawal method', 'tutor'); ?></p>
96 </div>
97 <br />
98 <br />
99 <div class="tutor-withdraw-form-response"></div>
100 </div>
101 </div>
102 <div class="tutor-withdrawal-op-up-frorm">
103 <div>
104 <i class="tutor-icon-line-cross close-withdraw-form-btn"></i>
105 <img src="<?php echo $image_base; ?>wallet.svg" />
106 <h3><?php _e('Make a Withdrawal', 'tutor'); ?></h3>
107 <p><?php _e('Please enter withdrawal amount and click the submit request button', 'tutor'); ?></p>
108 <table>
109 <tbody>
110 <tr>
111 <td>
112 <span><?php _e('Current Balance', 'tutor'); ?></span><br />
113 <b><?php echo $balance_formatted; ?></b>
114 </td>
115 <td>
116 <span><?php _e('Selected Payment Method', 'tutor'); ?></span><br />
117 <b><?php echo $withdraw_method_name; ?></b>
118 </td>
119 </tr>
120 </tbody>
121 </table>
122 </div>
123 <div>
124 <form id="tutor-earning-withdraw-form" action="" method="post">
125 <?php wp_nonce_field(tutor()->nonce_action, tutor()->nonce); ?>
126 <input type="hidden" value="tutor_make_an_withdraw" name="action" />
127 <?php do_action('tutor_withdraw_form_before'); ?>
128 <div class="withdraw-form-field-row">
129 <label for="tutor_withdraw_amount"><?php _e('Amount', 'tutor') ?></label>
130 <div class="withdraw-form-field-amount">
131 <span>
132 <span><?php echo $currency_symbol; ?></span>
133 </span>
134 <input type="number" min="1" name="tutor_withdraw_amount">
135 </div>
136 <div class="inline-image-text">
137 <img src="<?php echo $image_base; ?>info-icon-question.svg" />
138 <span>Minimum withdraw amount is <?php echo strip_tags($formatted_min_withdraw_amount); ?></span>
139 </div>
140 </div>
141
142 <div class="tutor-withdraw-button-container">
143 <button class="tutor-btn tutor-btn-secondary close-withdraw-form-btn"><?php _e('Cancel', 'tutor'); ?></button>
144 <button class="tutor-btn" type="submit" id="tutor-earning-withdraw-btn" name="withdraw-form-submit"><?php _e('Submit Request', 'tutor'); ?></button>
145 </div>
146
147 <div class="tutor-withdraw-form-response"></div>
148
149 <?php do_action('tutor_withdraw_form_after'); ?>
150 </form>
151 </div>
152 </div>
153 </div>
154 </div>
155
156 <?php
157 }
158 ?>
159
160 <div class="withdraw-history-table-wrap tutor-tooltip-inside">
161 <div class="withdraw-history-table-title">
162 <h4> <?php _e('Withdrawal History', 'tutor'); ?></h4>
163 </div>
164
165 <?php
166 if (tutor_utils()->count($all_histories->results)) {
167 ?>
168 <table class="withdrawals-history tutor-table">
169 <thead>
170 <tr>
171 <th><?php _e('Withdrawal Method', 'tutor') ?></th>
172 <th width="30%"><?php _e('Requested On', 'tutor') ?></th>
173 <th width="15%"><?php _e('Amount', 'tutor') ?></th>
174 <th width="15%"><?php _e('Status', 'tutor') ?></th>
175 <th></th>
176 </tr>
177 </thead>
178 <tbody>
179 <?php
180 foreach ($all_histories->results as $withdraw_history) {
181 ?>
182 <tr>
183 <td>
184 <?php
185 $method_data = maybe_unserialize($withdraw_history->method_data);
186 $method_key = $method_data['withdraw_method_key'];
187 $method_title = '';
188
189 switch($method_key) {
190 case 'bank_transfer_withdraw':
191 $method_title = $method_data['account_number']['value'];
192 $method_title = substr_replace($method_title, '****', 2, strlen($method_title)-4);
193 break;
194 case 'paypal_withdraw':
195 $method_title = $method_data['paypal_email']['value'];
196 $email_base = substr($method_title, 0, strpos($method_title, '@'));
197 $method_title = substr_replace($email_base, '****', 2, strlen($email_base)-3) . substr($method_title, strpos($method_title, '@'));
198 break;
199 }
200 ?>
201 <div class="inline-image-text is-inline-block">
202 <img src="<?php echo isset($method_icons[$method_key]) ? $method_icons[$method_key] : ''; ?>" />
203 &nbsp;
204 <span>
205 <?php
206 echo '<strong class="withdraw-method-name">', tutor_utils()->avalue_dot('withdraw_method_name', $method_data), '</strong>';
207 echo '<small>', $method_title, '</small>';
208 ?>
209 </span>
210 </div>
211 </td>
212 <td>
213 <?php
214 echo date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($withdraw_history->created_at));
215 ?>
216 </td>
217 <td>
218 <strong><?php echo tutor_utils()->tutor_price($withdraw_history->amount); ?></strong>
219 </td>
220 <td>
221 <span class="inline-image-text is-inline-block">
222 <span class="tutor-status-text status-<?php echo $withdraw_history->status; ?>">
223 <?php echo __(ucfirst($withdraw_history->status), 'tutor'); ?>
224 </span>
225 </span>
226 </td>
227 <td>
228 <?php
229 if ($withdraw_history->status !== 'approved' && isset($status_message[$withdraw_history->status])) {
230 ?>
231 <span class="tutor-status-text-container">
232 <span class="tool-tip-container">
233 <img src="<?php echo $image_base; ?>info-icon.svg" />
234 <span class="tooltip tip-left" role="tooltip">
235 <?php echo $status_message[$withdraw_history->status]; ?>
236 </span>
237 </span>
238 </span>
239 <?php
240 }
241 ?>
242 </td>
243 </tr>
244 <?php
245 }
246 ?>
247 </tbody>
248 </table>
249 <?php
250 } else {
251 ?>
252 <p><?php _e('No withdrawal yet', 'tutor'); ?></p>
253 <?php
254 }
255 ?>
256 </div>
257 </div>