Commit 54b1e62b by Palti Sinaga
parents 1fdf0c33 835f365f
......@@ -173,10 +173,12 @@ class CustomerController extends Controller
$data = DB::table('homestay')
->join('kamar','homestay.id','=','kamar.idHomestay')
->select('kamar.*','homestay.harga')
->select('kamar.*','homestay.harga','homestay.')
->where('homestay.id','=',$request['id'])
->get();
dd($data);
$data2 = DB::table('users')
->join('pelanggan','users.id','=','pelanggan.id_Akun')
->select('pelanggan.id','pelanggan.nama')
......@@ -188,6 +190,7 @@ class CustomerController extends Controller
$baru = join('-',$time);
//Insert Table Transaksi
$trans = new Transaksi();
$trans->id_pelanggan = $data2[0]->id;
$trans->id_homestay = $request['id'];
......@@ -197,19 +200,18 @@ class CustomerController extends Controller
$trans->lama_menginap = $request['jumlah_hari'];
$trans->total_pembayaran = $request['jumlah_kamar'] * $data[0]->harga;
//Insert Table Daftar Booking
$lb->homestay = $request['id'];
$lb->nama_pemesan = $data2[0]->nama;
$lb->jumlah_kamar = $request['jumlah_kamar'];
$lb->tanggal_mulai = $request['tanggal'] ;
$lb->tanggal_berakhir = $baru;
//Save
$trans->save();
$lb->save();
return redirect()->action(
'CustomerController@detailhomestay', ['id' => $request['id']]
);
return redirect()->action('CustomerController@detailhomestay', ['id' => $request['id']]);
}
......
......@@ -50,6 +50,7 @@
<th> Nama Pemesan </th>
<th> Tanggal Mulai </th>
<th> Tanggal Berakhir </th>
<th> Jumlah Kamar</th>
</tr>
</thead>
<tbody>
......@@ -58,6 +59,7 @@
<td>{{$a->nama_pemesan}}</td>
<td>{{$a->tanggal_mulai}}</td>
<td>{{$a->tanggal_berakhir}}</td>
<td>{{$a->jumlah_kamar}}</td>
</tr>
@endforeach
</tbody>
......
......@@ -55,6 +55,7 @@ Route::get('DataPemesanan', function(){
Route::get('listPemesanan','AdminController@listPesanan');
Route::put('editRoom/{id}','OwnerController@updateRoom');
Route::get('editRoom/{id}','OwnerController@editRoom');
Route::get('daftarKamar','OwnerController@daftarKamar');
Route::get('pesanan','OwnerController@listTransaction');
......
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