<!DOCTYPE html>
<html lang="it">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Articoli Venduti</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>

<body>
    <div class="container">

        <h1>Lista Ordini Libri - Totale Venduti (scegli data)</h1>
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>ID Articolo</th>
                    <th>Descrizione</th>
                    <th>Data ultima Vendita</th>
                    <th>Totale Venduti</th>
                </tr>
            </thead>
            <tbody>
                @foreach($articoli as $articolo)
                    @if (isset($articolo))
                        <tr>
                            <td>@if (isset($articolo->IdArticolo))
                                <a href="/apimacro/public/view-info-articolo/{{$articolo->IdArticolo}}" target="_blank">{{ $articolo->IdArticolo }}</a>
                            @endif
                            </td>
                            <td>@if (isset($articolo->Titolo))
                                {{ $articolo->Titolo }}
                            @endif
                            </td>
                            <td>@if (isset($articolo->ultimaDataOra)){{ \Carbon\Carbon::parse($articolo->ultimaDataOra)->format('d/m/Y') }}@endif
                            </td>

                            <td>@if (isset($articolo->totVen))
                                    <a href="/apimacro/public/view-ordini-by-idarticolo/{{$articolo->IdArticolo}}"
                                        target="_blank">{{ $articolo->totVen }}</a>
                                @endif
                                </td>
                        </tr>
                    @endif
                @endforeach
            </tbody>
        </table>
    </div>
</body>

</html>