 pronamic    /
                    wp-pronamic-ideal
                      pronamic    /
                    wp-pronamic-ideal
                
                            | 1 | <?php | ||
| 2 | /** | ||
| 3 | * Meta Box Subscription Payments | ||
| 4 | * | ||
| 5 | * @author Pronamic <[email protected]> | ||
| 6 | * @copyright 2005-2019 Pronamic | ||
| 7 | * @license GPL-3.0-or-later | ||
| 8 | * @package Pronamic\WordPress\Pay | ||
| 9 | */ | ||
| 10 | |||
| 11 | $post_id = get_the_ID(); | ||
| 12 | |||
| 13 | if ( empty( $post_id ) ) { | ||
| 14 | return; | ||
| 15 | } | ||
| 16 | |||
| 17 | $post_type = get_post_type( $post_id ); | ||
| 18 | |||
| 19 | $subscription = get_pronamic_subscription( $post_id ); | ||
| 20 | |||
| 21 | $payments = $subscription->get_payments(); | ||
| 22 | |||
| 23 | ?> | ||
| 24 | |||
| 25 | <?php if ( empty( $payments ) ) : ?> | ||
| 26 | |||
| 27 | <?php esc_html_e( 'No payments found.', 'pronamic_ideal' ); ?> | ||
| 28 | |||
| 29 | <?php else : ?> | ||
| 30 | |||
| 31 | <table class="pronamic-pay-table widefat"> | ||
| 32 | <thead> | ||
| 33 | <tr> | ||
| 34 | <th scope="col"> | ||
| 35 | <span class="pronamic-pay-tip pronamic-pay-icon pronamic-pay-status" title="<?php esc_attr_e( 'Status', 'pronamic_ideal' ); ?>"><?php esc_html_e( 'Status', 'pronamic_ideal' ); ?></span> | ||
| 36 | </th> | ||
| 37 | <th scope="col"><?php esc_html_e( 'Payment', 'pronamic_ideal' ); ?></th> | ||
| 38 | <th scope="col"><?php esc_html_e( 'Transaction', 'pronamic_ideal' ); ?></th> | ||
| 39 | <th scope="col"><?php esc_html_e( 'Amount', 'pronamic_ideal' ); ?></th> | ||
| 40 | <th scope="col"><?php esc_html_e( 'Date', 'pronamic_ideal' ); ?></th> | ||
| 41 | <th scope="col"><?php esc_html_e( 'Start Date', 'pronamic_ideal' ); ?></th> | ||
| 42 | <th scope="col"><?php esc_html_e( 'End Date', 'pronamic_ideal' ); ?></th> | ||
| 43 | </tr> | ||
| 44 | </thead> | ||
| 45 | |||
| 46 | <tbody> | ||
| 47 | |||
| 48 | <?php foreach ( $payments as $payment ) : ?> | ||
| 49 | |||
| 50 | <?php | ||
| 51 | |||
| 52 | $payment_id = $payment->get_id(); | ||
| 53 | $post_type = get_post_type( $payment_id ); | ||
| 54 | |||
| 55 | ?> | ||
| 56 | |||
| 57 | <tr> | ||
| 58 | <td> | ||
| 59 | <?php do_action( 'manage_' . $post_type . '_posts_custom_column', 'pronamic_payment_status', $payment_id ); ?> | ||
| 0 ignored issues–
                            show             Bug
    
    
    
        introduced 
                            by  
  Loading history... | |||
| 60 | </td> | ||
| 61 | <td> | ||
| 62 | <?php do_action( 'manage_' . $post_type . '_posts_custom_column', 'pronamic_payment_title', $payment_id ); ?> | ||
| 63 | </td> | ||
| 64 | <td> | ||
| 65 | <?php do_action( 'manage_' . $post_type . '_posts_custom_column', 'pronamic_payment_transaction', $payment_id ); ?> | ||
| 66 | </td> | ||
| 67 | <td> | ||
| 68 | <?php do_action( 'manage_' . $post_type . '_posts_custom_column', 'pronamic_payment_amount', $payment_id ); ?> | ||
| 69 | </td> | ||
| 70 | <td> | ||
| 71 | <?php do_action( 'manage_' . $post_type . '_posts_custom_column', 'pronamic_payment_date', $payment_id ); ?> | ||
| 72 | </td> | ||
| 73 | <td> | ||
| 74 | <?php echo empty( $payment->start_date ) ? '—' : esc_html( $payment->start_date->format_i18n() ); ?> | ||
| 75 | </td> | ||
| 76 | <td> | ||
| 77 | <?php echo empty( $payment->end_date ) ? '—' : esc_html( $payment->end_date->format_i18n() ); ?> | ||
| 78 | </td> | ||
| 79 | </tr> | ||
| 80 | |||
| 81 | <?php endforeach; ?> | ||
| 82 | |||
| 83 | </tbody> | ||
| 84 | </table> | ||
| 85 | |||
| 86 | <?php endif; ?> | ||
| 87 | 
