PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.1.2
GiveWP – Donation Plugin and Fundraising Platform v2.1.2
4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / includes / admin / payments / view-payment-details.php
give / includes / admin / payments Last commit date
actions.php 8 years ago class-payments-table.php 8 years ago payments-history.php 8 years ago view-payment-details.php 8 years ago
view-payment-details.php
890 lines
1 <?php
2 /**
3 * View Donation Details
4 *
5 * @package Give
6 * @subpackage Admin/Payments
7 * @copyright Copyright (c) 2016, WordImpress
8 * @license https://opensource.org/licenses/gpl-license GNU Public License
9 * @since 1.0
10 */
11
12 // Exit if accessed directly.
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 if ( ! current_user_can( 'view_give_payments' ) ) {
18 wp_die(
19 __( 'Sorry, you are not allowed to access this page.', 'give' ), __( 'Error', 'give' ), array(
20 'response' => 403,
21 )
22 );
23 }
24
25 /**
26 * View donation details page
27 *
28 * @since 1.0
29 * @return void
30 */
31 if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) {
32 wp_die( __( 'Donation ID not supplied. Please try again.', 'give' ), __( 'Error', 'give' ), array( 'response' => 400 ) );
33 }
34
35 // Setup the variables
36 $payment_id = absint( $_GET['id'] );
37 $payment = new Give_Payment( $payment_id );
38
39 // Sanity check... fail if donation ID is invalid
40 $payment_exists = $payment->ID;
41 if ( empty( $payment_exists ) ) {
42 wp_die( __( 'The specified ID does not belong to a donation. Please try again.', 'give' ), __( 'Error', 'give' ), array( 'response' => 400 ) );
43 }
44
45 $number = $payment->number;
46 $payment_meta = $payment->get_meta();
47
48 $company_name = ! empty( $payment_meta['_give_donation_company'] ) ? esc_attr( $payment_meta['_give_donation_company'] ) : '';
49 $transaction_id = esc_attr( $payment->transaction_id );
50 $user_id = $payment->user_id;
51 $donor_id = $payment->customer_id;
52 $payment_date = strtotime( $payment->date );
53 $user_info = give_get_payment_meta_user_info( $payment_id );
54 $address = $payment->address;
55 $currency_code = $payment->currency;
56 $gateway = $payment->gateway;
57 $currency_code = $payment->currency;
58 $payment_mode = $payment->mode;
59 $base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' );
60
61 ?>
62 <div class="wrap give-wrap">
63
64 <h1 id="transaction-details-heading" class="wp-heading-inline">
65 <?php
66 printf(
67 /* translators: %s: donation number */
68 esc_html__( 'Donation %s', 'give' ),
69 $number
70 );
71 if ( $payment_mode == 'test' ) {
72 echo Give()->tooltips->render_span(array(
73 'label' => __( 'This donation was made in test mode.', 'give' ),
74 'tag_content' => __( 'Test Donation', 'give' ),
75 'position'=> 'right',
76 'attributes' => array(
77 'id' => 'test-payment-label',
78 'class' => 'give-item-label give-item-label-orange'
79 )
80 ));
81 }
82 ?>
83 </h1>
84
85 <?php
86 /**
87 * Fires in donation details page, before the page content and after the H1 title output.
88 *
89 * @since 1.0
90 *
91 * @param int $payment_id Payment id.
92 */
93 do_action( 'give_view_donation_details_before', $payment_id );
94 ?>
95
96 <hr class="wp-header-end">
97
98 <form id="give-edit-order-form" method="post">
99 <?php
100 /**
101 * Fires in donation details page, in the form before the order details.
102 *
103 * @since 1.0
104 *
105 * @param int $payment_id Payment id.
106 */
107 do_action( 'give_view_donation_details_form_top', $payment_id );
108 ?>
109 <div id="poststuff">
110 <div id="give-dashboard-widgets-wrap">
111 <div id="post-body" class="metabox-holder columns-2">
112 <div id="postbox-container-1" class="postbox-container">
113 <div id="side-sortables" class="meta-box-sortables ui-sortable">
114
115 <?php
116 /**
117 * Fires in donation details page, before the sidebar.
118 *
119 * @since 1.0
120 *
121 * @param int $payment_id Payment id.
122 */
123 do_action( 'give_view_donation_details_sidebar_before', $payment_id );
124 ?>
125
126 <div id="give-order-update" class="postbox give-order-data">
127
128 <div class="give-order-top">
129 <h3 class="hndle"><?php _e( 'Update Donation', 'give' ); ?></h3>
130
131 <?php
132 if ( current_user_can( 'view_give_payments' ) ) {
133 echo sprintf(
134 '<span class="delete-donation" id="delete-donation-%d"><a class="delete-single-donation delete-donation-button dashicons dashicons-trash" href="%s" aria-label="%s"></a></span>',
135 $payment_id,
136 wp_nonce_url(
137 add_query_arg(
138 array(
139 'give-action' => 'delete_payment',
140 'purchase_id' => $payment_id,
141 ), $base_url
142 ), 'give_donation_nonce'
143 ),
144 sprintf( __( 'Delete Donation %s', 'give' ), $payment_id )
145 );
146 }
147 ?>
148 </div>
149
150 <div class="inside">
151 <div class="give-admin-box">
152
153 <?php
154 /**
155 * Fires in donation details page, before the sidebar update-payment metabox.
156 *
157 * @since 1.0
158 *
159 * @param int $payment_id Payment id.
160 */
161 do_action( 'give_view_donation_details_totals_before', $payment_id );
162 ?>
163
164 <div class="give-admin-box-inside">
165 <p>
166 <label for="give-payment-status" class="strong"><?php _e( 'Status:', 'give' ); ?></label>&nbsp;
167 <select id="give-payment-status" name="give-payment-status" class="medium-text">
168 <?php foreach ( give_get_payment_statuses() as $key => $status ) : ?>
169 <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option>
170 <?php endforeach; ?>
171 </select>
172 <span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span>
173 </p>
174 </div>
175
176 <div class="give-admin-box-inside">
177 <p>
178 <label for="give-payment-date" class="strong"><?php _e( 'Date:', 'give' ); ?></label>&nbsp;
179 <input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr( date( 'm/d/Y', $payment_date ) ); ?>" class="medium-text give_datepicker"/>
180 </p>
181 </div>
182
183 <div class="give-admin-box-inside">
184 <p>
185 <label for="give-payment-time-hour" class="strong"><?php _e( 'Time:', 'give' ); ?></label>&nbsp;
186 <input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
187 <input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/>
188 </p>
189 </div>
190
191 <?php
192 /**
193 * Fires in donation details page, in the sidebar update-payment metabox.
194 *
195 * Allows you to add new inner items.
196 *
197 * @since 1.0
198 *
199 * @param int $payment_id Payment id.
200 */
201 do_action( 'give_view_donation_details_update_inner', $payment_id );
202 ?>
203
204 <div class="give-order-payment give-admin-box-inside">
205 <p>
206 <label for="give-payment-total" class="strong"><?php _e( 'Total Donation:', 'give' ); ?></label>&nbsp;
207 <?php echo give_currency_symbol( $payment->currency ); ?>
208 &nbsp;<input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr( give_format_decimal( give_donation_amount( $payment_id ), false, false ) ); ?>"/>
209 </p>
210 </div>
211
212 <?php
213 /**
214 * Fires in donation details page, after the sidebar update-donation metabox.
215 *
216 * @since 1.0
217 *
218 * @param int $payment_id Payment id.
219 */
220 do_action( 'give_view_donation_details_totals_after', $payment_id );
221 ?>
222
223 </div>
224 <!-- /.give-admin-box -->
225
226 </div>
227 <!-- /.inside -->
228
229 <div class="give-order-update-box give-admin-box">
230 <?php
231 /**
232 * Fires in donation details page, before the sidebar update-payment metabox actions buttons.
233 *
234 * @since 1.0
235 *
236 * @param int $payment_id Payment id.
237 */
238 do_action( 'give_view_donation_details_update_before', $payment_id );
239 ?>
240
241 <div id="major-publishing-actions">
242 <div id="publishing-action">
243
244 <input type="submit" class="button button-primary right"
245 value="<?php _e( 'Save Donation', 'give' ); ?>"/>
246
247 <?php
248 if ( give_is_payment_complete( $payment_id ) ) {
249 echo sprintf(
250 '<a href="%1$s" id="give-resend-receipt" class="button-secondary right">%2$s</a>',
251 esc_url(
252 add_query_arg(
253 array(
254 'give-action' => 'email_links',
255 'purchase_id' => $payment_id,
256 )
257 )
258 ),
259 __( 'Resend Receipt', 'give' )
260 );
261 }
262 ?>
263 </div>
264 <div class="clear"></div>
265 </div>
266 <?php
267 /**
268 * Fires in donation details page, after the sidebar update-payment metabox actions buttons.
269 *
270 * @since 1.0
271 *
272 * @param int $payment_id Payment id.
273 */
274 do_action( 'give_view_donation_details_update_after', $payment_id );
275 ?>
276
277 </div>
278 <!-- /.give-order-update-box -->
279
280 </div>
281 <!-- /#give-order-data -->
282
283 <div id="give-order-details" class="postbox give-order-data">
284
285 <h3 class="hndle"><?php _e( 'Donation Meta', 'give' ); ?></h3>
286
287 <div class="inside">
288 <div class="give-admin-box">
289
290 <?php
291 /**
292 * Fires in donation details page, before the donation-meta metabox.
293 *
294 * @since 1.0
295 *
296 * @param int $payment_id Payment id.
297 */
298 do_action( 'give_view_donation_details_payment_meta_before', $payment_id );
299
300 $gateway = give_get_payment_gateway( $payment_id );
301 if ( $gateway ) :
302 ?>
303 <div class="give-order-gateway give-admin-box-inside">
304 <p>
305 <strong><?php _e( 'Gateway:', 'give' ); ?></strong>&nbsp;
306 <?php echo give_get_gateway_admin_label( $gateway ); ?>
307 </p>
308 </div>
309 <?php endif; ?>
310
311 <div class="give-order-payment-key give-admin-box-inside">
312 <p>
313 <strong><?php _e( 'Key:', 'give' ); ?></strong>&nbsp;
314 <?php echo give_get_payment_key( $payment_id ); ?>
315 </p>
316 </div>
317
318 <div class="give-order-ip give-admin-box-inside">
319 <p>
320 <strong><?php _e( 'IP:', 'give' ); ?></strong>&nbsp;
321 <?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?>
322 </p>
323 </div>
324
325 <?php
326 // Display the transaction ID present.
327 // The transaction ID is the charge ID from the gateway.
328 // For instance, stripe "ch_BzvwYCchqOy5Nt".
329 if ( $transaction_id != $payment_id ) : ?>
330 <div class="give-order-tx-id give-admin-box-inside">
331 <p>
332 <strong><?php _e( 'Transaction ID:', 'give' ); ?> <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo sprintf( esc_attr__( 'The transaction ID within %s.', 'give' ), $gateway); ?>"></span></strong>&nbsp;
333 <?php echo apply_filters( "give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id ); ?>
334 </p>
335 </div>
336 <?php endif; ?>
337
338 <div class="give-admin-box-inside">
339 <p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( give_get_payment_donor_id( $payment_id ) ) ); ?>
340 <a href="<?php echo $purchase_url; ?>"><?php _e( 'View all donations for this donor &raquo;', 'give' ); ?></a>
341 </p>
342 </div>
343
344 <?php
345 /**
346 * Fires in donation details page, after the donation-meta metabox.
347 *
348 * @since 1.0
349 *
350 * @param int $payment_id Payment id.
351 */
352 do_action( 'give_view_donation_details_payment_meta_after', $payment_id );
353 ?>
354
355 </div>
356 <!-- /.column-container -->
357
358 </div>
359 <!-- /.inside -->
360
361 </div>
362 <!-- /#give-order-data -->
363
364 <?php
365 /**
366 * Fires in donation details page, after the sidebar.
367 *
368 * @since 1.0
369 *
370 * @param int $payment_id Payment id.
371 */
372 do_action( 'give_view_donation_details_sidebar_after', $payment_id );
373 ?>
374
375 </div>
376 <!-- /#side-sortables -->
377 </div>
378 <!-- /#postbox-container-1 -->
379
380 <div id="postbox-container-2" class="postbox-container">
381
382 <div id="normal-sortables" class="meta-box-sortables ui-sortable">
383
384 <?php
385 /**
386 * Fires in donation details page, before the main area.
387 *
388 * @since 1.0
389 *
390 * @param int $payment_id Payment id.
391 */
392 do_action( 'give_view_donation_details_main_before', $payment_id );
393 ?>
394
395 <?php $column_count = 'columns-3'; ?>
396 <div id="give-donation-overview" class="postbox <?php echo $column_count; ?>">
397 <h3 class="hndle"><?php _e( 'Donation Information', 'give' ); ?></h3>
398
399 <div class="inside">
400
401 <div class="column-container">
402 <div class="column">
403 <p>
404 <strong><?php _e( 'Donation Form ID:', 'give' ); ?></strong><br>
405 <?php
406 if ( $payment_meta['form_id'] ) :
407 printf(
408 '<a href="%1$s">%2$s</a>',
409 admin_url( 'post.php?action=edit&post=' . $payment_meta['form_id'] ),
410 $payment_meta['form_id']
411 );
412 endif;
413 ?>
414 </p>
415 <p>
416 <strong><?php esc_html_e( 'Donation Form Title:', 'give' ); ?></strong><br>
417 <?php
418 echo Give()->html->forms_dropdown(
419 array(
420 'selected' => $payment_meta['form_id'],
421 'name' => 'give-payment-form-select',
422 'id' => 'give-payment-form-select',
423 'chosen' => true,
424 'placeholder' => '',
425 )
426 );
427 ?>
428 </p>
429 </div>
430 <div class="column">
431 <p>
432 <strong><?php _e( 'Donation Date:', 'give' ); ?></strong><br>
433 <?php echo date_i18n( give_date_format(), $payment_date ); ?>
434 </p>
435 <p>
436 <strong><?php _e( 'Donation Level:', 'give' ); ?></strong><br>
437 <span class="give-donation-level">
438 <?php
439 $var_prices = give_has_variable_prices( $payment_meta['form_id'] );
440 if ( empty( $var_prices ) ) {
441 _e( 'n/a', 'give' );
442 } else {
443 $prices_atts = array();
444 if ( $variable_prices = give_get_variable_prices( $payment_meta['form_id'] ) ) {
445 foreach ( $variable_prices as $variable_price ) {
446 $prices_atts[ $variable_price['_give_id']['level_id'] ] = give_format_amount( $variable_price['_give_amount'], array( 'sanitize' => false ) );
447 }
448 }
449 // Variable price dropdown options.
450 $variable_price_dropdown_option = array(
451 'id' => $payment_meta['form_id'],
452 'name' => 'give-variable-price',
453 'chosen' => true,
454 'show_option_all' => '',
455 'show_option_none' => ( '' === get_post_meta( $payment_id, '_give_payment_price_id', true ) ? __( 'None', 'give' ) : '' ),
456 'select_atts' => 'data-prices=' . esc_attr( wp_json_encode( $prices_atts ) ),
457 'selected' => $payment_meta['price_id'],
458 );
459 // Render variable prices select tag html.
460 give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
461 }
462 ?>
463 </span>
464 </p>
465 </div>
466 <div class="column">
467 <p>
468 <strong><?php esc_html_e( 'Total Donation:', 'give' ); ?></strong><br>
469 <?php echo give_donation_amount( $payment, true ); ?>
470 </p>
471
472 <p>
473 <?php
474 /**
475 * Fires in donation details page, in the donation-information metabox, before the head elements.
476 *
477 * Allows you to add new TH elements at the beginning.
478 *
479 * @since 1.0
480 *
481 * @param int $payment_id Payment id.
482 */
483 do_action( 'give_donation_details_thead_before', $payment_id );
484
485
486 /**
487 * Fires in donation details page, in the donation-information metabox, after the head elements.
488 *
489 * Allows you to add new TH elements at the end.
490 *
491 * @since 1.0
492 *
493 * @param int $payment_id Payment id.
494 */
495 do_action( 'give_donation_details_thead_after', $payment_id );
496
497 /**
498 * Fires in donation details page, in the donation-information metabox, before the body elements.
499 *
500 * Allows you to add new TD elements at the beginning.
501 *
502 * @since 1.0
503 *
504 * @param int $payment_id Payment id.
505 */
506 do_action( 'give_donation_details_tbody_before', $payment_id );
507
508 /**
509 * Fires in donation details page, in the donation-information metabox, after the body elements.
510 *
511 * Allows you to add new TD elements at the end.
512 *
513 * @since 1.0
514 *
515 * @param int $payment_id Payment id.
516 */
517 do_action( 'give_donation_details_tbody_after', $payment_id );
518 ?>
519 </p>
520 </div>
521 </div>
522
523 </div>
524 <!-- /.inside -->
525
526 </div>
527 <!-- /#give-donation-overview -->
528
529 <?php
530 /**
531 * Fires on the donation details page.
532 *
533 * @since 1.0
534 *
535 * @param int $payment_id Payment id.
536 */
537 do_action( 'give_view_donation_details_donor_detail_before', $payment_id );
538 ?>
539
540 <div id="give-donor-details" class="postbox">
541 <h3 class="hndle"><?php _e( 'Donor Details', 'give' ); ?></h3>
542
543 <div class="inside">
544
545 <?php $donor = new Give_Donor( $donor_id ); ?>
546
547 <div class="column-container donor-info">
548 <div class="column">
549 <p>
550 <strong><?php _e( 'Donor ID:', 'give' ); ?></strong><br>
551 <?php
552 if ( ! empty( $donor->id ) ) {
553 printf(
554 '<a href="%1$s">%2$s</a>',
555 admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ),
556 $donor->id
557 );
558 }
559 ?>
560 <span>(<a href="#new" class="give-payment-new-donor"><?php _e( 'Create New Donor', 'give' ); ?></a>)</span>
561 </p>
562 <p>
563 <strong><?php _e( 'Donor Since:', 'give' ); ?></strong><br>
564 <?php echo date_i18n( give_date_format(), strtotime( $donor->date_created ) ) ?>
565 </p>
566 </div>
567 <div class="column">
568 <p>
569 <strong><?php _e( 'Donor Name:', 'give' ); ?></strong><br>
570 <?php
571 $donor_billing_name = give_get_donor_name_by( $payment_id, 'donation' );
572 $donor_name = give_get_donor_name_by( $donor_id, 'donor' );
573
574 // Check whether the donor name and WP_User name is same or not.
575 if ( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ) {
576 echo $donor_billing_name . ' (<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id" ) ) . '">' . $donor_name . '</a>)';
577 } else {
578 echo $donor_name;
579 }
580 ?>
581 </p>
582 <p>
583 <strong><?php _e( 'Donor Email:', 'give' ); ?></strong><br>
584 <?php echo $donor->email; ?>
585 </p>
586 </div>
587 <div class="column">
588 <p>
589 <strong><?php _e( 'Change Donor:', 'give' ); ?></strong><br>
590 <?php
591 echo Give()->html->donor_dropdown(
592 array(
593 'selected' => $donor->id,
594 'name' => 'donor-id',
595 )
596 );
597 ?>
598 </p>
599 <p>
600 <?php if ( ! empty( $company_name ) ) {
601 ?>
602 <strong><?php esc_html_e( 'Company Name:', 'give' ); ?></strong><br>
603 <?php
604 echo $company_name;
605 } ?>
606 </p>
607 </div>
608 </div>
609
610 <div class="column-container new-donor" style="display: none">
611 <div class="column">
612 <p>
613 <label for="give-new-donor-first-name"><?php _e( 'New Donor First Name:', 'give' ); ?></label>
614 <input id="give-new-donor-first-name" type="text" name="give-new-donor-first-name" value="" class="medium-text"/>
615 </p>
616 </div>
617 <div class="column">
618 <p>
619 <label for="give-new-donor-last-name"><?php _e( 'New Donor Last Name:', 'give' ); ?></label>
620 <input id="give-new-donor-last-name" type="text" name="give-new-donor-last-name" value="" class="medium-text"/>
621 </p>
622 </div>
623 <div class="column">
624 <p>
625 <label for="give-new-donor-email"><?php _e( 'New Donor Email:', 'give' ); ?></label>
626 <input id="give-new-donor-email" type="email" name="give-new-donor-email" value="" class="medium-text"/>
627 </p>
628 </div>
629 <div class="column">
630 <p>
631 <input type="hidden" name="give-current-donor" value="<?php echo $donor->id; ?>"/>
632 <input type="hidden" id="give-new-donor" name="give-new-donor" value="0"/>
633 <a href="#cancel" class="give-payment-new-donor-cancel give-delete"><?php _e( 'Cancel', 'give' ); ?></a>
634 <br>
635 <em><?php _e( 'Click "Save Donation" to create new donor.', 'give' ); ?></em>
636 </p>
637 </div>
638 </div>
639 <?php
640 /**
641 * Fires on the donation details page, in the donor-details metabox.
642 *
643 * The hook is left here for backwards compatibility.
644 *
645 * @since 1.7
646 *
647 * @param array $payment_meta Payment meta.
648 * @param array $user_info User information.
649 */
650 do_action( 'give_payment_personal_details_list', $payment_meta, $user_info );
651
652 /**
653 * Fires on the donation details page, in the donor-details metabox.
654 *
655 * @since 1.7
656 *
657 * @param int $payment_id Payment id.
658 */
659 do_action( 'give_payment_view_details', $payment_id );
660 ?>
661
662 </div>
663 <!-- /.inside -->
664 </div>
665 <!-- /#give-donor-details -->
666
667 <?php
668 /**
669 * Fires on the donation details page, before the billing metabox.
670 *
671 * @since 1.0
672 *
673 * @param int $payment_id Payment id.
674 */
675 do_action( 'give_view_donation_details_billing_before', $payment_id );
676 ?>
677
678 <div id="give-billing-details" class="postbox">
679 <h3 class="hndle"><?php _e( 'Billing Address', 'give' ); ?></h3>
680
681 <div class="inside">
682
683 <div id="give-order-address">
684
685 <div class="order-data-address">
686 <div class="data column-container">
687
688 <?php
689 $address['country'] = ( ! empty( $address['country'] ) ? $address['country'] : give_get_country() );
690
691 $address['state'] = ( ! empty( $address['state'] ) ? $address['state'] : '' );
692
693 // Get the country list that does not have any states init.
694 $no_states_country = give_no_states_country_list();
695 ?>
696
697 <div class="row">
698 <div id="give-order-address-country-wrap">
699 <label class="order-data-address-line"><?php _e( 'Country:', 'give' ); ?></label>
700 <?php
701 echo Give()->html->select(
702 array(
703 'options' => give_get_country_list(),
704 'name' => 'give-payment-address[0][country]',
705 'selected' => $address['country'],
706 'show_option_all' => false,
707 'show_option_none' => false,
708 'chosen' => true,
709 'placeholder' => esc_attr__( 'Select a country', 'give' ),
710 'data' => array( 'search-type' => 'no_ajax' ),
711 )
712 );
713 ?>
714 </div>
715 </div>
716
717 <div class="row">
718 <div class="give-wrap-address-line1">
719 <label for="give-payment-address-line1" class="order-data-address"><?php _e( 'Address 1:', 'give' ); ?></label>
720 <input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/>
721 </div>
722 </div>
723
724 <div class="row">
725 <div class="give-wrap-address-line2">
726 <label for="give-payment-address-line2" class="order-data-address-line"><?php _e( 'Address 2:', 'give' ); ?></label>
727 <input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/>
728 </div>
729 </div>
730
731 <div class="row">
732 <div class="give-wrap-address-city">
733 <label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label>
734 <input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/>
735 </div>
736 </div>
737
738 <?php
739 $state_exists = ( ! empty( $address['country'] ) && array_key_exists( $address['country'], $no_states_country ) ? true : false );
740 ?>
741 <div class="row">
742 <div class="<?php echo( ! empty( $state_exists ) ? 'column-full' : 'column' ); ?> give-column give-column-state">
743 <div id="give-order-address-state-wrap" class="<?php echo( ! empty( $state_exists ) ? 'give-hidden' : '' ); ?>">
744 <label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province / County:', 'give' ); ?></label>
745 <?php
746 $states = give_get_states( $address['country'] );
747 if ( ! empty( $states ) ) {
748 echo Give()->html->select(
749 array(
750 'options' => $states,
751 'name' => 'give-payment-address[0][state]',
752 'selected' => $address['state'],
753 'show_option_all' => false,
754 'show_option_none' => false,
755 'chosen' => true,
756 'placeholder' => esc_attr__( 'Select a state', 'give' ),
757 'data' => array( 'search-type' => 'no_ajax' ),
758 )
759 );
760 } else {
761 ?>
762 <input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/>
763 <?php
764 }
765 ?>
766 </div>
767 </div>
768
769 <div class="<?php echo( ! empty( $state_exists ) ? 'column-full' : 'column' ); ?> give-column give-column-zip">
770 <div class="give-wrap-address-zip">
771 <label for="give-payment-address-zip" class="order-data-address-line"><?php _e( 'Zip / Postal Code:', 'give' ); ?></label>
772 <input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/>
773 </div>
774 </div>
775 </div>
776 </div>
777 </div>
778 </div>
779 <!-- /#give-order-address -->
780
781 <?php
782 /**
783 * Fires in donation details page, in the billing metabox, after all the fields.
784 *
785 * Allows you to insert new billing address fields.
786 *
787 * @since 1.7
788 *
789 * @param int $payment_id Payment id.
790 */
791 do_action( 'give_payment_billing_details', $payment_id );
792 ?>
793
794 </div>
795 <!-- /.inside -->
796 </div>
797 <!-- /#give-billing-details -->
798
799 <?php
800 /**
801 * Fires on the donation details page, after the billing metabox.
802 *
803 * @since 1.0
804 *
805 * @param int $payment_id Payment id.
806 */
807 do_action( 'give_view_donation_details_billing_after', $payment_id );
808 ?>
809
810 <div id="give-payment-notes" class="postbox">
811 <h3 class="hndle"><?php _e( 'Donation Notes', 'give' ); ?></h3>
812
813 <div class="inside">
814 <div id="give-payment-notes-inner">
815 <?php
816 $notes = give_get_payment_notes( $payment_id );
817 if ( ! empty( $notes ) ) {
818 $no_notes_display = ' style="display:none;"';
819 foreach ( $notes as $note ) :
820
821 echo give_get_payment_note_html( $note, $payment_id );
822
823 endforeach;
824 } else {
825 $no_notes_display = '';
826 }
827
828 echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No donation notes.', 'give' ) . '</p>';
829 ?>
830 </div>
831 <textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea>
832
833 <div class="give-clearfix">
834 <button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php _e( 'Add Note', 'give' ); ?></button>
835 </div>
836
837 </div>
838 <!-- /.inside -->
839 </div>
840 <!-- /#give-payment-notes -->
841
842 <?php
843 /**
844 * Fires on the donation details page, after the main area.
845 *
846 * @since 1.0
847 *
848 * @param int $payment_id Payment id.
849 */
850 do_action( 'give_view_donation_details_main_after', $payment_id );
851 ?>
852
853 </div>
854 <!-- /#normal-sortables -->
855 </div>
856 <!-- #postbox-container-2 -->
857 </div>
858 <!-- /#post-body -->
859 </div>
860 <!-- #give-dashboard-widgets-wrap -->
861 </div>
862 <!-- /#post-stuff -->
863
864 <?php
865 /**
866 * Fires in donation details page, in the form after the order details.
867 *
868 * @since 1.0
869 *
870 * @param int $payment_id Payment id.
871 */
872 do_action( 'give_view_donation_details_form_bottom', $payment_id );
873
874 wp_nonce_field( 'give_update_payment_details_nonce' );
875 ?>
876 <input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/>
877 <input type="hidden" name="give_action" value="update_payment_details"/>
878 </form>
879 <?php
880 /**
881 * Fires in donation details page, after the order form.
882 *
883 * @since 1.0
884 *
885 * @param int $payment_id Payment id.
886 */
887 do_action( 'give_view_donation_details_after', $payment_id );
888 ?>
889 </div><!-- /.wrap -->
890