Function Reference: geodir_payment_invoices_page_content

Summary

This function has not been documented yet.

Filters

‘geodir_payment_user_invoices_per_page’ [Line: 1605]

Source Code

function geodir_payment_invoices_page_content( $is_ajax = false ) {
$user_id = get_current_user_id();

if ( !$user_id ) {
$login_url = geodir_login_url( array( ‘redirect_to’ => urlencode( geodir_curPageURL() ) ) );

if ( !headers_sent() ) {
wp_redirect( $login_url );
exit;
} else {
echo ‘‘;
}

return false;
}

if ( !$is_ajax ) {
geodir_payment_add_invoice_scripts();
}

$pageno = isset($_REQUEST[‘pageno’]) ? (int)$_REQUEST[‘pageno’] : 1;

$per_page = 10;
$per_page = apply_filters(‘geodir_payment_user_invoices_per_page’, $per_page);

$args = array();
$args[‘filter’] = array( ‘user_id’ => $user_id );
$args[‘per_page’] = $per_page;
$args[‘pageno’] = $pageno;
$args[‘order_by’] = ‘date_updated DESC’;
$args[‘count_only’] = true;

$total_invoices = geodir_payment_user_invoices( $args );

$args[‘count_only’] = false;
$args[‘total’] = $total_invoices;
$invoices = $total_invoices ? geodir_payment_user_invoices( $args ) : array();

ob_start();
?>


id;
$date = $invoice->date_updated != ‘0000-00-00 00:00:00’ ? $invoice->date_updated : $invoice->date;
$date = $date != ‘0000-00-00 00:00:00’ ? $date : ”;
$date_display = $date != ” ? date_i18n( geodir_default_date_format(), strtotime( $date ) ) : ”;

$amount = geodir_payment_price( $invoice->paied_amount );

$inv_status = $invoice->status;
if ( in_array( geodir_strtolower( $inv_status ), array( ‘paid’, ‘active’, ‘subscription-payment’, ‘free’ ) ) ) {
$inv_status = ‘confirmed’;
} else if ( in_array( geodir_strtolower( $inv_status ), array( ‘unpaid’ ) ) ) {
$inv_status = ‘pending’;
}
$incomplete = $inv_status == ‘pending’ && empty($invoice->paymentmethod) ? true : false;

$status_text = geodir_payment_status_name( $inv_status );
if ($incomplete && $inv_status == ‘pending’) {
$status_text = __(‘Incomplete’, ‘geodir_payments’);
}

$payment_method_title = geodir_payment_method_title( $invoice->paymentmethod );
$payment_method_text = $payment_method_title != ” ? ‘‘ . wp_sprintf( ‘Via %s’, $payment_method_title ). ‘‘ : ”;

$title_meta = geodir_payment_invoice_info_title_meta( $invoice );
$status_meta = geodir_payment_invoice_info_status_meta( $invoice );

$invoice_details = geodir_payment_invoice_view_details( $invoice );

$invoice_nonce = wp_create_nonce( ‘gd_invoice_nonce_’ . $invoice_id );
?>

post_title; ?>



” data-status=”status; ?>” style=”display:none”>

0 ) { ?>