<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>
<div id="kirilkirkov" class="wrap">
    <div class="create-client-page">
        <div class="header p-4 flex items-center space-between">
            <div class="flex items-center">
                <img class="logo" src="<?php echo esc_url(plugins_url('../../Assets/Img/logo.svg', __FILE__ )); ?>" alt="<?php echo esc_attr( 'WP Invoices' ) ?>" />
            </div>
            <h1 class="text-white uppercase text-sm font-lighter p-0">
                <?php esc_html_e('Invoices Charts', 'kirilkirkov-pdf-invoice-manager' ); ?>
            </h1>
        </div>
        <div class="flex flex-wrap">
            <div class="w-full">
                <div class="section-body bg-white p-4">

                    <div class="w-full md:max-w-md mx-auto">
                        <div class="mb-4">
                            <form method="GET" action="<?php echo esc_url(admin_url( 'admin.php' )); ?>">
                                <input type="hidden" name="page" value="<?php echo esc_attr(sanitize_text_field($Config::SUB_MENU_CHARTS_INVOICE_PAGE_SLUG)); ?>">
                                <div class="mb-2">
                                    <label><?php esc_html_e('From Date', 'kirilkirkov-pdf-invoice-manager' ); ?></label>
                                    <input type="text" class="datepicker" name="from_date" value="<?php echo esc_attr(sanitize_text_field($dates['from_date'])); ?>">
                                </div>
                                <div class="mb-2">
                                    <label><?php esc_html_e('To Date', 'kirilkirkov-pdf-invoice-manager' ); ?></label>
                                    <input type="text" class="datepicker" name="to_date" value="<?php echo esc_attr(sanitize_text_field($dates['to_date'])); ?>">
                                </div>
                                <div class="text-center">
                                    <button type="submit">
                                        <?php esc_html_e('Filter', 'kirilkirkov-pdf-invoice-manager' ); ?>
                                    </button>
                                    <a href="<?php echo esc_url(admin_url( 'admin.php?page=' . $Config::SUB_MENU_CHARTS_INVOICE_PAGE_SLUG . '&download-csv=true' )); ?>" target="_blank">
                                        <?php esc_html_e('Download as CSV', 'kirilkirkov-pdf-invoice-manager' ); ?>
                                    </a>
                                </div>
                            </form>
                        </div>
                    </div>
                    
                    <div class="mb-4">
                        <canvas id="kirilkirkov-pdf-invoice-manager-report-num-inv"></canvas>
                    </div>

                    <div class="mb-4">
                        <canvas id="kirilkirkov-pdf-invoice-manager-num-invoices-by-month"></canvas>
                    </div>

                    <div class="mb-4">
                        <canvas id="kirilkirkov-pdf-invoice-manager-amount-invoices-by-month"></canvas>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
