| 1 |
<?php |
| 2 |
/* |
| 3 |
* Transactions parial content |
| 4 |
* All undefined vars comes from 'render_betterpayment_admin_pages' method |
| 5 |
* $bp_admin_all_transactions : contains all values |
| 6 |
*/ |
| 7 |
?> |
| 8 |
|
| 9 |
<?php |
| 10 |
$transaction_filter_paged = !empty($args['paged']) ? $args['paged'] : 1; |
| 11 |
$transaction_filter_per_page = !empty($args['per_page']) ? $args['per_page'] : 20; |
| 12 |
?> |
| 13 |
|
| 14 |
<div class="transaction-table-wrapper"> |
| 15 |
<div class="transactions"> |
| 16 |
<!-- Hidden Fields Start --> |
| 17 |
<div class="hidden-fields"> |
| 18 |
<input type="hidden" name="paged" class="paged" value="<?php echo esc_attr($transaction_filter_paged); ?>"> |
| 19 |
<input type="hidden" name="per_page" class="per-page" value="<?php echo esc_attr($transaction_filter_per_page); ?>"> |
| 20 |
<input type="hidden" name="total_entry" class="total-entry" value="<?php echo esc_attr($bp_admin_all_transactions_count); ?>"> |
| 21 |
</div> |
| 22 |
<!-- Hidden Fields End --> |
| 23 |
|
| 24 |
<div class="transaction__table mb30"> |
| 25 |
<div class="table__row row__head"> |
| 26 |
<div class="table__col col__head col__name"> |
| 27 |
<p><?php _e('Name', 'better-payment'); ?></p> |
| 28 |
</div> |
| 29 |
<div class="table__col col__head col__email"> |
| 30 |
<p><?php _e('Email Address', 'better-payment'); ?></p> |
| 31 |
</div> |
| 32 |
<div class="table__col col__head col__amount"> |
| 33 |
<p><?php _e('Amount', 'better-payment'); ?></p> |
| 34 |
</div> |
| 35 |
<div class="table__col col__head col__trans"> |
| 36 |
<p><?php _e('Transaction ID', 'better-payment'); ?></p> |
| 37 |
</div> |
| 38 |
<div class="table__col col__head col__source"> |
| 39 |
<p><?php _e('Source', 'better-payment'); ?></p> |
| 40 |
</div> |
| 41 |
<div class="table__col col__head col__status"> |
| 42 |
<p><?php _e('Status', 'better-payment'); ?></p> |
| 43 |
</div> |
| 44 |
<div class="table__col col__head col__amount"> |
| 45 |
<p><?php _e('Date', 'better-payment'); ?></p> |
| 46 |
</div> |
| 47 |
<div class="table__col col__head col__action"> |
| 48 |
<p><?php _e('Action', 'better-payment'); ?></p> |
| 49 |
</div> |
| 50 |
</div> |
| 51 |
|
| 52 |
<?php $bp_txn_counter = 0; ?> |
| 53 |
|
| 54 |
<?php foreach ($bp_admin_all_transactions as $bp_transaction) : ?> |
| 55 |
<?php $bp_txn_counter++; ?> |
| 56 |
<?php $bp_customer_info = maybe_unserialize($bp_transaction->customer_info); //obj |
| 57 |
?> |
| 58 |
<?php $bp_form_fields_info = maybe_unserialize($bp_transaction->form_fields_info); //array |
| 59 |
?> |
| 60 |
|
| 61 |
<?php |
| 62 |
$bp_transaction_customer_name = is_object($bp_customer_info) && isset($bp_form_fields_info['first_name']) ? sanitize_text_field($bp_form_fields_info['first_name']) : ''; |
| 63 |
$bp_transaction_customer_name .= ' '; |
| 64 |
$bp_transaction_customer_name .= is_object($bp_customer_info) && isset($bp_form_fields_info['last_name']) ? sanitize_text_field($bp_form_fields_info['last_name']) : ''; |
| 65 |
?> |
| 66 |
|
| 67 |
<div class="table__row"> |
| 68 |
<div class="table__col col__name"> |
| 69 |
<p> <?php echo esc_html($bp_transaction_customer_name); ?> </p> |
| 70 |
</div> |
| 71 |
<div class="table__col col__email"> |
| 72 |
<p> <?php echo esc_html($bp_transaction->email); ?> </p> |
| 73 |
</div> |
| 74 |
<div class="table__col col__amount"> |
| 75 |
<p> <?php echo esc_html($bp_transaction->currency) . ' ' . esc_html($bp_transaction->amount); ?> </p> |
| 76 |
</div> |
| 77 |
<div class="table__col col__trans"> |
| 78 |
<?php $bp_transaction_id = sanitize_text_field($bp_transaction->transaction_id); ?> |
| 79 |
|
| 80 |
<?php if( !empty($bp_transaction_id) ) : ?> |
| 81 |
<p> <span id="bp_copy_clipboard_input_<?php echo esc_html($bp_txn_counter); ?>"><?php echo esc_html($bp_transaction_id); ?></span> <span id="bp_copy_clipboard_<?php echo esc_attr($bp_txn_counter); ?>" class="bp-icon bp-copy-square bp-copy-clipboard" title="<?php _e('Copy', 'better-payment'); ?>" data-bp_txn_counter="<?php echo esc_attr($bp_txn_counter); ?>" ></span> </p> |
| 82 |
<?php endif; ?> |
| 83 |
</div> |
| 84 |
<div class="table__col col__source"> |
| 85 |
<p> <?php echo esc_html($bp_transaction->source); ?> </p> |
| 86 |
</div> |
| 87 |
<div class="table__col col__status"> |
| 88 |
<?php |
| 89 |
$bp_transaction_status = $bp_transaction->status ? sanitize_text_field($bp_transaction->status) : __('N/A', 'better-payment'); |
| 90 |
$bp_transaction_status_color = $bp_transaction_status == 'paid' ? 'color__primary ' : 'color__danger'; |
| 91 |
$bp_transaction_status_color = $bp_transaction_status == 'N/A' ? 'color__warning' : $bp_transaction_status_color; |
| 92 |
?> |
| 93 |
<p class="<?php echo esc_attr($bp_transaction_status_color); ?>" data-id="<?php echo esc_attr($bp_transaction->id) ?>"> <?php echo esc_html(ucfirst($bp_transaction_status)); ?> </p> |
| 94 |
</div> |
| 95 |
<div class="table__col col__amount"> |
| 96 |
<?php $bp_payment_date = sanitize_text_field($bp_transaction->payment_date); ?> |
| 97 |
<?php $bp_payment_date = wp_date(get_option('date_format'), strtotime($bp_payment_date)); ?> |
| 98 |
<p> <?php echo esc_html($bp_payment_date); ?> </p> |
| 99 |
</div> |
| 100 |
<div class="table__col col__action action-buttons"> |
| 101 |
<a href='<?php echo esc_url(admin_url("admin.php?page=betterpayment-transactions&action=view&id={$bp_transaction->id}")); ?>' class="button button--sm view-button" data-id="<?php echo esc_attr($bp_transaction->id) ?>"><?php echo __('View', 'better-payment'); ?></a> |
| 102 |
</div> |
| 103 |
</div> |
| 104 |
<?php endforeach; ?> |
| 105 |
|
| 106 |
<?php if (count($bp_admin_all_transactions) == 0) : ?> |
| 107 |
<div class="table__row"> |
| 108 |
<div class="table__col col__name"> |
| 109 |
<p class="text-center"> <?php echo __('No records found!', 'better-payment'); ?> </p> |
| 110 |
</div> |
| 111 |
</div> |
| 112 |
<?php endif; ?> |
| 113 |
</div> |
| 114 |
</div> |
| 115 |
|
| 116 |
<!-- Pagination Starts --> |
| 117 |
<div class="transaction-pagination pagination pt30"> |
| 118 |
<div class="bp-row"> |
| 119 |
<div class="bp-col-3"> |
| 120 |
<p class="showing-entities-html"><?php echo wp_kses( $paginations_showing_entities_html, wp_kses_allowed_html( 'post' ) ); ?></p> |
| 121 |
</div> |
| 122 |
|
| 123 |
<div class="bp-col-9"> |
| 124 |
<?php echo wp_kses( $bp_admin_all_transactions_paginations, wp_kses_allowed_html( 'post' ) ); ?> |
| 125 |
</div> |
| 126 |
</div> |
| 127 |
</div> |
| 128 |
<!-- Pagination Ends --> |
| 129 |
</div> |