63 lines
2.5 KiB
PHP
63 lines
2.5 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Laporan Ringkasan</title>
|
|
<style>
|
|
body { font-family: sans-serif; font-size: 10px; }
|
|
table { width: 100%; border-collapse: collapse; margin-bottom: 15px; }
|
|
th, td { border: 1px solid #ccc; padding: 4px; text-align: left; }
|
|
th { background-color: #f0f0f0; }
|
|
.text-right { text-align: right; }
|
|
.text-center { text-align: center; }
|
|
tr.total-row td { background-color: #f9f9f9; font-weight: bold; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h2 style="text-align: center;">Laporan Ringkasan {{ ucfirst($filter) }}</h2>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Tanggal</th>
|
|
<th>Nama Sales</th>
|
|
<th>Item Terjual</th>
|
|
<th>Berat Terjual</th>
|
|
<th>Pendapatan</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($data as $item)
|
|
@php $rowCount = count($item['sales']) > 0 ? count($item['sales']) : 1; @endphp
|
|
|
|
@if(count($item['sales']) > 0)
|
|
@foreach($item['sales'] as $index => $sales)
|
|
<tr>
|
|
@if($index == 0)
|
|
<td rowspan="{{ $rowCount }}">{{ $item['tanggal'] }}</td>
|
|
@endif
|
|
<td>{{ $sales['nama'] }}</td>
|
|
<td class="text-center">{{ $sales['item_terjual'] }}</td>
|
|
<td class="text-right">{{ $sales['berat_terjual'] }}</td>
|
|
<td class="text-right">{{ $sales['pendapatan'] }}</td>
|
|
</tr>
|
|
@endforeach
|
|
@else
|
|
<tr>
|
|
<td>{{ $item['tanggal'] }}</td>
|
|
<td colspan="4" class="text-center" style="font-style: italic;">Tidak ada data transaksi</td>
|
|
</tr>
|
|
@endif
|
|
|
|
{{-- Baris Total --}}
|
|
<tr class="total-row">
|
|
<td colspan="2" class="text-right"><strong>Total Periode Ini</strong></td>
|
|
<td class="text-center"><strong>{{ $item['total_item_terjual'] }}</strong></td>
|
|
<td class="text-right"><strong>{{ $item['total_berat'] }}</strong></td>
|
|
<td class="text-right"><strong>{{ $item['total_pendapatan'] }}</strong></td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</body>
|
|
</html> |