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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
earning 7 years ago enrolled-courses 7 years ago instructor 7 years ago reviews 7 years ago settings 7 years ago withdraw-method-fields 7 years ago dashboard.php 7 years ago earning.php 7 years ago enrolled-courses.php 7 years ago index.php 7 years ago logged-in.php 7 years ago my-courses.php 7 years ago my-profile.php 7 years ago purchase_history.php 7 years ago quiz-attempts.php 7 years ago registration.php 7 years ago reviews.php 7 years ago settings.php 7 years ago wishlist.php 7 years ago withdraw.php 7 years ago
withdraw.php
273 lines
1 <?php
2 $earning_sum = tutor_utils()->get_earning_sum();
3 $min_withdraw = tutor_utils()->get_option('min_withdraw_amount');
4
5 $saved_account = tutor_utils()->get_user_withdraw_method();
6 $withdraw_method_name = tutor_utils()->avalue_dot('withdraw_method_name', $saved_account);
7
8 $user_id = get_current_user_id();
9 ?>
10
11 <div class="tutor-dashboard-content-inner">
12
13 <div class="withdraw-page-current-balance">
14 <h4><?php _e('Current Balance', 'tutor'); ?></h4>
15
16 <div class="withdraw-balance-row">
17
18 <?php
19 $balance_formatted = tutor_utils()->tutor_price($earning_sum->balance);
20 if ($earning_sum->balance >= $min_withdraw){
21 ?>
22 <p class="withdraw-balance-col">
23 <?php echo sprintf( __('You currently have %s %s %s ready to withdraw', 'tutor'), "<strong class='available_balance'>", $balance_formatted, '</strong>' ); ?>
24 </p>
25
26 <?php if ($withdraw_method_name) { ?>
27 <p><a class="open-withdraw-form-btn" href="javascript:;"><?php _e( 'Make a withdraw', 'tutor' ); ?></a></p>
28 <?php
29 }
30 }else{
31 ?>
32
33 <p class="withdraw-balance-col"> <?php echo sprintf( __('You currently have %s %s %s and this is insufficient balance to withdraw',
34 'tutor'), "<strong class='available_balance'>", $balance_formatted, '</strong>' ); ?>
35 </p>
36
37 <?php
38 }
39 ?>
40
41 </div>
42
43 <div class="current-withdraw-account-wrap">
44 <?php
45 if ($withdraw_method_name){
46 ?>
47 <p>
48 <?php _e('You will get paid by', 'tutor'); ?> <strong><?php echo $withdraw_method_name; ?></strong>
49 <?php
50 $my_profile_url = tutor_utils()->get_tutor_dashboard_page_permalink('settings/withdraw-settings');
51 echo sprintf(__( ', You can change your %s withdraw preference %s ' , 'tutor'), "<a href='{$my_profile_url}'>", '</a>' );
52 ?>
53 </p>
54 <?php
55 }else{
56 ?>
57 <p>
58 <?php
59 $my_profile_url = tutor_utils()->get_tutor_dashboard_page_permalink('my-profile');
60 echo sprintf(__( 'Please add your %s withdraw preference %s to make withdraw' , 'tutor'), "<a href='{$my_profile_url}'>", '</a>' );
61 ?>
62 </p>
63 <?php
64 }
65 ?>
66 </div>
67
68 </div>
69
70 <?php
71 if ($earning_sum->balance >= $min_withdraw && $withdraw_method_name){
72 ?>
73
74 <div class="tutor-earning-withdraw-form-wrap" style="display: none;">
75
76 <form id="tutor-earning-withdraw-form" action="" method="post">
77 <?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
78 <input type="hidden" value="tutor_make_an_withdraw" name="action"/>
79 <?php do_action('tutor_withdraw_form_before'); ?>
80 <div class="withdraw-form-field-row">
81 <label for="tutor_withdraw_amount"><?php _e('Amount:', 'tutor') ?></label>
82 <div class="tutor-row">
83 <div class="tutor-col-4">
84 <div class="withdraw-form-field-amount">
85 <input type="text" name="tutor_withdraw_amount">
86 </div>
87 </div>
88 <div class="tutor-col">
89 <div class="withdraw-form-field-button">
90 <button class="tutor-btn" type="submit" id="tutor-earning-withdraw-btn" name="withdraw-form-submit"><?php _e('Withdraw', 'tutor'); ?></button>
91 </div>
92 </div>
93 </div>
94 <i><?php _e('Enter withdraw amount and click withdraw button', 'tutor') ?></i>
95 </div>
96
97 <div id="tutor-withdraw-form-response"></div>
98
99 <?php do_action('tutor_withdraw_form_after'); ?>
100 </form>
101
102 </div>
103
104 <?php
105 }
106 ?>
107
108
109 <?php
110 $withdraw_pending_histories = tutor_utils()->get_withdrawals_history(null, array('status' => array('pending')));
111 $withdraw_completed_histories = tutor_utils()->get_withdrawals_history(null, array('status' => array('approved')));
112 $withdraw_rejected_histories = tutor_utils()->get_withdrawals_history(null, array('status' => array('rejected')));
113 ?>
114
115 <div class="withdraw-history-table-wrap">
116 <div class="withdraw-history-table-title">
117 <h4> <?php _e('Pending Withdrawals', 'tutor'); ?></h4>
118 </div>
119
120 <?php
121 if (tutor_utils()->count($withdraw_pending_histories->results)){
122 ?>
123 <table class="withdrawals-history">
124 <thead>
125 <tr>
126 <th><?php _e('Amount', 'tutor') ?></th>
127 <th><?php _e('Withdraw Method', 'tutor') ?></th>
128 <th><?php _e('Date', 'tutor') ?></th>
129 </tr>
130 </thead>
131 <?php
132 foreach ($withdraw_pending_histories->results as $withdraw_history){
133 ?>
134 <tr>
135 <td><?php echo tutor_utils()->tutor_price($withdraw_history->amount); ?></td>
136 <td>
137 <?php
138 $method_data = maybe_unserialize($withdraw_history->method_data);
139 echo tutor_utils()->avalue_dot('withdraw_method_name', $method_data)
140 ?>
141 </td>
142 <td>
143 <?php
144 echo date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($withdraw_history->created_at));
145 ?>
146 </td>
147 </tr>
148 <?php
149 }
150 ?>
151 </table>
152 <?php
153 }else{
154 ?>
155 <p><?php _e('No withdrawals pending yet', 'tutor'); ?></p>
156 <?php
157 }
158 ?>
159 </div>
160
161 <div class="withdraw-history-table-wrap">
162 <div class="withdraw-history-table-title">
163 <h4> <?php _e('Completed Withdrawals', 'tutor'); ?></h4>
164 </div>
165
166 <?php
167 if (tutor_utils()->count($withdraw_completed_histories->results)){
168 ?>
169 <table class="withdrawals-history">
170 <thead>
171 <tr>
172 <th><?php _e('Amount', 'tutor') ?></th>
173 <th><?php _e('Withdraw Method', 'tutor') ?></th>
174 <th><?php _e('Requested At', 'tutor') ?></th>
175 <th><?php _e('Approved At', 'tutor') ?></th>
176 </tr>
177 </thead>
178 <?php
179 foreach ($withdraw_completed_histories->results as $withdraw_history){
180 ?>
181 <tr>
182 <td><?php echo tutor_utils()->tutor_price($withdraw_history->amount); ?></td>
183 <td>
184 <?php
185 $method_data = maybe_unserialize($withdraw_history->method_data);
186 echo tutor_utils()->avalue_dot('withdraw_method_name', $method_data)
187 ?>
188 </td>
189 <td>
190 <?php
191 echo date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($withdraw_history->created_at));
192 ?>
193 </td>
194
195 <td>
196 <?php
197 if ($withdraw_history->updated_at){
198 echo date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($withdraw_history->updated_at));
199 }
200 ?>
201 </td>
202 </tr>
203 <?php
204 }
205 ?>
206 </table>
207 <?php
208 }else{
209 ?>
210 <p><?php _e('No withdrawals completed yet', 'tutor'); ?></p>
211 <?php
212 }
213 ?>
214 </div>
215
216
217 <div class="withdraw-history-table-wrap">
218 <div class="withdraw-history-table-title">
219 <h4> <?php _e('Rejected Withdrawals', 'tutor'); ?></h4>
220 </div>
221
222 <?php
223 if (tutor_utils()->count($withdraw_rejected_histories->results)){
224 ?>
225 <table class="withdrawals-history">
226 <thead>
227 <tr>
228 <th><?php _e('Amount', 'tutor') ?></th>
229 <th><?php _e('Withdraw Method', 'tutor') ?></th>
230 <th><?php _e('Requested At', 'tutor') ?></th>
231 <th><?php _e('Rejected At', 'tutor') ?></th>
232 </tr>
233 </thead>
234 <?php
235 foreach ($withdraw_rejected_histories->results as $withdraw_history){
236 ?>
237 <tr>
238 <td><?php echo tutor_utils()->tutor_price($withdraw_history->amount); ?></td>
239 <td>
240 <?php
241 $method_data = maybe_unserialize($withdraw_history->method_data);
242 echo tutor_utils()->avalue_dot('withdraw_method_name', $method_data)
243 ?>
244 </td>
245 <td>
246 <?php
247 echo date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($withdraw_history->created_at));
248 ?>
249 </td>
250
251 <td>
252 <?php
253 if ($withdraw_history->updated_at){
254 echo date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($withdraw_history->updated_at));
255 }
256 ?>
257 </td>
258 </tr>
259 <?php
260 }
261 ?>
262 </table>
263 <?php
264 }else{
265 ?>
266 <p><?php _e('No withdrawals rejected yet', 'tutor'); ?></p>
267 <?php
268 }
269 ?>
270 </div>
271
272
273 </div>