

<!DOCTYPE html>
<html>
<head>
	<title>Laporan Keuangan</title>
	<style type="text/css">
		table{
			width: 70%;
			margin: 0 auto;
			border: 1px solid;
		}
	</style>
</head>
<body>
<table>
<caption><h1>Laporan Keuangan</h1></caption>
	<thead>
	<tr>
		<th>No</th>
		<th>Nama</th>
		
	</tr>
	</thead>

	<tbody>
	 
	 <?php
	use App\Pembayaran;

	use Carbon\Carbon;

	use Illuminate\Support\Facades\DB ;

	 $no=1; 
	 $pembayarans = Pembayaran::all();

	 $total = 0;

        foreach ($pembayarans as $pembayaran) {
            $total += $pembayaran->total_harga;
        }


	?>
	@foreach($pembayarans as $key => $pembayaran)
	<tr>
		<td>{{$no++}}</td>
		<td>{{$pembayaran->nama}}</td>
		<td>{{$pembayaran->total_harga}}</td>
		
	</tr>
	@endforeach

	</tbody>
	<th>Total Jumlah Harga</th><td>{{$total}}</td>
</table>
</body>
</html>
