Commit fec25c07 by Juliper

no message

parent 94e74d1d
......@@ -157,13 +157,34 @@ class CustomerController extends Controller
->select('pemilikhomestay.*','homestay.*')
->where('homestay.id','=',$id)
->get();
//dd($data);
$daftarBook = DB::table('daftar_book')
->select('daftar_book.*')
->where('daftar_book.homestay','=',$id)
->get();
$now = new DateTime();
$nowCurrent = $now->format('Y-m-d');
//dd($nowCurrent);
$dataJumlahKamar = ListBook::all()->where('tanggal_mulai',$nowCurrent);
/*DB::table('daftar_book')
->select('daftar_book.jumlah_kamar')
->where('daftar_book.tanggal_mulai','=',$nowCurrent)
->get();*/
// dd($data);
$avilableRoom = 0;
if($dataJumlahKamar->count() == null){
//dd('disini aja');
$avilableRoom = $data[0]->jumlahKamar;
}else{
//dd($dataJumlahKamar);
$avilableRoom = $dataJumlahKamar[0]->jumlah_kamar;
}
$dataKamar = DB::table('kamar')
->select('kamar.*')
->where('kamar.idHomestay','=',$id)
......@@ -171,7 +192,7 @@ class CustomerController extends Controller
//dd("masuk agan",$id,$dataKamar);
return view('adminlte::layouts.pages.Homestay')->with('data',$data[0])->with('daftarBook',$daftarBook)->with('dataKamar',$dataKamar);
return view('adminlte::layouts.pages.Homestay')->with('data',$data[0])->with('daftarBook',$daftarBook)->with('dataKamar',$dataKamar)->with('avilable',$avilableRoom);
}
public function updateProfile(Request $request,$id){
......
......@@ -89,10 +89,11 @@
<li> Alamat : {{$data->alamat}}</li>
<li> Pekerjaan : {{$data->pekerjaan}}</li>
<li> No Rekening : {{$data->noRekening}}</li>
<li> Avilable Room : {{$avilable}}</li>
</ul>
</div>
<div class="col-md-6 col-sm-6 cuisines-grids agileits w3layouts cuisines-grids-2 wow slideInRight">
<img src="{{asset('img/project-1.jpg')}}" alt="Agileits W3layouts">
<img src="/img/{{$data->gambar}}" alt="Agileits W3layouts">
</div>
<!-- <div class="clearfix"></div> -->
<div class="col-md-12 col-sm-12 gallery-grids agileits w3layouts gallery-grids1 wow slideInLeft animated">
......
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