Uname: Linux premium294.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 8.1.32 [ PHP INFO ] PHP os: Linux
Server Ip: 104.21.64.1
Your Ip: 216.73.216.223
User: mjbynoyq (1574) | Group: mjbynoyq (1570)
Safe Mode: OFF
Disable Function:
NONE

name : CSV.php
<?php

namespace WeDevs\Dokan\Withdraw\Export;

class CSV {

    /**
     * Witdraws to export
     *
     * @var array
     */
    protected $withdraws = [];

    /**
     * Class constructor
     *
     * @since 3.0.0
     *
     * @param array $withdraws
     */
    public function __construct( $withdraws ) {
        $this->withdraws = $withdraws;
    }

    /**
     * Export withdraws
     *
     * @since 3.0.0
     *
     * @return void
     */
    public function export() {
        $date = dokan_current_datetime()->format( 'Y-m-d-H-i-s' );

        header( 'Content-type: html/csv' );
        header( 'Content-Disposition: attachment; filename="withdraw-' . $date . '.csv"' );

        $currency = get_option( 'woocommerce_currency' );

        foreach ( $this->withdraws as $withdraw ) {
            $email = dokan_get_seller_withdraw_mail( $withdraw->get_user_id() );

            echo esc_html( $email ) . ',';
            echo esc_html( $withdraw->get_amount() ) . ',';
            echo esc_html( $currency ) . "\n";
        }

        die();
    }
}
© 2025 XylotrechusZ