Commit 63c10513 by Juliper
parents ded5c9f9 558f9674
......@@ -102,8 +102,10 @@ class AdminController extends Controller
$data2 = DB::table('daftar_book')
->where('daftar_book.homestay','=',$dataHomestay[0]->id)
->join('homestay','daftar_book.homestay','=','homestay.id')
->where('daftar_book.id_transaksi','=',null)
->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan'])
->select('homestay.nama_homestay','homestay.owner','daftar_book.*')
->get();
//$i=0;
......@@ -118,9 +120,9 @@ class AdminController extends Controller
$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);
}
......
......@@ -53,13 +53,13 @@
<tr>
<th>Total Pembayaran</th>
<td>:</td>
<td>{{$a->total_harga}}</td>
<td>Rp. {{$a->total_harga}}</td>
</tr> <br><br>
</table>
@endforeach
<h3>Total Tamu : </h3> {{$tamu}}
<h3>Total Penghasilan : </h3> {{$penghasilan}}
<h3>Total Tamu : {{$tamu}}</h3>
<h3>Total Penghasilan : Rp. {{$penghasilan}}</h3>
</body>
</html>
......@@ -41,29 +41,47 @@
</div>
</form>
<table class="table table-striped">
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr>
<th>Nama Homestay</th>
<th>Nama Pemilik Homestay</th>
<th>Homestay</th>
<th>Nama Pemilik Homstay</th>
<th>Nama Pemesan</th>
<th>Tanggal Mulai</th>
<th>Tanggal Berakhir</th>
<th>Jumlah Kamar yang dipesan</th>
</tr>
@foreach($data as $a)
<tr>
<td>{{$a->nama_homestay}}</td>
<td>{{$a->owner}}</td>
<td>{{$a->nama_pemesan}}</td>
<td>{{$a->tanggal_mulai}}</td>
<td>{{$a->tanggal_berakhir}}</td>
<td>{{$a->jumlah_kamar}}</td>
</tr>
@endforeach
</thead>
<tbody>
@foreach($data as $a)
<tr>
<td>{{$a->nama_homestay}}</td>
<td>{{$a->owner}}</td>
<td>{{$a->nama_pemesan}}</td>
<td>{{$a->tanggal_mulai}}</td>
<td>{{$a->tanggal_berakhir}}</td>
<td>{{$a->jumlah_kamar}}</td>
</tr>
@endforeach
</tbody>
</table>
{!! $data->render() !!}
</div>
</div>
<script>
$(function () {
$("#example1").DataTable();
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false
});
});
</script>
@endsection
......@@ -34,6 +34,7 @@
<th>Tanggal Mulai</th>
<th>Tanggal Berakhir</th>
<th>Jumlah Kamar yang dipesan</th>
<th>Total Harga</th>
</tr>
@foreach($data as $a)
<tr>
......@@ -43,6 +44,7 @@
<td>{{$a->tanggal_mulai}}</td>
<td>{{$a->tanggal_berakhir}}</td>
<td>{{$a->jumlah_kamar}}</td>
<td>{{$a->total_harga}}</td>
</tr>
@endforeach
@foreach($data2 as $c)
......@@ -53,6 +55,7 @@
<td>{{$c->tanggal_mulai}}</td>
<td>{{$c->tanggal_berakhir}}</td>
<td>{{$c->jumlah_kamar}}</td>
<td>{{$c->total_harga}}</td>
</tr>
@endforeach
......
......@@ -13,13 +13,13 @@
<div class="box-body">
<form action="{{url('report')}}">
<label>Bulan</label>
<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">
</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">
<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">
</div>
</form>
......@@ -30,14 +30,14 @@
<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>
<th>Nama Pemesan</th>
<th>Jumlah Kamar</th>
<th>Jumlah Tamu</th>
<th>Lama Menginap</th>
<th>Extrabed</th>
<th>Tanggal Mulai</th>
<th>Tanggal Berakhir</th>
<th>Total Harga</th>
</tr>
@foreach($data as $a)
<tr>
......@@ -65,9 +65,6 @@
</tr>
</table>
@endif
</div>
</div>
@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