Commit 7816281a by Palti Sinaga

abcd

parent 196e320d
...@@ -102,8 +102,10 @@ class AdminController extends Controller ...@@ -102,8 +102,10 @@ class AdminController extends Controller
$data2 = DB::table('daftar_book') $data2 = DB::table('daftar_book')
->where('daftar_book.homestay','=',$dataHomestay[0]->id) ->where('daftar_book.homestay','=',$dataHomestay[0]->id)
->join('homestay','daftar_book.homestay','=','homestay.id')
->where('daftar_book.id_transaksi','=',null) ->where('daftar_book.id_transaksi','=',null)
->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan']) ->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan'])
->select('homestay.nama_homestay','homestay.owner','daftar_book.*')
->get(); ->get();
//$i=0; //$i=0;
...@@ -118,9 +120,9 @@ class AdminController extends Controller ...@@ -118,9 +120,9 @@ class AdminController extends Controller
$penghasilan += $biaya; $penghasilan += $biaya;
} }
dd($data,$data2,$penghasilan); //dd($data,$data2,$penghasilan);
// dd('masuk',$request['bulan'],$request['nama_homestay'],$data); //dd($data2);
return view('adminlte::layouts.admin.resultlistpesanan')->with('data',$data)->with('data2',$data2); return view('adminlte::layouts.admin.resultlistpesanan')->with('data',$data)->with('data2',$data2);
} }
......
...@@ -53,13 +53,13 @@ ...@@ -53,13 +53,13 @@
<tr> <tr>
<th>Total Pembayaran</th> <th>Total Pembayaran</th>
<td>:</td> <td>:</td>
<td>{{$a->total_harga}}</td> <td>Rp. {{$a->total_harga}}</td>
</tr> <br><br> </tr> <br><br>
</table> </table>
@endforeach @endforeach
<h3>Total Tamu : </h3> {{$tamu}} <h3>Total Tamu : {{$tamu}}</h3>
<h3>Total Penghasilan : </h3> {{$penghasilan}} <h3>Total Penghasilan : Rp. {{$penghasilan}}</h3>
</body> </body>
</html> </html>
...@@ -41,15 +41,19 @@ ...@@ -41,15 +41,19 @@
</div> </div>
</form> </form>
<table class="table table-striped">
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr> <tr>
<th>Nama Homestay</th> <th>Homestay</th>
<th>Nama Pemilik Homestay</th> <th>Nama Pemilik Homstay</th>
<th>Nama Pemesan</th> <th>Nama Pemesan</th>
<th>Tanggal Mulai</th> <th>Tanggal Mulai</th>
<th>Tanggal Berakhir</th> <th>Tanggal Berakhir</th>
<th>Jumlah Kamar yang dipesan</th> <th>Jumlah Kamar yang dipesan</th>
</tr> </tr>
</thead>
<tbody>
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
<td>{{$a->nama_homestay}}</td> <td>{{$a->nama_homestay}}</td>
...@@ -60,10 +64,24 @@ ...@@ -60,10 +64,24 @@
<td>{{$a->jumlah_kamar}}</td> <td>{{$a->jumlah_kamar}}</td>
</tr> </tr>
@endforeach @endforeach
</tbody>
</table> </table>
{!! $data->render() !!}
</div> </div>
</div> </div>
<script>
$(function () {
$("#example1").DataTable();
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false
});
});
</script>
@endsection @endsection
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<th>Tanggal Mulai</th> <th>Tanggal Mulai</th>
<th>Tanggal Berakhir</th> <th>Tanggal Berakhir</th>
<th>Jumlah Kamar yang dipesan</th> <th>Jumlah Kamar yang dipesan</th>
<th>Total Harga</th>
</tr> </tr>
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
...@@ -43,6 +44,7 @@ ...@@ -43,6 +44,7 @@
<td>{{$a->tanggal_mulai}}</td> <td>{{$a->tanggal_mulai}}</td>
<td>{{$a->tanggal_berakhir}}</td> <td>{{$a->tanggal_berakhir}}</td>
<td>{{$a->jumlah_kamar}}</td> <td>{{$a->jumlah_kamar}}</td>
<td>{{$a->total_harga}}</td>
</tr> </tr>
@endforeach @endforeach
@foreach($data2 as $c) @foreach($data2 as $c)
...@@ -53,6 +55,7 @@ ...@@ -53,6 +55,7 @@
<td>{{$c->tanggal_mulai}}</td> <td>{{$c->tanggal_mulai}}</td>
<td>{{$c->tanggal_berakhir}}</td> <td>{{$c->tanggal_berakhir}}</td>
<td>{{$c->jumlah_kamar}}</td> <td>{{$c->jumlah_kamar}}</td>
<td>{{$c->total_harga}}</td>
</tr> </tr>
@endforeach @endforeach
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
<input type="number" min="1" max="12" name="bulan" required > <input type="number" min="1" max="12" name="bulan" required >
<input type="submit" value="Cari" class="btn-btn info"> <input type="submit" value="Cari" class="btn-btn info">
</form> </form>
<form action="{{url('printReportOwner')}}" enctype="multipart/form-data"> <form action="{{url('printReportOwner')}}" enctype="multipart/form-data" style="float:right;">
<div class="form-group" align="right"> <div class="form-group" align="right">
<label>Bulan</label> <label>Bulan</label>
<input type="number" min="1" max="12" name="bulan" required > <input type="number" min="1" max="12" name="bulan" display="none" required >
<input type="submit" class="btn btn-warning" value="Print"> <input type="submit" class="btn btn-warning" value="Print">
</div> </div>
</form> </form>
...@@ -30,14 +30,14 @@ ...@@ -30,14 +30,14 @@
<table class="table"> <table class="table">
<tr> <tr>
<td></td> <td></td>
<td>Nama Pemesan</td> <th>Nama Pemesan</th>
<td>Jumlah Kamar</td> <th>Jumlah Kamar</th>
<td>Jumlah Tamu</td> <th>Jumlah Tamu</th>
<td>Lama Menginap</td> <th>Lama Menginap</th>
<td>Extrabed</td> <th>Extrabed</th>
<td>Tanggal Mulai</td> <th>Tanggal Mulai</th>
<td>Tanggal Berakhir</td> <th>Tanggal Berakhir</th>
<td>Total Harga</td> <th>Total Harga</th>
</tr> </tr>
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
...@@ -65,9 +65,6 @@ ...@@ -65,9 +65,6 @@
</tr> </tr>
</table> </table>
@endif @endif
</div> </div>
</div> </div>
@endsection @endsection
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