Commit d2dc83c4 by Juliper

perbaikan lagi

parent 0a508c47
...@@ -107,13 +107,13 @@ class AdminController extends Controller ...@@ -107,13 +107,13 @@ class AdminController extends Controller
return redirect(url('admin/create'))->with('info', 'User berhasil ditambah '); return redirect(url('admin/create'))->with('info', 'User berhasil ditambah ');
} }
//Menampilkan Daftar RequestHomestay //Menampilkan Daftar RequestHomestay
public function RequestHomestay(){ public function RequestHomestay(){
$data = DB::table('pemilikhomestay') $data = DB::table('pemilikhomestay')
->join('pengajuan_homestay','pemilikhomestay.id','=','pengajuan_homestay.id_pemilik_homestay') ->join('pengajuan_homestay','pemilikhomestay.id','=','pengajuan_homestay.id_pemilik_homestay')
->select('pemilikhomestay.nama','pengajuan_homestay.*') ->select('pemilikhomestay.nama','pengajuan_homestay.*')
->orderBy('pengajuan_homestay.id','desc')
->get(); ->get();
$count = $data->count(); $count = $data->count();
...@@ -148,6 +148,7 @@ class AdminController extends Controller ...@@ -148,6 +148,7 @@ class AdminController extends Controller
$data = DB::table('pemilikhomestay') $data = DB::table('pemilikhomestay')
->join('requestfasilitas','pemilikhomestay.id','=','requestfasilitas.id_pemilik_homestay') ->join('requestfasilitas','pemilikhomestay.id','=','requestfasilitas.id_pemilik_homestay')
->select('pemilikhomestay.nama','requestfasilitas.*') ->select('pemilikhomestay.nama','requestfasilitas.*')
->orderBy('requestfasilitas.id','desc')
->get(); ->get();
$count = $data->count(); $count = $data->count();
...@@ -155,6 +156,17 @@ class AdminController extends Controller ...@@ -155,6 +156,17 @@ class AdminController extends Controller
return view('adminlte::layouts.admin.listRequestFasilitas')->with('data',$data)->with('count',$count); return view('adminlte::layouts.admin.listRequestFasilitas')->with('data',$data)->with('count',$count);
} }
//Menolak pengajuan homestay
public function RejectPengajuanHomestay($id){
//dd($id,"masuk agan");
$RH = RequestHomestay::find($id);
$RH->status = 2;
$RH->update();
return redirect('requestHomestay');
}
//Penyetujuan Pengajuan Homestay //Penyetujuan Pengajuan Homestay
public function AccPengajuanHomestay($id){ public function AccPengajuanHomestay($id){
$RH = RequestHomestay::find($id); $RH = RequestHomestay::find($id);
......
...@@ -63,7 +63,7 @@ class CustomerController extends Controller ...@@ -63,7 +63,7 @@ class CustomerController extends Controller
->get(); ->get();
$feed = new Feedback(); $feed = new Feedback();
$feed->id_pemilik_homestay = $dataPemilik[0]->idPemilik; $feed->id_pemilik_homestay = $dataPemilik[0]->id_pemilik;
$feed->id_pelanggan = $dataPelanggan[0]->id; $feed->id_pelanggan = $dataPelanggan[0]->id;
$feed->feedback = $request['feedback']; $feed->feedback = $request['feedback'];
...@@ -110,6 +110,7 @@ class CustomerController extends Controller ...@@ -110,6 +110,7 @@ class CustomerController extends Controller
->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id') ->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id')
->select('transaksi.*','pemilikhomestay.nama','pemilikhomestay.no_rekening') ->select('transaksi.*','pemilikhomestay.nama','pemilikhomestay.no_rekening')
->where('transaksi.id_pelanggan','=',$data[0]->id) ->where('transaksi.id_pelanggan','=',$data[0]->id)
->orderBy('transaksi.id', 'desc')
->get(); ->get();
return view('adminlte::layouts.customers.History')->with('data',$dataTrans); return view('adminlte::layouts.customers.History')->with('data',$dataTrans);
......
...@@ -250,9 +250,9 @@ class OwnerController extends Controller ...@@ -250,9 +250,9 @@ class OwnerController extends Controller
->get(); ->get();
$dataHomestay = DB::table('homestay') $dataHomestay = DB::table('homestay')
->join('pemilikhomestay','homestay.idPemilik','pemilikhomestay.id') ->join('pemilikhomestay','homestay.id_pemilik','pemilikhomestay.id')
->select('homestay.id') ->select('homestay.id')
->where('homestay.idPemilik','=',$dataPemilik[0]->id) ->where('homestay.id_pemilik','=',$dataPemilik[0]->id)
->get(); ->get();
$lb->homestay = $dataHomestay[0]->id; $lb->homestay = $dataHomestay[0]->id;
...@@ -337,6 +337,7 @@ class OwnerController extends Controller ...@@ -337,6 +337,7 @@ class OwnerController extends Controller
->join('pelanggan','transaksi.id_pelanggan','=','pelanggan.id') ->join('pelanggan','transaksi.id_pelanggan','=','pelanggan.id')
->select('transaksi.*','pelanggan.nama','pelanggan.alamat','pelanggan.no_telepon') ->select('transaksi.*','pelanggan.nama','pelanggan.alamat','pelanggan.no_telepon')
->where('homestay.id_pemilik','=',$dataPel[0]->id) ->where('homestay.id_pemilik','=',$dataPel[0]->id)
->orderBy('transaksi.id','desc')
->get(); ->get();
return view('adminlte::layouts.owner.listPesanan')->with('data',$data)->with('count',$data->count()); return view('adminlte::layouts.owner.listPesanan')->with('data',$data)->with('count',$data->count());
...@@ -444,6 +445,7 @@ class OwnerController extends Controller ...@@ -444,6 +445,7 @@ class OwnerController extends Controller
->join('pemilikhomestay','pengajuan_homestay.id_pemilik_homestay','=','pemilikhomestay.id') ->join('pemilikhomestay','pengajuan_homestay.id_pemilik_homestay','=','pemilikhomestay.id')
->select('pemilikhomestay.nama','pengajuan_homestay.*') ->select('pemilikhomestay.nama','pengajuan_homestay.*')
->where('pengajuan_homestay.id_pemilik_homestay','=',$idPemilik[0]->id) ->where('pengajuan_homestay.id_pemilik_homestay','=',$idPemilik[0]->id)
->orderBy('pengajuan_homestay.id','desc')
->get(); ->get();
//dd('masuk'); //dd('masuk');
$count = $data->count(); $count = $data->count();
...@@ -464,6 +466,7 @@ class OwnerController extends Controller ...@@ -464,6 +466,7 @@ class OwnerController extends Controller
->join('pemilikhomestay','requestfasilitas.id_pemilik_homestay','=','pemilikhomestay.id') ->join('pemilikhomestay','requestfasilitas.id_pemilik_homestay','=','pemilikhomestay.id')
->select('pemilikhomestay.nama','requestfasilitas.*') ->select('pemilikhomestay.nama','requestfasilitas.*')
->where('requestfasilitas.id_pemilik_homestay','=',$idPemilik[0]->id) ->where('requestfasilitas.id_pemilik_homestay','=',$idPemilik[0]->id)
->orderBy('requestfasilitas.id','desc')
->get(); ->get();
$count = $data->count(); $count = $data->count();
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-apple"> Terima</i></button> <button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-apple"> Terima</i></button>
</form> </form>
<td> <td>
<form action="{{url('listPengajuanHomestay/'.$a->id)}}" method="post"> <form action="{{url('listPengajuanHmsty/'.$a->id)}}" method="post">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="_method" value="PUT"> <input type="hidden" name="_method" value="PUT">
<button type="submit" class="btn btn-danger"><i class="glyphicon glyphicon-trash"> Tolak</i></button> <button type="submit" class="btn btn-danger"><i class="glyphicon glyphicon-trash"> Tolak</i></button>
......
...@@ -54,12 +54,6 @@ ...@@ -54,12 +54,6 @@
<td> <td>
<img src="/img/{{ $a->bukti_pembayaran }}" style="width: 100px" alt="User Image" onclick="document.getElementById('modal').style.display='block'"/> <img src="/img/{{ $a->bukti_pembayaran }}" style="width: 100px" alt="User Image" onclick="document.getElementById('modal').style.display='block'"/>
<div id ="modal" class="w3-modal" onclick="this.style.display='none'">
<span class="w3-closebtn w3-hover-red w3-container w3-padding-hor-16 w3-display-topright">&times;</span>
<div class="w3-modal-content w3-animate-zoom">
<img src="/img/{{ $a->bukti_pembayaran }}" style="width:100%">
</div>
</div>
</td> </td>
<td> <td>
@if($a->status==0) @if($a->status==0)
......
...@@ -106,6 +106,7 @@ Route::group(['middleware' => 'dinaspariwisata'], function () { ...@@ -106,6 +106,7 @@ Route::group(['middleware' => 'dinaspariwisata'], function () {
Route::put('requestFasilitas/{id}','AdminController@UpdateRequestFasilitas'); Route::put('requestFasilitas/{id}','AdminController@UpdateRequestFasilitas');
Route::put('requestFasilitass/{id}','AdminController@UpdateRequestFasilitass'); Route::put('requestFasilitass/{id}','AdminController@UpdateRequestFasilitass');
Route::put('listPengajuanHomestay/{id}','AdminController@AccPengajuanHomestay'); Route::put('listPengajuanHomestay/{id}','AdminController@AccPengajuanHomestay');
Route::put('listPengajuanHmsty/{id}','AdminController@RejectPengajuanHomestay');
}); });
......
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