Commit e7f8baf7 by Juliper

no message

parent 51e742ea
......@@ -169,6 +169,10 @@ class CustomerController extends Controller
}
public function booking(Request $request){
if(Auth::guest()){
dd("you must have account");
}
$lb = new ListBook();
$dataHomestay = DB::table('homestay')
......@@ -185,7 +189,7 @@ class CustomerController extends Controller
->get();
$dataBookingBerakhir = DB::table('daftar_book')
->select('daftar_book.*')
->where('daftar_book.tanggal_mulai','=',$request['tanggal'])
->where('daftar_book.tanggal_berakhir','=',$request['tanggal'])
->get();
if($dataBookingMulai->count() > 0){
......@@ -199,7 +203,16 @@ class CustomerController extends Controller
}
}else{
echo ('langsung aja');
if($dataBookingBerakhir->count() > 0){
$currentJumlahKamar2 = $homestayJumlahKamar[0]->jumlahKamar - $dataBookingBerakhir[0]->jumlah_kamar;
if($currentJumlahKamar2 >= $request['jumlah_kamar']){
dd('boleh aja agan');
}else{
dd('nggak boleh');
}
}else{
dd('masuk aja gan');
}
}
......@@ -213,7 +226,6 @@ class CustomerController extends Controller
->get();
//dd($dataHomestay,$dataPelanggan);
$time = explode('-', $request['tanggal']);
$time[2] +=$request['jumlah_hari'];
......
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