@extends('layouts.accountant')

@section('title', 'Rapports')
@section('page-title', 'Centre de Rapports')

@section('content')
<div class="row">
    <div class="col-md-4 mb-4">
        <div class="card h-100">
            <div class="card-body text-center">
                <i class="bi bi-graph-up fs-1 text-primary mb-3"></i>
                <h5>Rapport Financier</h5>
                <p class="text-muted">Vue d'ensemble des revenus, commissions et retraits</p>
                <a href="{{ route('accountant.reports.financial') }}" class="btn btn-primary">
                    <i class="bi bi-arrow-right me-1"></i> Generer
                </a>
            </div>
        </div>
    </div>
    
    <div class="col-md-4 mb-4">
        <div class="card h-100">
            <div class="card-body text-center">
                <i class="bi bi-people fs-1 text-success mb-3"></i>
                <h5>Rapport Commissions</h5>
                <p class="text-muted">Detail des commissions par utilisateur et niveau</p>
                <a href="{{ route('accountant.reports.commissions') }}" class="btn btn-success">
                    <i class="bi bi-arrow-right me-1"></i> Generer
                </a>
            </div>
        </div>
    </div>
    
    <div class="col-md-4 mb-4">
        <div class="card h-100">
            <div class="card-body text-center">
                <i class="bi bi-list-ul fs-1 text-info mb-3"></i>
                <h5>Transactions</h5>
                <p class="text-muted">Historique complet des transactions</p>
                <a href="{{ route('accountant.reports.transactions') }}" class="btn btn-info">
                    <i class="bi bi-arrow-right me-1"></i> Voir
                </a>
            </div>
        </div>
    </div>
</div>

<div class="card mt-4">
    <div class="card-header bg-white">
        <h5 class="mb-0">Export Personnalise</h5>
    </div>
    <div class="card-body">
        <form action="{{ route('accountant.reports.financial') }}" method="GET" class="row g-3">
            <div class="col-md-3">
                <label class="form-label">Date debut</label>
                <input type="date" name="from" class="form-control" value="{{ now()->startOfMonth()->format('Y-m-d') }}">
            </div>
            <div class="col-md-3">
                <label class="form-label">Date fin</label>
                <input type="date" name="to" class="form-control" value="{{ now()->format('Y-m-d') }}">
            </div>
            <div class="col-md-3">
                <label class="form-label">Type de rapport</label>
                <select name="type" class="form-select">
                    <option value="financial">Financier</option>
                    <option value="commissions">Commissions</option>
                    <option value="withdrawals">Retraits</option>
                </select>
            </div>
            <div class="col-md-3 d-flex align-items-end">
                <button type="submit" class="btn btn-primary w-100">
                    <i class="bi bi-file-earmark-bar-graph me-1"></i> Generer le Rapport
                </button>
            </div>
        </form>
    </div>
</div>
@endsection
