| 1 |
<table class="widefat striped"> |
| 2 |
<thead> |
| 3 |
<tr> |
| 4 |
<th></th> |
| 5 |
<th><?php |
| 6 |
|
| 7 |
use SpringDevs\Subscription\Illuminate\Helper; |
| 8 |
|
| 9 |
esc_html_e( 'Started on', 'sdevs_subscrpt' ); ?></th> |
| 10 |
<th><?php esc_html_e( 'Recurring', 'sdevs_subscrpt' ); ?></th> |
| 11 |
<th><?php esc_html_e( 'Expiry date', 'sdevs_subscrpt' ); ?></th> |
| 12 |
<th><?php esc_html_e( 'Status', 'sdevs_subscrpt' ); ?></th> |
| 13 |
</tr> |
| 14 |
</thead> |
| 15 |
<tbody> |
| 16 |
<?php |
| 17 |
foreach ( $histories as $history ) : |
| 18 |
$order_item_id = get_post_meta( $history->subscription_id, '_subscrpt_order_item_id', true ); |
| 19 |
$order_item = $order->get_item( $history->order_item_id ); |
| 20 |
$price = get_post_meta( $history->subscription_id, '_subscrpt_price', true ); |
| 21 |
$trial = get_post_meta( $history->subscription_id, '_subscrpt_trial', true ); |
| 22 |
$start_date = get_post_meta( $history->subscription_id, '_subscrpt_start_date', true ); |
| 23 |
$next_date = get_post_meta( $history->subscription_id, '_subscrpt_next_date', true ); |
| 24 |
$status_object = get_post_status_object( get_post_status( $history->subscription_id ) ); |
| 25 |
?> |
| 26 |
<tr> |
| 27 |
<td> |
| 28 |
<a href="<?php echo esc_html( get_edit_post_link( $history->subscription_id ) ); ?>" target="_blank">#<?php echo esc_html( $history->subscription_id ); ?> - <?php echo esc_html( $order_item->get_name() ); ?></a> |
| 29 |
</td> |
| 30 |
<td> |
| 31 |
<?php echo null == $trial ? ( ! empty( $start_date ) ? esc_html( gmdate( 'F d, Y', $start_date ) ) : '-' ) : '+' . esc_html( $trial ) . ' ' . __( 'free trial', 'sdevs_subscrpt' ); ?> |
| 32 |
</td> |
| 33 |
<td><?php echo wp_kses_post( Helper::format_price_with_order_item( $price, $order_item->get_id() ) ); ?></td> |
| 34 |
<td><?php echo esc_html( ! empty( $start_date ) && ! empty( $next_date ) ? ( $trial == null ? gmdate( 'F d, Y', $next_date ) : gmdate( 'F d, Y', $start_date ) ) : '-' ); ?></td> |
| 35 |
<td><span class="subscrpt-<?php echo esc_attr( $status_object->name ); ?>"><?php echo esc_html( $status_object->label ); ?></span></td> |
| 36 |
</tr> |
| 37 |
<?php |
| 38 |
endforeach; |
| 39 |
?> |
| 40 |
</tbody> |
| 41 |
</table> |
| 42 |
|