/**
 * Payment History Page
 *
 * Renders the payment history page contents.
 *
 * @access      private
 * @since       1.0
 * @return      void
*/
function edd_payment_history_page() {
	$edd_payment = get_post_type_object( 'edd_payment' );

	if ( isset( $_GET['view'] ) && 'view-order-details' == $_GET['view'] ) {
		require_once EDD_PLUGIN_DIR . 'includes/admin/payments/view-order-details.php';
	} else {
		require_once EDD_PLUGIN_DIR . 'includes/admin/payments/class-payments-table.php';
		$payments_table = new EDD_Payment_History_Table();
		$payments_table->prepare_items();
	?>
	<div class="wrap">
		<h2><?php echo $edd_payment->labels->menu_name ?></h2>
		<?php do_action( 'edd_payments_page_top' ); ?>
		<form id="edd-payments-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=download&page=edd-payment-history' ); ?>">
			<input type="hidden" name="post_type" value="download" />
			<input type="hidden" name="page" value="edd-payment-history" />

			<?php $payments_table->views() ?>

			<?php $payments_table->advanced_filters(); ?>
			
			<?php $payments_table->display() ?>
		</form>
		<?php do_action( 'edd_payments_page_bottom' ); ?>
	</div>
<?php
	}
}
/**
 * Payment History Page
 *
 * Renders the payment history page contents.
 *
 * @access      private
 * @since       1.0
 * @return      void
*/
function edd_payment_history_page()
{
    global $edd_options;
    if (isset($_GET['edd-action']) && 'edit-payment' == $_GET['edd-action']) {
        require_once EDD_PLUGIN_DIR . 'includes/admin/payments/edit-payment.php';
    } elseif (isset($_GET['edd-action']) && 'view-order-details' == $_GET['edd-action']) {
        require_once EDD_PLUGIN_DIR . 'includes/admin/payments/view-order-details.php';
    } else {
        require_once EDD_PLUGIN_DIR . 'includes/admin/payments/class-payments-table.php';
        $payments_table = new EDD_Payment_History_Table();
        $payments_table->prepare_items();
        ?>
	<div class="wrap">
		<h2><?php 
        _e('Payment History', 'edd');
        ?>
</h2>
		<?php 
        do_action('edd_payments_page_top');
        ?>
		<form id="edd-payments-filter" method="get" action="<?php 
        echo admin_url('edit.php?post_type=download&page=edd-payment-history');
        ?>
">
			<?php 
        $payments_table->search_box(__('Search', 'edd'), 'edd-payments');
        ?>

			<input type="hidden" name="post_type" value="download" />
			<input type="hidden" name="page" value="edd-payment-history" />

			<?php 
        $payments_table->views();
        ?>

			<?php 
        $payments_table->display();
        ?>
		</form>
		<?php 
        do_action('edd_payments_page_bottom');
        ?>

		<p class="edd-mobile-link">
			<a href="https://easydigitaldownloads.com/extension/ios-sales-earnings-tracker/" target="_blank">
				<img src="<?php 
        echo EDD_PLUGIN_URL . 'assets/images/icons/iphone.png';
        ?>
"/>
				<?php 
        _e('Get the EDD Sales / Earnings tracker for iOS', 'edd');
        ?>
			</a>
		</p>

	</div>
<?php 
    }
}
/**
 * Payment History Page
 *
 * Renders the payment history page contents.
 *
 * @access      private
 * @since       1.0
 * @return      void
*/
function edd_payment_history_page()
{
    global $edd_options;
    if (isset($_GET['edd-action']) && $_GET['edd-action'] == 'edit-payment') {
        require_once EDD_PLUGIN_DIR . '/includes/admin/payments/edit-payment.php';
    } else {
        require_once EDD_PLUGIN_DIR . 'includes/admin/payments/class-payments-table.php';
        $payments_table = new EDD_Payment_History_Table();
        $payments_table->prepare_items();
        ?>
	<div class="wrap">
		<h2><?php 
        _e('Payment History', 'edd');
        ?>
</h2>
		<?php 
        do_action('edd_payments_page_top');
        ?>
		<form id="edd-payments-filter" method="get" action="<?php 
        echo admin_url('edit.php?post_type=download&page=edd-payment-history');
        ?>
">
	        <?php 
        $payments_table->search_box(__('Search', 'edd'), 'edd-payments');
        ?>

			<input type="hidden" name="post_type" value="download" />
	        <input type="hidden" name="page" value="edd-payment-history" />

	        <?php 
        $payments_table->views();
        ?>

	        <?php 
        $payments_table->display();
        ?>
	    </form>
		<?php 
        do_action('edd_payments_page_bottom');
        ?>
	</div>
<?php 
    }
}