Commit 196e320d by Palti Sinaga

report

parent 8cd8ed9e
......@@ -52,9 +52,9 @@ class OwnerController extends Controller
$dataHomestay = DB::table('homestay')
->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id')
->where('pemilikhomestay.id_akun','=',Auth::user()->id)
->select('homestay.id')
->select('homestay.id','homestay.nama_homestay')
->get();
//dd($dataHomestay[0]->nama_homestay);
$dataPesanan = DB::table('daftar_book')
->where('daftar_book.homestay','=',$dataHomestay[0]->id)
->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan'])
......@@ -69,7 +69,7 @@ class OwnerController extends Controller
//dd($jumlah_tamu);
$pdf = PDF::loadView('pdf.reportOwner',['data' => $dataPesanan],['tamu'=>$jumlah_tamu,'penghasilan'=>$penghasilan]);
$pdf = PDF::loadView('pdf.reportOwner',['data' => $dataPesanan],['tamu'=>$jumlah_tamu,'penghasilan'=>$penghasilan,'bulan'=>$request['bulan'],'namaHomestay'=>$dataHomestay[0]->nama_homestay]);
return $pdf->stream('reportOwner.pdf');
}
......
......@@ -9,44 +9,57 @@
<p style="float:right;"><b>Tanggal : </b> <?php echo date("Y/m/d") ;?></p>
<br><br><br>
<center> <h1>Laporan di Bulan {{$bulan}}</h1></center>
<center> {{$namaHomestay}} </center>
@foreach($data as $a)
<table class="table table-user-information">
<tr>
<th>Nama Pemesan</th>
<td>: </td>
<td>{{$a->nama_pemesan}}</td>
</tr>
<tr>
<th>Jumlah Kamar</th>
<td>: </td>
<td>{{$a->jumlah_kamar}} kamar</td>
</tr>
<tr>
<th>Jumlah Tamu</th>
<td>: </td>
<td>{{$a->jumlah_tamu}} orang</td>
</tr>
<tr>
<th>Lama Menginap</th>
<td>: </td>
<td>{{$a->lama_menginap}} Malam </td>
</tr>
<tr>
<th>Extra-bed</th>
<td>: </td>
<td>{{$a->extrabed}} buah</td>
</tr>
<tr>
<th>Tanggal Check-in</th>
<td>:</td>
<td>{{$a->tanggal_mulai}}</td>
</tr>
<tr>
<th>Tanggal Check-out</th>
<td>:</td>
<td>{{$a->tanggal_berakhir}}</td>
</tr>
<tr>
<th>Total Pembayaran</th>
<td>:</td>
<td>{{$a->total_harga}}</td>
</tr> <br><br>
<table class="table">
<tr>
<td></td>
<td>Nama Pemesan</td>
<td>Jumlah Kamar</td>
<td>Jumlah Tamu</td>
<td>Lama Menginap</td>
<td>Extrabed</td>
<td>Tanggal Mulai</td>
<td>Tanggal Berakhir</td>
<td>Total Harga</td>
</tr>
@foreach($data as $a)
<tr>
<td></td>
<td>{{$a->nama_pemesan}}</td>
<td>{{$a->jumlah_kamar}}</td>
<td>{{$a->jumlah_tamu}}</td>
<td>{{$a->lama_menginap}}</td>
<td>{{$a->extrabed}}</td>
<td>{{$a->tanggal_mulai}}</td>
<td>{{$a->tanggal_berakhir}}</td>
<td>{{$a->total_harga}}</td>
</tr>
@endforeach
<tr>
<td>Total</td>
<td></td>
<td></td>
<td>{{$tamu}}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>{{$penghasilan}}</td>
</tr>
</table>
@endforeach
<h3>Total Tamu : </h3> {{$tamu}}
<h3>Total Penghasilan : </h3> {{$penghasilan}}
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment