Commit 7af4b3ef by Juliper

no message

parent a5f736df
......@@ -127,13 +127,19 @@ class AdminController extends Controller
//Melakuan Aksi Untuk memproses Permintaan Admin
public function UpdateRequestFasilitass($id){
//$data = DB::table('requestfasilitas')->where('id', $id)->first();
$RF = RequestFasilitas::find($id);
if($RF == null){
dd('nggak boleh gan');
}else{
$RF->status = 2;
$RF->update();
return redirect('requestFasilitas');
}
}
public function UpdateRequestFasilitas($id){
$RF = RequestFasilitas::find($id);
......
......@@ -76,6 +76,7 @@ class GuestController extends Controller
$daftarBook = DB::table('daftar_book')
->select('daftar_book.*')
->where('daftar_book.homestay','=',$id)
->where('daftar_book.status','=',1)
->get();
$now = new DateTime();
......
......@@ -59,6 +59,17 @@ class OwnerController extends Controller
return view('adminlte::layouts.owner.home')->with('count',$data->count())->with('count1',$dataListOfBook->count())->with('count2',$dataFeedback->count());
}
public function Checkout($id){
$dataPesanan = ListBook::find($id);
$dataPesanan->status = 0;
$dataPesanan->update();
return redirect('daftarBooking');
}
//Menyimpan Data untuk di update
public function updateProfil(Request $request,$id){
......
......@@ -33,6 +33,7 @@
<th>Tanggal Mulai</th>
<th>Tanggal Berakhir</th>
<th>Jumlah Kamar</th>
<th></th>
</tr>
@foreach($data as $a)
<tr>
......@@ -40,6 +41,16 @@
<td>{{$a->tanggal_mulai}}</td>
<td>{{$a->tanggal_berakhir}}</td>
<td>{{$a->jumlah_kamar}}</td>
<td>
@if($a->status==0) Pengunjung sudah checkout
@else
<form action="{{url('checkout/'.$a->id)}}" method="post">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-apple"> Checkout</i></button>
</form>
@endif
</td>
</tr>
@endforeach
</table>
......
......@@ -55,6 +55,7 @@ Route::get('DataPemesanan', function(){
});
Route::group(['middleware' => 'owner'], function () {
Route::put('checkout/{id}','OwnerController@Checkout');
Route::put('editRoom/{id}','OwnerController@updateRoom');
Route::post('addManual','OwnerController@addBookManual');
Route::put('konfirmasiPemesanan/{id}','OwnerController@konfirmasiPemesanan');
......
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