This commit is contained in:
paoloar77
2024-11-27 14:44:37 +01:00
parent b95135f12b
commit 08622480e3
2 changed files with 35 additions and 1 deletions

View File

@@ -43,6 +43,8 @@ class ArticleController extends Controller // Should extend AbstractController
$csvContent .= $articoloVenduto->idArticolo . ',' . $articoloVenduto->Titolo . ',' . $articoloVenduto->totaleVenduto . "\n"; // Aggiunto il campo Titolo nei dati
}
view('export_articles_sales', ['articoliVenduti' => $articoliVenduti]);
$response->setContent($csvContent);
return $response;

View File

@@ -0,0 +1,32 @@
<!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 mt-4">
<h1 class="mb-4">Articoli Venduti</h1>
<table class="table table-bordered">
<thead>
<tr>
<th>Id Articolo</th>
<th>Titolo</th>
<th>Totale Venduto</th>
</tr>
</thead>
<tbody>
@foreach ($articoliVenduti as $articolo)
<tr>
<td>{{ $articolo->idArticolo }}</td>
<td>{{ $articolo->Titolo }}</td>
<td>{{ $articolo->totaleVenduto }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</body>
</html>