Commit 196e320d by Palti Sinaga

report

parent 8cd8ed9e
...@@ -52,9 +52,9 @@ class OwnerController extends Controller ...@@ -52,9 +52,9 @@ class OwnerController extends Controller
$dataHomestay = DB::table('homestay') $dataHomestay = DB::table('homestay')
->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id') ->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id')
->where('pemilikhomestay.id_akun','=',Auth::user()->id) ->where('pemilikhomestay.id_akun','=',Auth::user()->id)
->select('homestay.id') ->select('homestay.id','homestay.nama_homestay')
->get(); ->get();
//dd($dataHomestay[0]->nama_homestay);
$dataPesanan = DB::table('daftar_book') $dataPesanan = DB::table('daftar_book')
->where('daftar_book.homestay','=',$dataHomestay[0]->id) ->where('daftar_book.homestay','=',$dataHomestay[0]->id)
->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan']) ->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan'])
...@@ -69,7 +69,7 @@ class OwnerController extends Controller ...@@ -69,7 +69,7 @@ class OwnerController extends Controller
//dd($jumlah_tamu); //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'); return $pdf->stream('reportOwner.pdf');
} }
......
...@@ -9,44 +9,57 @@ ...@@ -9,44 +9,57 @@
<p style="float:right;"><b>Tanggal : </b> <?php echo date("Y/m/d") ;?></p> <p style="float:right;"><b>Tanggal : </b> <?php echo date("Y/m/d") ;?></p>
<br><br><br> <br><br><br>
<center> <h1>Laporan di Bulan {{$bulan}}</h1></center>
<center> {{$namaHomestay}} </center>
@foreach($data as $a)
<table class="table table-user-information">
<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> <tr>
<td></td> <th>Nama Pemesan</th>
<td>: </td>
<td>{{$a->nama_pemesan}}</td> <td>{{$a->nama_pemesan}}</td>
<td>{{$a->jumlah_kamar}}</td> </tr>
<td>{{$a->jumlah_tamu}}</td> <tr>
<td>{{$a->lama_menginap}}</td> <th>Jumlah Kamar</th>
<td>{{$a->extrabed}}</td> <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> <td>{{$a->tanggal_mulai}}</td>
<td>{{$a->tanggal_berakhir}}</td>
<td>{{$a->total_harga}}</td>
</tr> </tr>
@endforeach <tr>
<tr> <th>Tanggal Check-out</th>
<td>Total</td> <td>:</td>
<td></td> <td>{{$a->tanggal_berakhir}}</td>
<td></td>
<td>{{$tamu}}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>{{$penghasilan}}</td>
</tr> </tr>
<tr>
<th>Total Pembayaran</th>
<td>:</td>
<td>{{$a->total_harga}}</td>
</tr> <br><br>
</table> </table>
@endforeach
<h3>Total Tamu : </h3> {{$tamu}}
<h3>Total Penghasilan : </h3> {{$penghasilan}}
</body> </body>
</html> </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