<?php
/**
 * This template show the modal to import a csv file to create passive payouts
 *
 * @package YITH\PayPalPayouts
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
$fields = array(
	'paypal_email' => __( 'PayPal Email', 'yith-paypal-payouts-for-woocommerce' ),
	'amount'       => __( 'Amount', 'yith-paypal-payouts-for-woocommerce' ),
);
?>
<div class="yith-payouts-generator-modal">
    <div class="steps-content">
        <form id="yith-payouts-generator" enctype="multipart/form-data" method="POST">
            <div id="step-upload" class="single-step">
                <div class="payouts-generator-upload-field">
                    <table class="form-table">
                        <tbody>
                        <tr>
                            <th scope="row">
                                <label for="payout_upload_button"><?php esc_html_e( 'Choose a CSV file', 'yith-paypal-payouts-for-woocommerce' ); ?></label>
                            </th>
                            <td>
                                <div class="wrap-upload-button">
                                    <button id="payout_upload_button" class="yith-plugin-fw__button--upload"><?php esc_html_e( 'Upload file', 'yith-paypal-payouts-for-woocommerce' ); ?></button>
                                    <div id="payout_filename_contanier">
                                        <span class="filename"></span>
                                        <span class="yith-icon yith-icon-trash payout_remove_file"></span>
                                    </div>
                                    <input type="file" id="yith-upload" name="file" size="25" accept=".csv" style="display: none;">
                                    <input type="hidden" name="action" value="save">
                                    <input type="hidden" name="max_file_size" value="3072000">
                                </div>
                                <span class="description"><?php esc_html_e( 'Choose your CSV file (maximum size 3 MB).', 'yith-paypal-payouts-for-woocommerce' ); ?></span>
                                <span class="description payout_download_desc">
									<?php
									$url = add_query_arg(
										array(
											'action' => 'payouts_download_file',
										),
										admin_url( 'admin.php' )
									);
									$url = esc_url( wp_nonce_url( $url, 'yith-payouts-download' ) );
									echo wp_kses_post(
										sprintf(
											'<a href="%1$s">%2$s</a>',
											$url,
											__( 'Download an example.', 'yith-paypal-payouts-for-woocommerce' )
										)
									);
									?>
								</span>
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                <label for="payout_csv_delimiter"><?php esc_html_e( 'CSV delimiter', 'yith-paypal-payouts-for-woocommerce' ); ?></label>
                            </th>
                            <td>
                                <div class="yith-plugin-fw-field-wrapper yith-plugin-fw-text-field-wrapper">
                                    <input type="text" id="payout_csv_delimiter" name="payout_csv_delimiter" class="" value=",">
                                </div>
                                <span class="description"><?php esc_html_e( 'Set character to use as delimiter during the reading of the file', 'yith-paypal-payouts-for-woocommerce' ); ?></span>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <button class="yith-plugin-fw__button--primary move-step disabled" type="submit" data-step-to="2"><?php esc_html_e( 'Generate Payouts', 'yith-paypal-payouts-for-woocommerce' ); ?></button>
            </div>
        </form>
    </div>
</div>

