<?php
/**
 * The public-facing functionality of the plugin.
 *
 * @link       https://makewebbetter.com/
 * @since      1.0.0
 *
 * @package    wps-wpr-points-log-template
 * @subpackage points-and-rewards-for-wooCommerce/public/partials
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

// Detect if Template Four is active so we can wrap with its design system.
$wps_wpr_log_other_settings  = get_option( 'wps_wpr_other_settings', array() );
$wps_wpr_log_active_template = ! empty( $wps_wpr_log_other_settings['wps_wpr_choose_account_page_temp'] ) ? $wps_wpr_log_other_settings['wps_wpr_choose_account_page_temp'] : '';
$wps_t4_log_is_active        = ( 'temp_four' === $wps_wpr_log_active_template );
$wps_t4_log_accent           = ! empty( $wps_wpr_log_other_settings['wps_wpr_points_tab_layout_color'] ) ? $wps_wpr_log_other_settings['wps_wpr_points_tab_layout_color'] : '#c89a3a';

if ( $wps_t4_log_is_active ) {
	$wps_t4_log_pts = (int) get_user_meta( isset( $user_ID ) ? $user_ID : get_current_user_id(), 'wps_wpr_points', true );
	?>
	<style>.wps-t4-wrap{--t4a:<?php echo esc_attr( $wps_t4_log_accent ); ?>;}</style>
	<div class="wps-t4-wrap wps-t4-log-wrap">
		<header class="wps-t4-page-header">
			<div class="wps-t4-ph-left">
				<p class="wps-t4-breadcrumb">
					<a href="<?php echo esc_url( wc_get_account_endpoint_url( 'points' ) ); ?>" style="color:inherit;text-decoration:none;">
						<?php esc_html_e( 'My account', 'points-and-rewards-for-woocommerce' ); ?> &middot; <?php esc_html_e( 'Rewards', 'points-and-rewards-for-woocommerce' ); ?>
					</a>
					&middot; <?php esc_html_e( 'Activity log', 'points-and-rewards-for-woocommerce' ); ?>
				</p>
				<h1 class="wps-t4-welcome"><?php esc_html_e( 'Activity log.', 'points-and-rewards-for-woocommerce' ); ?></h1>
			</div>
			<div class="wps-t4-ph-actions">
				<a href="<?php echo esc_url( wc_get_account_endpoint_url( 'points' ) ); ?>" class="wps-t4-btn wps-t4-btn--ghost">
					<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="19" y1="12" x2="5" y2="12"/><polyline points="12 19 5 12 12 5"/></svg>
					<?php esc_html_e( 'Back to Rewards', 'points-and-rewards-for-woocommerce' ); ?>
				</a>
			</div>
		</header>

		<!-- Balance summary card -->
		<div class="wps-t4-log-summary">
			<span class="wps-t4-log-summary-label"><?php esc_html_e( 'Current balance', 'points-and-rewards-for-woocommerce' ); ?></span>
			<span class="wps-t4-log-summary-pts"><?php echo esc_html( number_format( $wps_t4_log_pts ) ); ?></span>
			<span class="wps-t4-log-summary-unit"><?php esc_html_e( 'PTS', 'points-and-rewards-for-woocommerce' ); ?></span>
		</div>
	<?php
}

$user_id = $user_ID;
if ( isset( $user_id ) && null != $user_id && is_numeric( $user_id ) ) {
	$point_log    = get_user_meta( $user_id, 'points_details', true );
	$total_points = get_user_meta( $user_id, 'wps_wpr_points', true );
	if ( isset( $point_log ) && is_array( $point_log ) && null != $point_log ) {
		if ( ! $wps_t4_log_is_active ) { ?>
		<h2><?php esc_html_e( ' Point Log Table', 'points-and-rewards-for-woocommerce' ); ?></h2>
		<?php } ?><?php
		if ( array_key_exists( 'registration', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Signup Event', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<a class ="wps_wpr_open_toggle"  href="javascript:;"></a>
				<div class="wps_wpr_points_view"> 
					<table class="wps_wpr_common_table">
						<thead>
								<tr>
									<th class="wps-wpr-view-log-Date">
										<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
									</th>
									<th class="wps-wpr-view-log-Status">
										<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
									</th>
								</tr>
							</thead> 
						<?php
						foreach ( $point_log['registration'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $point_log['registration']['0']['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $point_log['registration']['0']['registration'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'refund_points_applied_on_cart', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points from the cart will be refunded after the order is canceled.', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<a class ="wps_wpr_open_toggle"  href="javascript:;"></a>
				<div class="wps_wpr_points_view"> 
					<table class="wps_wpr_common_table">
						<thead>
								<tr>
									<th class="wps-wpr-view-log-Date">
										<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
									</th>
									<th class="wps-wpr-view-log-Status">
										<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
									</th>
								</tr>
							</thead> 
						<?php
						foreach ( $point_log['refund_points_applied_on_cart'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['refund_points_applied_on_cart'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'guest_user_rewards_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Guest User Rewards Points', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<a class ="wps_wpr_open_toggle"  href="javascript:;"></a>
				<div class="wps_wpr_points_view"> 
					<table class="wps_wpr_common_table">
						<thead>
								<tr>
									<th class="wps-wpr-view-log-Date">
										<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
									</th>
									<th class="wps-wpr-view-log-Status">
										<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
									</th>
								</tr>
							</thead> 
						<?php
						foreach ( $point_log['guest_user_rewards_points'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['guest_user_rewards_points'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'Coupon_details', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Coupon generated through points', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view"> 
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['Coupon_details'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['Coupon_details'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'product_details', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Assigned Product Points', 'points-and-rewards-for-woocommerce' ); ?> <a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['product_details'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['product_details'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'pro_conversion_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Per Currency Earn Points', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php foreach ( $point_log['pro_conversion_points'] as $key => $value ) { ?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['pro_conversion_points'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'quiz_points_log', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Quiz contest Points', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php foreach ( $point_log['quiz_points_log'] as $key => $value ) { ?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['quiz_points_log'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'points_on_order', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points earned based on a specific order total range.', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php foreach ( $point_log['points_on_order'] as $key => $value ) { ?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['points_on_order'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'refund_points_on_order', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Return earned points based on a specific order total range when an order is refunded.', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php foreach ( $point_log['refund_points_on_order'] as $key => $value ) { ?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['refund_points_on_order'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'subscription_renewal_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Subscription Renewal Points', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php foreach ( $point_log['subscription_renewal_points'] as $key => $value ) { ?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['subscription_renewal_points'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'payment_methods_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Earn points through payment method', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php foreach ( $point_log['payment_methods_points'] as $key => $value ) { ?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['payment_methods_points'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'refund_payment_points_details', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points earned via payment method refunded', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php foreach ( $point_log['refund_payment_points_details'] as $key => $value ) { ?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['refund_payment_points_details'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'refund_subscription__renewal_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Refund Subscription Renewal Points', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php foreach ( $point_log['refund_subscription__renewal_points'] as $key => $value ) { ?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['refund_subscription__renewal_points'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'cancel_points_on_order_total', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Return earned points based on a specific order total range when an order is cancelled.', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php foreach ( $point_log['cancel_points_on_order_total'] as $key => $value ) { ?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['cancel_points_on_order_total'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'comment', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points earned by leaving a review or comment', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<a class ="wps_wpr_open_toggle"  href="javascript:;"></a>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
								<tr>
									<th class="wps-wpr-view-log-Date">
										<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
									</th>
									<th class="wps-wpr-view-log-Status">
										<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
									</th>
								</tr>
							</thead> 
						<?php
						foreach ( $point_log['comment'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['comment'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'membership', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points deducted for purchasing a membership plan.', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<a class ="wps_wpr_open_toggle"  href="javascript:;"></a>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['membership'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['membership'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'pur_by_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Deduction of points as you have purchased your product through points', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['pur_by_points'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['pur_by_points'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'deduction_of_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Deduct assigned product-earned points when an order is canceled', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['deduction_of_points'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['deduction_of_points'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'return_pur_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Return of points used for purchases through the points', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['return_pur_points'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?> </td>
								<td><?php echo '+' . esc_html( $value['return_pur_points'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'deduction_currency_spent', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Deduct earned points per currency on order return requests', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['deduction_currency_spent'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['deduction_currency_spent'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'cart_subtotal_point', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points Applied on Cart/Checkout', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['cart_subtotal_point'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['cart_subtotal_point'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'order__rewards_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Order Rewards Points', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['order__rewards_points'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['order__rewards_points'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'user_badges_rewards_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Earn Points and Unlock Higher Badge Levels!', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['user_badges_rewards_points'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['user_badges_rewards_points'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'membership_level_rewards_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Membership level rewards points', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['membership_level_rewards_points'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['membership_level_rewards_points'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'member_assign_rewards_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Membership Plugin Plan Associated rewards points', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Plan Name', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['member_assign_rewards_points'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['member_assign_rewards_points'] ); ?></td>
								<td><?php echo esc_html( $value['membership_name'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'refund_member_assign_rewards_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Membership Plugin Plan Associated rewards points refunded', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Plan Name', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['refund_member_assign_rewards_points'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['refund_member_assign_rewards_points'] ); ?></td>
								<td><?php echo esc_html( $value['membership_name'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'membership_level_points_refunded', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Membership level points refunded', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['membership_level_points_refunded'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['membership_level_points_refunded'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'wps_vendor_commissions_amount', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Vendor commission points', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Order No.', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['wps_vendor_commissions_amount'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['wps_vendor_commissions_amount'] ); ?></td>
								<td><?php echo esc_html( $value['order_id'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'game_claim_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Gamification Claim Points', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['game_claim_points'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['game_claim_points'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'award_points_on_previous_order', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points awarded on previous order', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Order No.', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['award_points_on_previous_order'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo esc_html( $value['award_points_on_previous_order'] ); ?></td>
								<td><?php echo esc_html( $value['order_no'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'api_membership_logs', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Membership updated via API', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['api_membership_logs'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['api_membership_logs'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'expired_details', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Oops!! Points are expired!', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['expired_details'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['expired_details'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div> 
			<?php
		}
		if ( array_key_exists( 'deduct_currency_pnt_cancel', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Per currency points deducted due to cancellation of order', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['deduct_currency_pnt_cancel'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['deduct_currency_pnt_cancel'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div> 
			<?php
		}
		if ( array_key_exists( 'deduct_bcz_cancel', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Assigned Points Deducted due Cancellation of Order', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['deduct_bcz_cancel'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['deduct_bcz_cancel'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div> 
			<?php
		}
		if ( array_key_exists( 'pur_points_cancel', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points refunded due to order cancellation for purchases through points only', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['pur_points_cancel'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['pur_points_cancel'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div> 
			<?php
		}
		// WPS CUSTOM CODE.
		if ( array_key_exists( 'pur_pro_pnt_only', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points deducted for purchases made using the Purchase Through Points Only', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['pur_pro_pnt_only'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['pur_pro_pnt_only'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div> 
			<?php
		}
		// END OF WPS CUSTOM CODE.
		if ( array_key_exists( 'Sender_point_details', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points successfully deducted for sharing your points with others', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Activity">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Shared to', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['Sender_point_details'] as $key => $value ) {
							$user_name = '';
							if ( isset( $value['given_to'] ) && ! empty( $value['given_to'] ) ) {
								$user      = get_user_by( 'ID', $value['given_to'] );
								if ( isset( $user ) && ! empty( $user ) ) {
									$user_name = $user->user_nicename;
								} else {
									$user_name = esc_html__( 'This user doesn\'t exist', 'points-and-rewards-for-woocommerce' );
								}
							}
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?> </td>
								<td><?php echo '-' . esc_html( $value['Sender_point_details'] ); ?></td>
								<td>
									<?php
									echo esc_html( $user_name );
									?>
								</td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>   
			<?php
		}
		if ( array_key_exists( 'Receiver_point_details', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points successfully received as someone has shared them with you', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Activity">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Received Points via ', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['Receiver_point_details'] as $key => $value ) {
							$user_name = '';
							if ( isset( $value['received_by'] ) && ! empty( $value['received_by'] ) ) {
								$user      = get_user_by( 'ID', $value['received_by'] );
								if ( isset( $user ) && ! empty( $user ) ) {
									$user_name = $user->user_nicename;
								} else {
									$user_name = esc_html__( 'This user doesn\'t exist', 'points-and-rewards-for-woocommerce' );
								}
							}
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['Receiver_point_details'] ); ?></td>
								<td>
									<?php
									echo esc_html( $user_name );
									?>
								</td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'admin_points', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Your points has been updated by Admin', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Activity">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Reason', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['admin_points'] as $key => $value ) {
							$sign            = isset( $value['sign'] ) ? $value['sign'] : '+';
							$value['reason'] = isset( $value['reason'] ) ? $value['reason'] : __( 'Updated By Admin', 'points-and-rewards-for-woocommerce' );
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo esc_html( $sign ) . esc_html( $value['admin_points'] ); ?></td>
								<td><?php echo esc_html( $value['reason'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'social_share_points_log', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'You have earned points for your actions in the social campaign', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Activity">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Reason', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['social_share_points_log'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['social_share_points_log'] ); ?></td>
								<td><?php echo esc_html( $value['social_heading'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'points_reset_by_admin', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points Reset By Admin', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['points_reset_by_admin'] as $key => $value ) {
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '-' . esc_html( $value['points_reset_by_admin'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'points_deduct_wallet', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider" ><?php esc_html_e( 'Points deducted and added to the wallet', 'points-and-rewards-for-woocommerce' ); ?>
					<a class ="wps_wpr_open_toggle"  href="javascript:;"></a>
				</p>
				<div class="wps_wpr_points_view">
					<table class = "form-table mwp_wpr_settings wps_wpr_points_view wps_wpr_common_table">
						<thead>
							<tr valign="top">
							<th scope="row" class="wps_wpr_head_titledesc">
								<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date & Time', 'points-and-rewards-for-woocommerce' ); ?></span>
							</th>
							<th scope="row" class="wps_wpr_head_titledesc">
								<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
							</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['points_deduct_wallet'] as $key => $value ) {
							?>
							<tr valign="top">
								<td class="forminp forminp-text"><?php echo esc_html( $value['date'] ); ?></td>
								<td class="forminp forminp-text"><?php echo '-' . esc_html( $value['points_deduct_wallet'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'reset_users_points_logs', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider" ><?php esc_html_e( 'Your points has been reset by Admin', 'points-and-rewards-for-woocommerce' ); ?>
					<a class ="wps_wpr_open_toggle"  href="javascript:;"></a>
				</p>
				<div class="wps_wpr_points_view">
					<table class = "form-table mwp_wpr_settings wps_wpr_points_view wps_wpr_common_table">
						<thead>
							<tr valign="top">
							<th scope="row" class="wps_wpr_head_titledesc">
								<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date & Time', 'points-and-rewards-for-woocommerce' ); ?></span>
							</th>
							<th scope="row" class="wps_wpr_head_titledesc">
								<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
							</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['reset_users_points_logs'] as $key => $value ) {
							?>
							<tr valign="top">
								<td class="forminp forminp-text"><?php echo esc_html( $value['date'] ); ?></td>
								<td class="forminp forminp-text"><?php echo '-' . esc_html( $value['reset_users_points_logs'] ); ?></td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'reference_details', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points earned for successfully referring someone!', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Activity">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Sign Up by', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['reference_details'] as $key => $value ) {
							$user_name = '';
							if ( count( $value['refered_user'] ) > 0 ) {

								$count     = count( $value['refered_user'] );
								$user_list = '';
								for ( $i = 0; $i < $count; $i++ ) {

									$user = get_user_by( 'ID', $value['refered_user'][ $i ]['refered_user'] );
									if ( isset( $user ) && ! empty( $user ) ) {
										if ( 0 == $i ) {

											if ( $count > 1 ) {

												$user_name = '<span class="wps_wpr_all_referral_name">' . $user->user_login . ' + ' . ( $count - 1 ) . ' More</span>';
											} else {

												$user_name = $user->user_login;
											}
										} else {

											$user_list .= $user->user_login . ', ';
										}
									} else {

										$user_name = esc_html__( 'This user doesn\'t exist', 'points-and-rewards-for-woocommerce' );
									}
								}

								if ( ! empty( $user_list ) ) {

									$user_name .= '<span class="wps_wpr_all_referral_view">' . rtrim( $user_list, ', ' ) . '</span>';
								}
							}
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['reference_details'] ); ?></td>
								<td>
									<?php
									if ( isset( $user ) && ! empty( $user ) ) {
										echo wp_kses_post( $user_name );
									} else {
										echo wp_kses_post( $user_name );
									}
									?>
								</td>
							</tr>
							<?php
						}
						?>
					</table>
				</div>
			</div>
			<?php
		}
		if ( array_key_exists( 'ref_product_detail', $point_log ) ) {
			?>
			<div class="wps_wpr_slide_toggle">
				<p class="wps_wpr_view_log_notice wps_wpr_common_slider"><?php esc_html_e( 'Points earned from a purchase made through your referral.', 'points-and-rewards-for-woocommerce' ); ?><a class ="wps_wpr_open_toggle"  href="javascript:;"></a></p>
				<div class="wps_wpr_points_view">
					<table class="wps_wpr_common_table">
						<thead>
							<tr>
								<th class="wps-wpr-view-log-Date">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Date', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Status">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Point Status', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
								<th class="wps-wpr-view-log-Activity">
									<span class="wps_wpr_nobr"><?php echo esc_html__( 'Product purchase by Referred User Points', 'points-and-rewards-for-woocommerce' ); ?></span>
								</th>
							</tr>
						</thead>
						<?php
						foreach ( $point_log['ref_product_detail'] as $key => $value ) {
							$user_name = '';
							if ( isset( $value['refered_user'] ) && ! empty( $value['refered_user'] ) ) {
								$user      = get_user_by( 'ID', $value['refered_user'] );
								if ( isset( $user ) && ! empty( $user ) ) {
									$user_name = $user->user_nicename;
								} else {
									$user_name = esc_html__( 'This user doesn\'t exist', 'points-and-rewards-for-woocommerce' );
								}
							}
							?>
							<tr>
								<td><?php echo esc_html( wps_wpr_set_the_wordpress_date_format( $value['date'] ) ); ?></td>
								<td><?php echo '+' . esc_html( $value['ref_product_detail'] ); ?></td>
								<td>
									<?php
									echo esc_html( $user_name );
									?>
								</td>
							</tr>
							<?php
						}
						?>

					</table>
				</div>
			</div> 
			<?php
		}
		do_action( 'wps_points_on_first_order', $point_log );

		?>
		<div class="wps_wpr_slide_toggle">
			<table class="wps_wpr_total_points">
				<tr>
					<td colspan="2"><h4><b><?php esc_html_e( 'Total Points', 'points-and-rewards-for-woocommerce' ); ?></b></h4></td>
					<td><h4><b><?php echo esc_html( $total_points ); ?></b></h4></td>
				</tr>        
			</table>
		</div>
		<?php
	} else {
		if ( $wps_t4_log_is_active ) {
			echo '<div class="wps-t4-log-empty"><svg width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg><p>' . esc_html__( 'No activity yet — start earning points to see your log here.', 'points-and-rewards-for-woocommerce' ) . '</p></div>';
		} else {
			echo '<h3>' . esc_html__( 'No Points Generated Yet.', 'points-and-rewards-for-woocommerce' ) . '<h3>';
		}
	}
}
if ( $wps_t4_log_is_active ) {
	echo '</div><!-- /.wps-t4-log-wrap -->';
}
?>
