Uname:Linux ip-11-115-0-196 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 10:54:48 UTC 2025 x86_64

403WebShell
403Webshell
Server IP : 13.126.101.145  /  Your IP : 216.73.217.87
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux ip-11-115-0-196 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 10:54:48 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 8.3.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/rentals_updated/wp-content/plugins/work-order/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/rentals_updated/wp-content/plugins/work-order/invoices-for-myaccount.php
<?php

// Add "Invoice" menu to WooCommerce My Account page
add_filter( 'woocommerce_account_menu_items', 'add_invoice_menu_item' );
function add_invoice_menu_item( $items ) {
    $items['invoices'] = __( 'Invoices');  // Adds a new menu item for Invoices
    return $items;
}

// Add endpoint for Invoices page
add_action( 'init', 'add_invoices_endpoint' );
function add_invoices_endpoint() {
    add_rewrite_endpoint( 'invoices', EP_PAGES );
}

// Display content for the Invoices page
add_action( 'woocommerce_account_invoices_endpoint', 'invoices_content' );
function invoices_content() {
    global $wpdb;

    // Fetch invoice data from the wp_order_invoice_details table
    $invoice_table = $wpdb->prefix . 'order_invoice_details'; // Dynamically get table name with prefix
    $invoices = $wpdb->get_results( "SELECT id, min_hour_billing,invoice_value,monthly_order_start_date,monthly_order_end_date FROM $invoice_table", OBJECT );

    // Start output buffer for table content
    ?>
    <h3><?php esc_html_e( 'Invoices' ); ?></h3>
    
    <table id="invoiceTable" class="woocommerce-orders-table woocommerce-MyAccount-orders shop_table shop_table_responsive my_account_orders account-orders-table">
    <thead>
        <tr>
            <th class="woocommerce-orders-table__header"><?php esc_html_e( 'Invoice ID' ); ?></th>
            <th class="woocommerce-orders-table__header"><?php esc_html_e( 'Equipement Name' ); ?></th>
            <th class="woocommerce-orders-table__header"><?php esc_html_e( 'Billed Hours' ); ?></th>
            <th class="woocommerce-orders-table__header"><?php esc_html_e( 'Invoice Value' ); ?></th>
            <th class="woocommerce-orders-table__header"><?php esc_html_e( 'Start Date' ); ?></th>
            <th class="woocommerce-orders-table__header"><?php esc_html_e( 'End Date' ); ?></th>
            <th class="woocommerce-orders-table__header"><?php esc_html_e( 'Invoice Status' ); ?></th>
            <th class="woocommerce-orders-table__header"><?php esc_html_e( 'Action' ); ?></th> <!-- New Action column -->
        </tr>
    </thead>
    <tbody>
        <?php if ( ! empty( $invoices ) ) : ?>
            <?php foreach ( $invoices as $invoice ) : ?>
                <tr>
                    <td class="woocommerce-orders-table__cell">#INV-<?php echo esc_html( $invoice->id ); ?></td>
                    <td class="woocommerce-orders-table__cell">822D SEM Track-Type Tractor</td>
                    <td class="woocommerce-orders-table__cell"><?php echo esc_html( $invoice->min_hour_billing ); ?> hours</td>
                    <td class="woocommerce-orders-table__cell"><?php echo esc_html( $invoice->invoice_value ); ?></td>
                    <td class="woocommerce-orders-table__cell"><?php echo esc_html( $invoice->monthly_order_start_date ); ?></td>
                    <td class="woocommerce-orders-table__cell"><?php echo esc_html( $invoice->monthly_order_end_date ); ?></td>
                    <td class="woocommerce-orders-table__cell"><?php esc_html_e( 'Pending' ); ?></td> <!-- Static "Pending" Status -->
                    <td class="woocommerce-orders-table__cell">
                        <!-- Always showing the Pay Bill button because the status is static "Pending" -->
                        <a href="#" class="button pay-bill"><?php esc_html_e( 'Pay Bill' ); ?></a>
                    </td>
                </tr>
            <?php endforeach; ?>
        <?php else : ?>
            <tr>
                <td colspan="8" class="woocommerce-orders-table__cell"><?php esc_html_e( 'No invoices found.' ); ?></td>
            </tr>
        <?php endif; ?>
    </tbody>
</table>


    <?php
}


// Flush rewrite rules when activating the theme
add_action( 'after_switch_theme', 'flush_rewrite_rules' );

Youez - 2016 - github.com/yon3zu
LinuXploit