Commit ed9f16f6 by Palti Sinaga

H-2 lagi

parents d5b22270 68ed2296
......@@ -127,12 +127,18 @@ 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);
$RF->status = 2;
$RF->update();
if($RF == null){
dd('nggak boleh gan');
}else{
$RF->status = 2;
return redirect('requestFasilitas');
$RF->update();
return redirect('requestFasilitas');
}
}
public function UpdateRequestFasilitas($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();
......
......@@ -73,6 +73,17 @@ class OwnerController extends Controller
// return view('adminlte::layouts.owner.listPesanan')->with('count',$data->count())->with('count1',$dataListOfBook->count())->with('count2',$dataFeedback->count())->with('dataF',$dataFeedback);
}
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