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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 earning 4 years ago enrolled-courses 5 years ago instructor 4 years ago my-quiz-attempts 4 years ago notifications 5 years ago question-answer 5 years ago quiz-attempts 4 years ago reviews 4 years ago settings 5 years ago withdraw-method-fields 5 years ago announcements.php 4 years ago assignments.php 4 years ago create-course.php 4 years ago dashboard.php 4 years ago earning.php 4 years ago enrolled-courses.php 4 years ago index.php 4 years ago logged-in.php 5 years ago my-courses.php 5 years ago my-profile.php 5 years ago my-quiz-attempts.php 4 years ago purchase_history.php 5 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 5 years ago wishlist.php 5 years ago withdraw.php 4 years ago
withdraw.php
269 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>
149 <?php echo __( 'Minimum withdraw amount is', 'tutor' ).' '.strip_tags($formatted_min_withdraw_amount); ?>
150 </span>
151 </div>
152 </div>
153
154 <div class="tutor-withdraw-button-container">
155 <button class="tutor-btn tutor-btn-secondary close-withdraw-form-btn"><?php _e('Cancel', 'tutor'); ?></button>
156 <button class="tutor-btn" type="submit" id="tutor-earning-withdraw-btn" name="withdraw-form-submit"><?php _e('Submit Request', 'tutor'); ?></button>
157 </div>
158
159 <div class="tutor-withdraw-form-response"></div>
160
161 <?php do_action('tutor_withdraw_form_after'); ?>
162 </form>
163 </div>
164 </div>
165 </div>
166 </div>
167
168 <?php
169 }
170 ?>
171
172 <div class="withdraw-history-table-wrap tutor-tooltip-inside">
173 <div class="withdraw-history-table-title">
174 <h4> <?php _e('Withdrawal History', 'tutor'); ?></h4>
175 </div>
176
177 <?php
178 if (tutor_utils()->count($all_histories->results)) {
179 ?>
180 <table class="withdrawals-history tutor-table">
181 <thead>
182 <tr>
183 <th><?php _e('Withdrawal Method', 'tutor') ?></th>
184 <th width="30%"><?php _e('Requested On', 'tutor') ?></th>
185 <th width="15%"><?php _e('Amount', 'tutor') ?></th>
186 <th width="15%"><?php _e('Status', 'tutor') ?></th>
187 <th></th>
188 </tr>
189 </thead>
190 <tbody>
191 <?php
192 foreach ($all_histories->results as $withdraw_history) {
193 ?>
194 <tr>
195 <td>
196 <?php
197 $method_data = maybe_unserialize($withdraw_history->method_data);
198 $method_key = $method_data['withdraw_method_key'];
199 $method_title = '';
200
201 switch($method_key) {
202 case 'bank_transfer_withdraw':
203 $method_title = $method_data['account_number']['value'];
204 $method_title = substr_replace($method_title, '****', 2, strlen($method_title)-4);
205 break;
206 case 'paypal_withdraw':
207 $method_title = $method_data['paypal_email']['value'];
208 $email_base = substr($method_title, 0, strpos($method_title, '@'));
209 $method_title = substr_replace($email_base, '****', 2, strlen($email_base)-3) . substr($method_title, strpos($method_title, '@'));
210 break;
211 }
212 ?>
213 <div class="inline-image-text is-inline-block">
214 <img src="<?php echo isset($method_icons[$method_key]) ? $method_icons[$method_key] : ''; ?>" />
215 &nbsp;
216 <span>
217 <?php
218 echo '<strong class="withdraw-method-name">', tutor_utils()->avalue_dot('withdraw_method_name', $method_data), '</strong>';
219 echo '<small>', $method_title, '</small>';
220 ?>
221 </span>
222 </div>
223 </td>
224 <td>
225 <?php
226 echo date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($withdraw_history->created_at));
227 ?>
228 </td>
229 <td>
230 <strong><?php echo tutor_utils()->tutor_price($withdraw_history->amount); ?></strong>
231 </td>
232 <td>
233 <span class="inline-image-text is-inline-block">
234 <span class="tutor-status-text status-<?php echo $withdraw_history->status; ?>">
235 <?php echo __(ucfirst($withdraw_history->status), 'tutor'); ?>
236 </span>
237 </span>
238 </td>
239 <td>
240 <?php
241 if ($withdraw_history->status !== 'approved' && isset($status_message[$withdraw_history->status])) {
242 ?>
243 <span class="tutor-status-text-container">
244 <span class="tool-tip-container">
245 <img src="<?php echo $image_base; ?>info-icon.svg" />
246 <span class="tooltip tip-left" role="tooltip">
247 <?php echo $status_message[$withdraw_history->status]; ?>
248 </span>
249 </span>
250 </span>
251 <?php
252 }
253 ?>
254 </td>
255 </tr>
256 <?php
257 }
258 ?>
259 </tbody>
260 </table>
261 <?php
262 } else {
263 ?>
264 <p><?php _e('No withdrawal yet', 'tutor'); ?></p>
265 <?php
266 }
267 ?>
268 </div>
269 </div>