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