# easy-invoice/2.4.4/templates/admin/import-page.php

Easy Invoice – Invoice Generator, PDF Quotes &amp; Payments, version 2.4.4. 116 lines.

- Page: https://pluginprobe.com/plugins/easy-invoice/2.4.4/code/templates/admin/import-page.php
- Raw: https://pluginprobe.com/plugins/easy-invoice/2.4.4/raw/templates/admin/import-page.php
- Modified: 2026-09-15T12:31:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-invoice/2.4.4/code/templates/admin/import-page.php#L10-L20`.

```php
<?php
/**
 * Import screen.
 *
 * Receives: $sources, $previews, $result
 *
 * @package Easy_Invoice
 */

use EasyInvoice\Controllers\ImportController;

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

$labels = [
    'clients'         => __( 'clients', 'easy-invoice' ),
    'clients_matched' => __( 'clients already here (reused)', 'easy-invoice' ),
    'invoices'        => __( 'invoices', 'easy-invoice' ),
    'quotes'          => __( 'quotes', 'easy-invoice' ),
    'payments'        => __( 'payments', 'easy-invoice' ),
    'skipped'         => __( 'skipped (imported earlier)', 'easy-invoice' ),
    'already'         => __( 'imported earlier', 'easy-invoice' ),
];
?>
<div class="p-8">
    <div class="ei-app-page-header bg-white border-b border-gray-200 px-6 easy-invoice-admin-page-header">
        <h1 class="text-2xl font-bold text-gray-900"><?php esc_html_e( 'Import', 'easy-invoice' ); ?></h1>
        <p class="mt-1 text-sm text-gray-500">
            <?php esc_html_e( 'Bring clients, quotes, invoices and payments in from another product. Nothing is renumbered, running an import twice adds nothing, and a client who already exists here is reused.', 'easy-invoice' ); ?>
        </p>
    </div>

    <?php if ( is_array( $result ) ) : ?>
        <?php if ( ! empty( $result['error'] ) ) : ?>
            <div class="mt-6 rounded-md bg-red-50 border border-red-200 p-4"><p class="text-sm text-red-800"><?php echo esc_html( $result['error'] ); ?></p></div>
        <?php else : ?>
            <div class="mt-6 rounded-md bg-emerald-50 border border-emerald-200 p-4">
                <p class="text-sm font-medium text-emerald-900">
                    <?php
                    /* translators: %s: source name. */
                    printf( esc_html__( 'Import from %s finished.', 'easy-invoice' ), esc_html( (string) ( $result['label'] ?? '' ) ) );
                    ?>
                </p>
                <ul class="mt-2 text-sm text-emerald-900 grid grid-cols-2 sm:grid-cols-3 gap-x-6 gap-y-1">
                    <?php foreach ( (array) ( $result['counts'] ?? [] ) as $key => $n ) : ?>
                        <li><strong><?php echo (int) $n; ?></strong> <?php echo esc_html( $labels[ $key ] ?? $key ); ?></li>
                    <?php endforeach; ?>
                </ul>
                <?php if ( ! empty( $result['notes'] ) ) : ?>
                    <ul class="mt-3 text-xs text-emerald-800 list-disc pl-5">
                        <?php foreach ( array_slice( (array) $result['notes'], 0, 20 ) as $note ) : ?>
                            <li><?php echo esc_html( $note ); ?></li>
                        <?php endforeach; ?>
                    </ul>
                <?php endif; ?>
                <p class="mt-3 text-sm"><a class="text-indigo-600 font-medium" href="<?php echo esc_url( admin_url( 'admin.php?page=easy-invoice-all' ) ); ?>"><?php esc_html_e( 'Open the invoice list', 'easy-invoice' ); ?></a></p>
            </div>
        <?php endif; ?>
    <?php endif; ?>

    <div class="mt-6 grid grid-cols-1 lg:grid-cols-2 gap-6 items-start">
        <?php foreach ( $sources as $key => $importer ) : ?>
            <div class="bg-white rounded-lg border border-gray-200 p-6">
                <h2 class="text-lg font-semibold text-gray-900"><?php echo esc_html( $importer->label() ); ?></h2>
                <?php if ( isset( $previews[ $key ] ) ) : ?>
                    <p class="mt-1 text-sm text-gray-600"><?php esc_html_e( 'Found on this site. Reads the data directly; the other plugin does not need to be active.', 'easy-invoice' ); ?></p>
                    <dl class="mt-4 grid grid-cols-2 gap-x-6 gap-y-1 text-sm">
                        <?php foreach ( $previews[ $key ] as $k => $n ) : ?>
                            <div class="flex justify-between border-b border-gray-100 py-1"><dt class="text-gray-500"><?php echo esc_html( $labels[ $k ] ?? $k ); ?></dt><dd class="font-medium text-gray-900" style="font-variant-numeric: tabular-nums;"><?php echo (int) $n; ?></dd></div>
                        <?php endforeach; ?>
                    </dl>
                    <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" class="mt-4">
                        <input type="hidden" name="action" value="<?php echo esc_attr( ImportController::ACTION_RUN ); ?>">
                        <input type="hidden" name="source" value="<?php echo esc_attr( $key ); ?>">
                        <?php wp_nonce_field( ImportController::ACTION_RUN ); ?>
                        <button type="submit" class="inline-flex items-center px-3 py-1.5 text-sm font-medium rounded-md bg-indigo-600 text-white hover:bg-indigo-700">
                            <?php
                            /* translators: %s: source name. */
                            printf( esc_html__( 'Import from %s', 'easy-invoice' ), esc_html( $importer->label() ) );
                            ?>
                        </button>
                    </form>
                <?php else : ?>
                    <p class="mt-1 text-sm text-gray-500"><?php esc_html_e( 'Nothing from this plugin was found on this site.', 'easy-invoice' ); ?></p>
                <?php endif; ?>
            </div>
        <?php endforeach; ?>

        <div class="bg-white rounded-lg border border-gray-200 p-6 lg:col-span-2">
            <h2 class="text-lg font-semibold text-gray-900"><?php esc_html_e( 'CSV files', 'easy-invoice' ); ?></h2>
            <p class="mt-1 text-sm text-gray-600">
                <?php esc_html_e( 'For FreshBooks, Wave, Zoho, Invoice Ninja or a spreadsheet. Columns are matched by their header names, so most exports work unchanged; the templates show the names that are recognised. Invoices with several lines repeat the number on each row.', 'easy-invoice' ); ?>
            </p>
            <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" enctype="multipart/form-data" class="mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4">
                <input type="hidden" name="action" value="<?php echo esc_attr( ImportController::ACTION_RUN ); ?>">
                <input type="hidden" name="source" value="csv">
                <?php wp_nonce_field( ImportController::ACTION_RUN ); ?>
                <div>
                    <label for="ei-import-clients" class="block text-sm font-medium text-gray-700"><?php esc_html_e( 'Clients CSV', 'easy-invoice' ); ?></label>
                    <input type="file" id="ei-import-clients" name="clients_csv" accept=".csv,text/csv" class="mt-1 block w-full text-sm">
                    <a class="text-xs text-indigo-600" href="<?php echo esc_url( wp_nonce_url( admin_url( 'admin-post.php?action=' . ImportController::ACTION_TPL . '&which=clients' ), ImportController::ACTION_TPL ) ); ?>"><?php esc_html_e( 'Download template', 'easy-invoice' ); ?></a>
                </div>
                <div>
                    <label for="ei-import-invoices" class="block text-sm font-medium text-gray-700"><?php esc_html_e( 'Invoices CSV', 'easy-invoice' ); ?></label>
                    <input type="file" id="ei-import-invoices" name="invoices_csv" accept=".csv,text/csv" class="mt-1 block w-full text-sm">
                    <a class="text-xs text-indigo-600" href="<?php echo esc_url( wp_nonce_url( admin_url( 'admin-post.php?action=' . ImportController::ACTION_TPL . '&which=invoices' ), ImportController::ACTION_TPL ) ); ?>"><?php esc_html_e( 'Download template', 'easy-invoice' ); ?></a>
                </div>
                <div class="sm:col-span-2">
                    <button type="submit" class="inline-flex items-center px-3 py-1.5 text-sm font-medium rounded-md bg-indigo-600 text-white hover:bg-indigo-700"><?php esc_html_e( 'Import CSV', 'easy-invoice' ); ?></button>
                </div>
            </form>
        </div>
    </div>
</div>

```
