PluginProbe
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More / 1.0.2
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More v1.0.2
2.4.1 2.4.0 2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.2 2.1.1 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 All 68 releases
better-payment / includes / Admin / views / template-transaction-list.php

template-transaction-list.php in Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More 1.0.2, at includes/Admin/views/template-transaction-list.php

160 lines 9.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * Transactions parial content
4 * All undefined vars comes from 'render_better_payment_admin_pages' method
5 * $bp_admin_all_transactions : contains all values
6 */
7
8 use Better_Payment\Lite\Classes\Better_Payment_Helper;
9
10 ?>
11
12 <?php
13 $transaction_filter_paged = !empty($args['paged']) ? $args['paged'] : 1;
14 $transaction_filter_per_page = !empty($args['per_page']) ? $args['per_page'] : 20;
15 ?>
16
17 <div class="transaction-table-wrapper">
18 <div class="transactions">
19 <!-- Hidden Fields Start -->
20 <div class="hidden-fields">
21 <input type="hidden" name="paged" class="paged" value="<?php echo esc_attr($transaction_filter_paged); ?>">
22 <input type="hidden" name="per_page1" class="per-page1" value="<?php echo esc_attr($transaction_filter_per_page); ?>">
23 <input type="hidden" name="total_entry" class="total-entry" value="<?php echo esc_attr($bp_admin_all_transactions_count); ?>">
24 <input type="hidden" name="completed_entry" class="completed-entry" value="<?php echo esc_attr($bp_admin_completed_transactions_count); ?>">
25 <input type="hidden" name="incomplete_entry" class="incomplete-entry" value="<?php echo esc_attr($bp_admin_incomplete_transactions_count); ?>">
26 </div>
27 <!-- Hidden Fields End -->
28
29 <div class="transaction__table mb30">
30 <div class="table__row row__head">
31 <div class="table__col col__head col__name">
32 <p><?php esc_html_e('Name', 'better-payment'); ?></p>
33 </div>
34 <div class="table__col col__head col__email">
35 <p><?php esc_html_e('Email Address', 'better-payment'); ?></p>
36 </div>
37 <div class="table__col col__head col__amount">
38 <p><?php esc_html_e('Amount', 'better-payment'); ?></p>
39 </div>
40 <div class="table__col col__head col__trans">
41 <p><?php esc_html_e('Transaction ID', 'better-payment'); ?></p>
42 </div>
43 <div class="table__col col__head col__source">
44 <p><?php esc_html_e('Source', 'better-payment'); ?></p>
45 </div>
46 <div class="table__col col__head col__status">
47 <p><?php esc_html_e('Status', 'better-payment'); ?></p>
48 </div>
49 <div class="table__col col__head col__amount">
50 <p><?php esc_html_e('Date', 'better-payment'); ?></p>
51 </div>
52 <div class="table__col col__head col__action">
53 <p><?php esc_html_e('Action', 'better-payment'); ?></p>
54 </div>
55 </div>
56
57 <?php $bp_txn_counter = 0; ?>
58
59 <?php foreach ($bp_admin_all_transactions as $bp_transaction) : ?>
60 <?php $bp_txn_counter++; ?>
61 <?php $bp_customer_info = maybe_unserialize($bp_transaction->customer_info); //obj
62 ?>
63 <?php $bp_form_fields_info = maybe_unserialize($bp_transaction->form_fields_info); //array
64 ?>
65
66 <?php
67 $bp_transaction_customer_name = isset($bp_form_fields_info['primary_first_name']) ? sanitize_text_field($bp_form_fields_info['primary_first_name']) : '';
68 $bp_transaction_customer_name .= ' ';
69 $bp_transaction_customer_name .= isset($bp_form_fields_info['primary_last_name']) ? sanitize_text_field($bp_form_fields_info['primary_last_name']) : '';
70
71 //legacy
72 if( empty($bp_transaction_customer_name) || $bp_transaction_customer_name == ' ' ){
73 $bp_transaction_customer_name = isset($bp_form_fields_info['first_name']) ? sanitize_text_field($bp_form_fields_info['first_name']) : '';
74 $bp_transaction_customer_name .= ' ';
75 $bp_transaction_customer_name .= isset($bp_form_fields_info['last_name']) ? sanitize_text_field($bp_form_fields_info['last_name']) : '';
76 }
77
78 $bp_transaction_customer_email = isset($bp_form_fields_info['primary_email']) ? sanitize_text_field($bp_form_fields_info['primary_email']) : '';
79 //legacy
80 if( empty($bp_transaction_customer_email) ){
81 $bp_transaction_customer_email = isset($bp_form_fields_info['email']) ? sanitize_text_field($bp_form_fields_info['email']) : '';
82 }
83 ?>
84
85 <div class="table__row">
86 <div class="table__col col__name">
87 <p> <?php echo esc_html($bp_transaction_customer_name); ?> </p>
88 </div>
89 <div class="table__col col__email">
90 <p> <?php echo esc_html($bp_transaction_customer_email); ?> </p>
91 </div>
92 <div class="table__col col__amount">
93 <p> <?php echo esc_html($bp_transaction->currency) . ' ' . esc_html($bp_transaction->amount); ?> </p>
94 </div>
95 <div class="table__col col__trans">
96 <?php $bp_transaction_id = sanitize_text_field($bp_transaction->transaction_id); ?>
97
98 <?php if( !empty($bp_transaction_id) ) : ?>
99 <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 esc_html_e('Copy', 'better-payment'); ?>" data-bp_txn_counter="<?php echo esc_attr($bp_txn_counter); ?>" ></span> </p>
100 <?php endif; ?>
101 </div>
102 <div class="table__col col__source">
103 <p> <?php echo esc_html($bp_transaction->source); ?> </p>
104 </div>
105 <div class="table__col col__status">
106 <?php
107 $bp_transaction_status_for_color = $bp_transaction->status ? sanitize_text_field($bp_transaction->status) : '';
108 $bp_helper_obj = new Better_Payment_Helper();
109 $bp_transaction_status_color = $bp_helper_obj->get_color_by_transaction_status($bp_transaction_status_for_color, 'v2');
110 $td_status_btn_text_v2 = $bp_helper_obj->get_type_by_transaction_status($bp_transaction_status_for_color, 'v2');
111
112 $bp_transaction_status = $bp_transaction->status ? sanitize_text_field($bp_transaction->status) : esc_html__('N/A', 'better-payment');
113 ?>
114 <p class="" data-id="<?php echo esc_attr($bp_transaction->id) ?>"> <span style="color:#fff; padding:7px 15px; border-radius: 20px;background: <?php echo esc_attr($bp_transaction_status_color); ?>"><?php echo esc_html(ucfirst($td_status_btn_text_v2)); //$bp_transaction_status ?></span> </p>
115 </div>
116 <div class="table__col col__amount">
117 <?php $bp_payment_date = sanitize_text_field($bp_transaction->payment_date); ?>
118 <?php $bp_payment_date = wp_date(get_option('date_format').' '.get_option('time_format'), strtotime($bp_payment_date)); ?>
119 <p> <?php echo esc_html($bp_payment_date); ?> </p>
120 </div>
121 <div class="table__col col__action action-buttons">
122 <a href='<?php echo esc_url(admin_url("admin.php?page=better-payment-transactions&action=view&id={$bp_transaction->id}")); ?>' class="button button--sm view-button" data-id="<?php echo esc_attr($bp_transaction->id) ?>"><?php echo esc_html__('View', 'better-payment'); ?></a>
123 <button class="button button--sm delete-button" data-id="<?php echo esc_attr( $bp_transaction->id ); ?>"><?php echo esc_html__('Delete', 'better-payment'); ?></button>
124 </div>
125 </div>
126 <?php endforeach; ?>
127
128 <?php if (count($bp_admin_all_transactions) == 0) : ?>
129 <div class="table__row">
130 <div class="table__col col__name">
131 <p class="text-center"> <?php echo esc_html__('No records found!', 'better-payment'); ?> </p>
132 </div>
133 </div>
134 <?php endif; ?>
135 </div>
136 </div>
137
138 <!-- Pagination Starts -->
139 <div class="transaction-pagination pagination pt30">
140 <div class="bp-row">
141 <div class="bp-col-3">
142 <p class="showing-entities-html">
143 <select class="per-page" name="per_page" id="">
144 <option value="10" <?php 10 === $transaction_filter_per_page ? esc_attr_e('selected') : '' ?> ><?php esc_html_e('10', 'better-payment'); ?></option>
145 <option value="20" <?php 20 === $transaction_filter_per_page ? esc_attr_e('selected') : '' ?> ><?php esc_html_e('20', 'better-payment'); ?></option>
146 <option value="50" <?php 50 === $transaction_filter_per_page ? esc_attr_e('selected') : '' ?> ><?php esc_html_e('50', 'better-payment'); ?></option>
147 <option value="100" <?php 100 === $transaction_filter_per_page ? esc_attr_e('selected') : '' ?> ><?php esc_html_e('100', 'better-payment'); ?></option>
148 <option value="<?php echo esc_attr($bp_admin_all_transactions_count); ?>" <?php $bp_admin_all_transactions_count === $transaction_filter_per_page ? esc_attr_e('selected') : '' ?>>All</option>
149 </select>
150 <span><?php echo wp_kses( $paginations_showing_entities_html, wp_kses_allowed_html( 'post' ) ); ?></span>
151 </p>
152 </div>
153
154 <div class="bp-col-9">
155 <?php echo wp_kses( $bp_admin_all_transactions_paginations, wp_kses_allowed_html( 'post' ) ); ?>
156 </div>
157 </div>
158 </div>
159 <!-- Pagination Ends -->
160 </div>