Commit eb6c3919 by Juliper

gas

parent 4989feea
......@@ -25,7 +25,37 @@ class AdminController extends Controller
$this->middleware('dinaspariwisata');
}
public function cariPesanan(Request $request){
$dataHomestay = Homestay::where('nama_homestay',$request['nama_homestay'])->get();
//dd($dataHomestay[0]->id);
//$dataBok = DB::table('daftar_book')
// ->where('da');
$data = DB::table('daftar_book')
->join('transaksi','daftar_book.id_transaksi','=','transaksi.id')
->join('homestay','daftar_book.homestay','=','homestay.id')
->join('pelanggan','transaksi.id_pelanggan','=','pelanggan.id')
->where('daftar_book.homestay','=',$dataHomestay[0]->id)
->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan'])
->where('transaksi.status','=',1)
->select('homestay.nama_homestay','homestay.owner','pelanggan.nama','transaksi.total_pembayaran','transaksi.jumlah_kamar','daftar_book.*')
->get();
//$i=0;
$penghasilan = 0;
foreach ($data as $a){
$penghasilan += $a->total_pembayaran;
//$i++;
}
dd($data,$penghasilan);
dd('masuk',$request['bulan'],$request['nama_homestay'],$data);
return view('');
}
public function Allfeedback(){
$data = DB::table('homestay')
......
......@@ -78,6 +78,7 @@ class GuestController extends Controller
$ts = explode('-',$request['tanggal_selesai']);
$counter = 0;
$j=0;
//Mencocokkan data pesanan untuk mendapat current room avilable
foreach ($dataBook as $db){
......
@extends('adminlte::layouts.app')
@section('htmlheader_title')
{{ trans('adminlte_lang::message.home') }}
@endsection
@section('main-content')
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title"> DATA PEMESANAN </h3>
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
</div>
<div class="box-body">
<form action="{{url('caripesanan')}}">
<label>Bulan</label>
<input type="number" min="1" max="12" name="bulan">
<label>Nama Homestay</label>
<input type="text" name="nama_homestay">
<input type="submit" value="Cari">
</form>
<table class="table table-striped">
<tr>
<th>Nama 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
</table>
{!! $data->render() !!}
</div>
</div>
@endsection
......@@ -20,6 +20,13 @@
@endif
</div>
<div class="box-body">
<form action="{{url('caripesanan')}}">
<label>Bulan</label>
<input type="number" min="1" max="12" name="bulan">
<label>Nama Homestay</label>
<input type="text" name="nama_homestay">
<input type="submit" value="Cari">
</form>
<table class="table table-striped">
<tr>
<th>Nama Homestay</th>
......
......@@ -115,6 +115,7 @@ Route::group(['middleware' => 'customer'], function () {
Route::group(['middleware' => 'dinaspariwisata'], function () {
Route::get('caripesanan','AdminController@cariPesanan');
Route::resource('admin', 'AdminController');
Route::put('updateOwner/{id}','AdminController@updateOwner');
Route::get('ownerr/{id}','AdminController@owner');
......
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