115 lines
2.8 KiB
PHP
115 lines
2.8 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Laporan {{ ucfirst($jenis) }}</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
margin: 30px;
|
|
}
|
|
|
|
.header {
|
|
text-align: center;
|
|
margin-bottom: 30px;
|
|
}
|
|
|
|
.title {
|
|
font-size: 24px;
|
|
font-weight: bold;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.subtitle {
|
|
font-size: 16px;
|
|
color: #666;
|
|
}
|
|
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
th,
|
|
td {
|
|
border: 1px solid #ddd;
|
|
padding: 8px;
|
|
text-align: left;
|
|
}
|
|
|
|
th {
|
|
background-color: #f5f5f5;
|
|
}
|
|
|
|
.summary {
|
|
margin-top: 20px;
|
|
padding: 15px;
|
|
background-color: #f9f9f9;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="header">
|
|
<div class="title">DIJEE Elektronik</div>
|
|
<div class="subtitle">
|
|
Laporan {{ ucfirst($jenis) }}<br>
|
|
Periode: {{ \Carbon\Carbon::parse($tanggal_mulai)->format('d M Y') }} - {{ \Carbon\Carbon::parse($tanggal_selesai)->format('d M Y') }}
|
|
</div>
|
|
</div>
|
|
|
|
@if($jenis === 'transaksi')
|
|
<div class="summary">
|
|
<p><strong>Total Transaksi:</strong> {{ $total_transaksi }}</p>
|
|
<p><strong>Total Pendapatan:</strong> Rp {{ number_format($total_pendapatan, 0, ',', '.') }}</p>
|
|
</div>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Kode Transaksi</th>
|
|
<th>Tanggal</th>
|
|
<th>Customer</th>
|
|
<th>Barang</th>
|
|
<th>Total</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($transaksi as $t)
|
|
<tr>
|
|
<td>{{ $t->kode_transaksi }}</td>
|
|
<td>{{ $t->created_at->format('d/m/Y') }}</td>
|
|
<td>{{ $t->user->nama }}</td>
|
|
<td>{{ $t->pesanan->barang->nama_barang }}</td>
|
|
<td>Rp {{ number_format($t->total_pembayaran, 0, ',', '.') }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
@else
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Nama Barang</th>
|
|
<th>Stok</th>
|
|
<th>Harga</th>
|
|
<th>Total Pesanan</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($barang as $b)
|
|
<tr>
|
|
<td>{{ $b->nama_barang }}</td>
|
|
<td>{{ $b->stok }}</td>
|
|
<td>Rp {{ number_format($b->harga, 0, ',', '.') }}</td>
|
|
<td>{{ $b->pesanan_count }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
@endif
|
|
</body>
|
|
|
|
</html> |