Commit db6e70c2 by Juliper

no message

parent 7cc7e5c2
...@@ -33,7 +33,7 @@ class AdminController extends Controller ...@@ -33,7 +33,7 @@ class AdminController extends Controller
$data = DB::table('homestay') $data = DB::table('homestay')
->join('daftar_book','homestay.id','=','daftar_book.homestay') ->join('daftar_book','homestay.id','=','daftar_book.homestay')
->select('daftar_book.*','homestay.namaHomestay','homestay.owner') ->select('daftar_book.*','homestay.nama_homestay','homestay.owner')
->get(); ->get();
return view('adminlte::layouts.admin.dataPemesanan')->with('data',$data); return view('adminlte::layouts.admin.dataPemesanan')->with('data',$data);
...@@ -88,8 +88,8 @@ class AdminController extends Controller ...@@ -88,8 +88,8 @@ class AdminController extends Controller
$owner->nama = $data['name']; $owner->nama = $data['name'];
$owner->alamat = '--'; $owner->alamat = '--';
$owner->pekerjaan = '--'; $owner->pekerjaan = '--';
$owner->noTelepon = '--'; $owner->no_telepon = '--';
$owner->noRekening = '--'; $owner->no_rekening = '--';
$owner->foto = 'gravatar.png'; $owner->foto = 'gravatar.png';
$user->save(); $user->save();
...@@ -102,7 +102,7 @@ class AdminController extends Controller ...@@ -102,7 +102,7 @@ class AdminController extends Controller
public function RequestHomestay(){ public function RequestHomestay(){
$data = DB::table('pemilikhomestay') $data = DB::table('pemilikhomestay')
->join('pengajuan_homestay','pemilikhomestay.id','=','pengajuan_homestay.idPemilikHomestay') ->join('pengajuan_homestay','pemilikhomestay.id','=','pengajuan_homestay.id_pemilik_homestay')
->select('pemilikhomestay.nama','pengajuan_homestay.*') ->select('pemilikhomestay.nama','pengajuan_homestay.*')
->get(); ->get();
...@@ -124,9 +124,6 @@ class AdminController extends Controller ...@@ -124,9 +124,6 @@ class AdminController extends Controller
} }
public function UpdateRequestFasilitas($id){ public function UpdateRequestFasilitas($id){
//$data = DB::table('requestfasilitas')->where('id', $id)->first();
$RF = RequestFasilitas::find($id); $RF = RequestFasilitas::find($id);
$RF->status = 1; $RF->status = 1;
...@@ -154,17 +151,17 @@ class AdminController extends Controller ...@@ -154,17 +151,17 @@ class AdminController extends Controller
$RH->status = 1; $RH->status = 1;
$data = DB::table('pengajuan_homestay') $data = DB::table('pengajuan_homestay')
->join('pemilikhomestay','pemilikhomestay.id','=','pengajuan_homestay.idPemilikHomestay') ->join('pemilikhomestay','pemilikhomestay.id','=','pengajuan_homestay.id_pemilik_homestay')
->select('pemilikhomestay.nama','pemilikhomestay.alamat') ->select('pemilikhomestay.nama','pemilikhomestay.alamat')
->where('pemilikhomestay.id','=',$RH->idPemilikHomestay) ->where('pemilikhomestay.id','=',$RH->idPemilikHomestay)
->get(); ->get();
$hs = new Homestay(); $hs = new Homestay();
$hs->idPemilik = $RH->idPemilikHomestay; $hs->id_pemilik = $RH->idPemilikHomestay;
$hs->namaHomestay = $RH->namaHomestay; $hs->nama_homestay = $RH->namaHomestay;
$hs->owner = $data[0]->nama ; $hs->owner = $data[0]->nama ;
$hs->alamat = $data[0]->alamat; $hs->alamat = $data[0]->alamat;
$hs->jumlahKamar = $RH->jumlahKamar; $hs->jumlah_kamar = $RH->jumlahKamar;
$hs->harga = 150000; $hs->harga = 150000;
$hs->status='----'; $hs->status='----';
...@@ -175,9 +172,9 @@ class AdminController extends Controller ...@@ -175,9 +172,9 @@ class AdminController extends Controller
->where('homestay.owner','=',$data[0]->nama) ->where('homestay.owner','=',$data[0]->nama)
->get(); ->get();
for ($i = 1;$i<=$RH->jumlahKamar;$i++){ for ($i = 1;$i<=$RH->jumlah_kamar;$i++){
$km = new Room(); $km = new Room();
$km->idHomestay = $idHts[0]->id; $km->id_homestay = $idHts[0]->id;
$km->nomor_kamar = $i; $km->nomor_kamar = $i;
$km->jumlah_bed = 2; $km->jumlah_bed = 2;
$km->save(); $km->save();
...@@ -185,5 +182,5 @@ class AdminController extends Controller ...@@ -185,5 +182,5 @@ class AdminController extends Controller
$RH->update(); $RH->update();
return redirect('requestHomestay'); return redirect('requestHomestay');
} }
} }
...@@ -55,7 +55,7 @@ class LoginController extends Controller ...@@ -55,7 +55,7 @@ class LoginController extends Controller
if (Auth::attempt(['username' => $request->username, 'password' => $request->password])) { if (Auth::attempt(['username' => $request->username, 'password' => $request->password])) {
//dd(Auth::user()->role); //dd(Auth::user()->role);
if (Auth::user()->role == 'Admin') { if (Auth::user()->role == 'Admin') {
return redirect()->intended('/admin'); return redirect()->intended('/home');
} }
else if(Auth::user()->role == 'Owner'){ else if(Auth::user()->role == 'Owner'){
return redirect()->intended('/owner'); return redirect()->intended('/owner');
......
...@@ -48,17 +48,17 @@ class CustomerController extends Controller ...@@ -48,17 +48,17 @@ class CustomerController extends Controller
$dataPelanggan = DB::table('pelanggan') $dataPelanggan = DB::table('pelanggan')
->select('pelanggan.id') ->select('pelanggan.id')
->where('pelanggan.id_Akun','=',Auth::user()->id) ->where('pelanggan.id_akun','=',Auth::user()->id)
->get(); ->get();
$dataPemilik = DB::table('homestay') $dataPemilik = DB::table('homestay')
->select('homestay.idPemilik') ->select('homestay.id_pemilik')
->where('homestay.id','=',$id) ->where('homestay.id','=',$id)
->get(); ->get();
$feed = new Feedback(); $feed = new Feedback();
$feed->id_pemilikHomestay = $dataPemilik[0]->idPemilik; $feed->id_pemilik_homestay = $dataPemilik[0]->idPemilik;
$feed->idPelanggan = $dataPelanggan[0]->id; $feed->id_pelanggan = $dataPelanggan[0]->id;
$feed->feedback = $request['feedback']; $feed->feedback = $request['feedback'];
$feed->save(); $feed->save();
...@@ -96,13 +96,13 @@ class CustomerController extends Controller ...@@ -96,13 +96,13 @@ class CustomerController extends Controller
public function history(){ public function history(){
$data = DB::table('pelanggan') $data = DB::table('pelanggan')
->select('pelanggan.*') ->select('pelanggan.*')
->where('pelanggan.id_Akun','=',Auth::user()->id) ->where('pelanggan.id_akun','=',Auth::user()->id)
->get(); ->get();
$dataTrans = DB::table('homestay') $dataTrans = DB::table('homestay')
->join('transaksi','homestay.id','=','transaksi.id_homestay') ->join('transaksi','homestay.id','=','transaksi.id_homestay')
->join('pemilikhomestay','homestay.idPemilik','=','pemilikhomestay.id') ->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id')
->select('transaksi.*','pemilikhomestay.nama','pemilikhomestay.noRekening') ->select('transaksi.*','pemilikhomestay.nama','pemilikhomestay.no_rekening')
->where('transaksi.id_pelanggan','=',$data[0]->id) ->where('transaksi.id_pelanggan','=',$data[0]->id)
->get(); ->get();
...@@ -113,7 +113,7 @@ class CustomerController extends Controller ...@@ -113,7 +113,7 @@ class CustomerController extends Controller
public function profile(){ public function profile(){
$data = DB::table('pelanggan') $data = DB::table('pelanggan')
->select('pelanggan.*') ->select('pelanggan.*')
->where('pelanggan.id_Akun','=',Auth::user()->id) ->where('pelanggan.id_akun','=',Auth::user()->id)
->get(); ->get();
return view('adminlte::layouts.customers.profiles')->with('data',$data[0]); return view('adminlte::layouts.customers.profiles')->with('data',$data[0]);
...@@ -136,10 +136,10 @@ class CustomerController extends Controller ...@@ -136,10 +136,10 @@ class CustomerController extends Controller
->get(); ->get();
$cus = new Customer(); $cus = new Customer();
$cus->id_Akun = $dataPel[0]->id; $cus->id_akun = $dataPel[0]->id;
$cus->nama = $data['name'] ; $cus->nama = $data['name'] ;
$cus->alamat = "---"; $cus->alamat = "---";
$cus->noTelepon = "---"; $cus->no_telepon = "---";
$cus->pekerjaan = "---"; $cus->pekerjaan = "---";
$cus->save(); $cus->save();
...@@ -168,7 +168,7 @@ class CustomerController extends Controller ...@@ -168,7 +168,7 @@ class CustomerController extends Controller
$cus->alamat = $request['alamat']; $cus->alamat = $request['alamat'];
$cus->pekerjaan = $request['pekerjaan']; $cus->pekerjaan = $request['pekerjaan'];
$cus->noTelepon = $request['noTelepon']; $cus->no_telepon = $request['noTelepon'];
if($request->file('foto')==null){ if($request->file('foto')==null){
$dataUs->foto = $dataUs->foto; $dataUs->foto = $dataUs->foto;
...@@ -207,30 +207,34 @@ class CustomerController extends Controller ...@@ -207,30 +207,34 @@ class CustomerController extends Controller
$lb = new ListBook(); $lb = new ListBook();
$dataHomestay = DB::table('homestay') $dataHomestay = DB::table('homestay')
->join('kamar','homestay.id','=','kamar.idHomestay') ->join('kamar','homestay.id','=','kamar.id_homestay')
->select('kamar.*','homestay.harga','homestay.jumlahKamar') ->select('kamar.*','homestay.harga','homestay.jumlahKamar')
->where('homestay.id','=',$request['id']) ->where('homestay.id','=',$request['id'])
->get(); ->get();
$dataPemilik = DB::table('homestay') $dataPemilik = DB::table('homestay')
->join('pemilikhomestay','homestay.idPemilik','pemilikhomestay.id') ->join('pemilikhomestay','homestay.id_pemilik','pemilikhomestay.id')
->select('pemilikhomestay.noTelepon') ->select('pemilikhomestay.no_telepon')
->where('homestay.id','=',$request['id']) ->where('homestay.id','=',$request['id'])
->get(); ->get();
$homestayJumlahKamar = DB::table('homestay')->select('homestay.jumlahKamar')->where('homestay.id','=',$request['id'])->get(); $homestayJumlahKamar = DB::table('homestay')
->select('homestay.jumlah_kamar')
->where('homestay.id','=',$request['id'])
->get();
$dataBookingMulai = DB::table('daftar_book') $dataBookingMulai = DB::table('daftar_book')
->select('daftar_book.*') ->select('daftar_book.*')
->where('daftar_book.tanggal_mulai','=',$request['tanggal']) ->where('daftar_book.tanggal_mulai','=',$request['tanggal'])
->get(); ->get();
$dataBookingBerakhir = DB::table('daftar_book') $dataBookingBerakhir = DB::table('daftar_book')
->select('daftar_book.*') ->select('daftar_book.*')
->where('daftar_book.tanggal_berakhir','=',$request['tanggal']) ->where('daftar_book.tanggal_berakhir','=',$request['tanggal'])
->get(); ->get();
if($dataBookingMulai->count() > 0){ if($dataBookingMulai->count() > 0){
$currentJumlahKamar = $homestayJumlahKamar[0]->jumlahKamar - $dataBookingMulai[0]->jumlah_kamar; $currentJumlahKamar = $homestayJumlahKamar[0]->jumlah_kamar - $dataBookingMulai[0]->jumlah_kamar;
if($currentJumlahKamar >= $request['jumlah_kamar']){ if($currentJumlahKamar >= $request['jumlah_kamar']){
...@@ -241,7 +245,7 @@ class CustomerController extends Controller ...@@ -241,7 +245,7 @@ class CustomerController extends Controller
}else{ }else{
if($dataBookingBerakhir->count() > 0){ if($dataBookingBerakhir->count() > 0){
$currentJumlahKamar2 = $homestayJumlahKamar[0]->jumlahKamar - $dataBookingBerakhir[0]->jumlah_kamar; $currentJumlahKamar2 = $homestayJumlahKamar[0]->jumlah_kamar - $dataBookingBerakhir[0]->jumlah_kamar;
if($currentJumlahKamar2 >= $request['jumlah_kamar']){ if($currentJumlahKamar2 >= $request['jumlah_kamar']){
dd('boleh aja agan'); dd('boleh aja agan');
}else{ }else{
...@@ -251,7 +255,7 @@ class CustomerController extends Controller ...@@ -251,7 +255,7 @@ class CustomerController extends Controller
} }
$dataPelanggan = DB::table('users') $dataPelanggan = DB::table('users')
->join('pelanggan','users.id','=','pelanggan.id_Akun') ->join('pelanggan','users.id','=','pelanggan.id_akun')
->select('pelanggan.id','pelanggan.nama') ->select('pelanggan.id','pelanggan.nama')
->where('users.id','=',Auth::user()->id) ->where('users.id','=',Auth::user()->id)
->get(); ->get();
...@@ -320,7 +324,7 @@ class CustomerController extends Controller ...@@ -320,7 +324,7 @@ class CustomerController extends Controller
$lb->save(); $lb->save();
Nexmo::message()->send([ Nexmo::message()->send([
'to' => $dataPemilik[0]->noTelepon, 'to' => $dataPemilik[0]->no_telepon,
'from' => 'ASDASD', 'from' => 'ASDASD',
'text' => 'Hi ini hanya sebuah test no more' 'text' => 'Hi ini hanya sebuah test no more'
]); ]);
......
...@@ -41,7 +41,7 @@ class GuestController extends Controller ...@@ -41,7 +41,7 @@ class GuestController extends Controller
public function detailhomestay($id){ public function detailhomestay($id){
$data = DB::table('homestay') $data = DB::table('homestay')
->join('pemilikhomestay','homestay.idPemilik','=','pemilikhomestay.id') ->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id')
->select('pemilikhomestay.*','homestay.*') ->select('pemilikhomestay.*','homestay.*')
->where('homestay.id','=',$id) ->where('homestay.id','=',$id)
->get(); ->get();
...@@ -59,14 +59,14 @@ class GuestController extends Controller ...@@ -59,14 +59,14 @@ class GuestController extends Controller
$avilableRoom = 0; $avilableRoom = 0;
if($dataJumlahKamar->count() == null){ if($dataJumlahKamar->count() == null){
$avilableRoom = $data[0]->jumlahKamar; $avilableRoom = $data[0]->jumlah_kamar;
}else{ }else{
$avilableRoom = $dataJumlahKamar[0]->jumlah_kamar; $avilableRoom = $dataJumlahKamar[0]->jumlah_kamar;
} }
$dataKamar = DB::table('kamar') $dataKamar = DB::table('kamar')
->select('kamar.*') ->select('kamar.*')
->where('kamar.idHomestay','=',$id) ->where('kamar.id_homestay','=',$id)
->get(); ->get();
return view('adminlte::layouts.pages.Homestay')->with('data',$data[0])->with('daftarBook',$daftarBook)->with('dataKamar',$dataKamar)->with('avilable',$avilableRoom); return view('adminlte::layouts.pages.Homestay')->with('data',$data[0])->with('daftarBook',$daftarBook)->with('dataKamar',$dataKamar)->with('avilable',$avilableRoom);
......
...@@ -41,8 +41,8 @@ class OwnerController extends Controller ...@@ -41,8 +41,8 @@ class OwnerController extends Controller
$owner->nama = $request['nama']; $owner->nama = $request['nama'];
$owner->alamat = $request['alamat']; $owner->alamat = $request['alamat'];
$owner->pekerjaan = $request['pekerjaan']; $owner->pekerjaan = $request['pekerjaan'];
$owner->noTelepon = $request['noTelepon']; $owner->no_telepon = $request['noTelepon'];
$owner->noRekening = $request['noRekening']; $owner->no_rekening = $request['noRekening'];
if($request->file('picture')==null){ if($request->file('picture')==null){
$owner->foto = $owner->foto; $owner->foto = $owner->foto;
...@@ -79,13 +79,13 @@ class OwnerController extends Controller ...@@ -79,13 +79,13 @@ class OwnerController extends Controller
public function feddback(){ public function feddback(){
$dataPemilik = DB::table('pemilikhomestay') $dataPemilik = DB::table('pemilikhomestay')
->select('pemilikhomestay.id') ->select('pemilikhomestay.id')
->where('pemilikhomestay.id_Akun','=',Auth::user()->id) ->where('pemilikhomestay.id_akun','=',Auth::user()->id)
->get(); ->get();
$dataFeedback = DB::table('feedback') $dataFeedback = DB::table('feedback')
->join('pelanggan','feedback.idPelanggan','pelanggan.id') ->join('pelanggan','feedback.id_pelanggan','pelanggan.id')
->select('feedback.*','pelanggan.nama') ->select('feedback.*','pelanggan.nama')
->where('feedback.id_pemilikHomestay','=',$dataPemilik[0]->id) ->where('feedback.id_pemilik_homestay','=',$dataPemilik[0]->id)
->get(); ->get();
return view('adminlte::layouts.owner.listfeedback')->with('data',$dataFeedback); return view('adminlte::layouts.owner.listfeedback')->with('data',$dataFeedback);
...@@ -107,7 +107,7 @@ class OwnerController extends Controller ...@@ -107,7 +107,7 @@ class OwnerController extends Controller
$updateHomestay = Homestay::find($id); $updateHomestay = Homestay::find($id);
$updateHomestay->namaHomestay = $request['namaUpdate']; $updateHomestay->nama_homestay = $request['namaUpdate'];
$updateHomestay->alamat = $request['alamatUpdate']; $updateHomestay->alamat = $request['alamatUpdate'];
$updateHomestay->harga = $request['hargaUpdate']; $updateHomestay->harga = $request['hargaUpdate'];
...@@ -135,12 +135,12 @@ class OwnerController extends Controller ...@@ -135,12 +135,12 @@ class OwnerController extends Controller
public function update(){ public function update(){
$dataPemilik = DB::table('pemilikhomestay') $dataPemilik = DB::table('pemilikhomestay')
->select('pemilikhomestay.id') ->select('pemilikhomestay.id')
->where('pemilikhomestay.id_Akun','=',Auth::user()->id) ->where('pemilikhomestay.id_akun','=',Auth::user()->id)
->get(); ->get();
$dataHomestay = DB::table('homestay') $dataHomestay = DB::table('homestay')
->select('homestay.*') ->select('homestay.*')
->where('homestay.idPemilik','=',$dataPemilik[0]->id) ->where('homestay.id_pemilik','=',$dataPemilik[0]->id)
->get(); ->get();
return view('adminlte::layouts.owner.UpdateHomestay')->with('data',$dataHomestay[0]); return view('adminlte::layouts.owner.UpdateHomestay')->with('data',$dataHomestay[0]);
...@@ -168,12 +168,12 @@ class OwnerController extends Controller ...@@ -168,12 +168,12 @@ class OwnerController extends Controller
public function listOfBook(){ public function listOfBook(){
$dataPemilik = DB::table('pemilikhomestay') $dataPemilik = DB::table('pemilikhomestay')
->select('pemilikhomestay.id') ->select('pemilikhomestay.id')
->where('pemilikhomestay.id_Akun','=',Auth::user()->id) ->where('pemilikhomestay.id_akun','=',Auth::user()->id)
->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('pemilikhomestay.id','=',$dataPemilik[0]->id) ->where('pemilikhomestay.id','=',$dataPemilik[0]->id)
->get(); ->get();
...@@ -272,16 +272,16 @@ class OwnerController extends Controller ...@@ -272,16 +272,16 @@ class OwnerController extends Controller
$dataPemilik = DB::table('pemilikhomestay') $dataPemilik = DB::table('pemilikhomestay')
->select('pemilikhomestay.*') ->select('pemilikhomestay.*')
->where('pemilikhomestay.id_Akun','=',Auth::user()->id) ->where('pemilikhomestay.id_akun','=',Auth::user()->id)
->get(); ->get();
$data = DB::table('homestay') $data = DB::table('homestay')
->join('pemilikhomestay','homestay.idPemilik','pemilikhomestay.id') ->join('pemilikhomestay','homestay.id_pemilik','pemilikhomestay.id')
->join('kamar','homestay.id','=','kamar.idHomestay') ->join('kamar','homestay.id','=','kamar.id_homestay')
->select('kamar.*') ->select('kamar.*')
->where('pemilikhomestay.id','=',$dataPemilik[0]->id) ->where('pemilikhomestay.id','=',$dataPemilik[0]->id)
->get(); ->get();
//dd($data);
return view('adminlte::layouts.owner.listRoom')->with('data',$data)->with('count',$data->count()); return view('adminlte::layouts.owner.listRoom')->with('data',$data)->with('count',$data->count());
} }
...@@ -290,15 +290,15 @@ class OwnerController extends Controller ...@@ -290,15 +290,15 @@ class OwnerController extends Controller
$dataPel = DB::table('pemilikhomestay') $dataPel = DB::table('pemilikhomestay')
->select('pemilikhomestay.*') ->select('pemilikhomestay.*')
->where('pemilikhomestay.id_Akun','=',Auth::user()->id) ->where('pemilikhomestay.id_akun','=',Auth::user()->id)
->get(); ->get();
$data = DB::table('homestay') $data = DB::table('homestay')
->join('pemilikhomestay','homestay.idPemilik','=','pemilikhomestay.id') ->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id')
->join('transaksi','homestay.id','=','transaksi.id_homestay') ->join('transaksi','homestay.id','=','transaksi.id_homestay')
->join('pelanggan','transaksi.id_pelanggan','=','pelanggan.id') ->join('pelanggan','transaksi.id_pelanggan','=','pelanggan.id')
->select('transaksi.*','pelanggan.nama','pelanggan.alamat','pelanggan.noTelepon') ->select('transaksi.*','pelanggan.nama','pelanggan.alamat','pelanggan.no_telepon')
->where('homestay.idPemilik','=',$dataPel[0]->id) ->where('homestay.id_pemilik','=',$dataPel[0]->id)
->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());
...@@ -323,15 +323,15 @@ class OwnerController extends Controller ...@@ -323,15 +323,15 @@ class OwnerController extends Controller
]); ]);
$idPemilik = DB::table('users') $idPemilik = DB::table('users')
->join('pemilikhomestay','users.id','=','pemilikhomestay.id_Akun') ->join('pemilikhomestay','users.id','=','pemilikhomestay.id_akun')
->select('pemilikhomestay.id') ->select('pemilikhomestay.id')
->where('users.id', '=', Auth::user()->id) ->where('users.id', '=', Auth::user()->id)
->get(); ->get();
$data = new RequestFasilitas(); $data = new RequestFasilitas();
$data->id_pemilik_homestay = $idPemilik[0]->id; $data->id_pemilik_homestay = $idPemilik[0]->id;
$data->id_kategoriFasiltas = $request['id_kategoriFasiltas']; $data->id_kategoriFasiltas = $request['id_kategori_fasiltas'];
$data->namaRequestFasilitas = $request['namaRequestFasilitas']; $data->namaRequestFasilitas = $request['namaRequest_fasilitas'];
$data->deskripsi = $request['deskripsi']; $data->deskripsi = $request['deskripsi'];
$data->jumlah = $request['jumlah']; $data->jumlah = $request['jumlah'];
...@@ -368,16 +368,16 @@ class OwnerController extends Controller ...@@ -368,16 +368,16 @@ class OwnerController extends Controller
]); ]);
$idPemilik = DB::table('users') $idPemilik = DB::table('users')
->join('pemilikhomestay','users.id','=','pemilikhomestay.id_Akun') ->join('pemilikhomestay','users.id','=','pemilikhomestay.id_akun')
->select('pemilikhomestay.id') ->select('pemilikhomestay.id')
->where('users.id', '=', Auth::user()->id) ->where('users.id', '=', Auth::user()->id)
->get(); ->get();
$data = new RequestHomestay(); $data = new RequestHomestay();
$data->idPemilikHomestay = $idPemilik[0]->id; $data->id_pemili_homestay = $idPemilik[0]->id;
$data->namaHomestay = $request['namaHomestay']; $data->nama_homestay = $request['namaHomestay'];
$data->jumlahKamar = $request['jumlahKamar']; $data->jumlah_kamar = $request['jumlahKamar'];
$data->status = 0; $data->status = 0;
$data->save(); $data->save();
...@@ -389,15 +389,15 @@ class OwnerController extends Controller ...@@ -389,15 +389,15 @@ class OwnerController extends Controller
public function listPengajuan(){ public function listPengajuan(){
$idPemilik = DB::table('users') $idPemilik = DB::table('users')
->join('pemilikhomestay','users.id','=','pemilikhomestay.id_Akun') ->join('pemilikhomestay','users.id','=','pemilikhomestay.id_akun')
->select('pemilikhomestay.id') ->select('pemilikhomestay.id')
->where('users.id', '=', Auth::user()->id) ->where('users.id', '=', Auth::user()->id)
->get(); ->get();
$data = DB::table('pengajuan_homestay') $data = DB::table('pengajuan_homestay')
->join('pemilikhomestay','pengajuan_homestay.idPemilikHomestay','=','pemilikhomestay.id') ->join('pemilikhomestay','pengajuan_homestay.id_pemilik_homestay','=','pemilikhomestay.id')
->select('pemilikhomestay.nama','pengajuan_homestay.*') ->select('pemilikhomestay.nama','pengajuan_homestay.*')
->where('pengajuan_homestay.idPemilikHomestay','=',$idPemilik[0]->id) ->where('pengajuan_homestay.id_pemilik_homestay','=',$idPemilik[0]->id)
->get(); ->get();
$count = $data->count(); $count = $data->count();
...@@ -408,7 +408,7 @@ class OwnerController extends Controller ...@@ -408,7 +408,7 @@ class OwnerController extends Controller
//Melihat Daftar Pengajuan Fasilitas //Melihat Daftar Pengajuan Fasilitas
public function listPengajuanFasilitas(){ public function listPengajuanFasilitas(){
$idPemilik = DB::table('users') $idPemilik = DB::table('users')
->join('pemilikhomestay','users.id','=','pemilikhomestay.id_Akun') ->join('pemilikhomestay','users.id','=','pemilikhomestay.id_akun')
->select('pemilikhomestay.id') ->select('pemilikhomestay.id')
->where('users.id', '=', Auth::user()->id) ->where('users.id', '=', Auth::user()->id)
->get(); ->get();
......
...@@ -18,11 +18,11 @@ class Owner ...@@ -18,11 +18,11 @@ class Owner
{ {
if(Auth::check()){ if(Auth::check()){
if(Auth::user()->role != 'Owner'){ if(Auth::user()->role != 'Owner'){
dd('masuk di midle gan'); redirect('login');
if(Auth::user()->role == 'Customer'){ if(Auth::user()->role == 'Customer'){
return redirect(''); return redirect('');
}elseif(Auth::user()->role == 'DinasPariwisata'){ }elseif(Auth::user()->role == 'DinasPariwisata'){
return redirect('/'); return redirect('admin');
}else{ }else{
return redirect('owner'); return redirect('owner');
} }
......
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
<td>{{$a->nama}}</td> <td>{{$a->nama}}</td>
<td>{{$a->namaHomestay}}</td> <td>{{$a->nama_homestay}}</td>
<td>{{$a->jumlahKamar}}</td> <td>{{$a->jumlah_kamar}}</td>
@if($a->status==1) @if($a->status==1)
<td>Di Terima</td> <td>Di Terima</td>
@elseif($a->status==2) @elseif($a->status==2)
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
<td>{{$a->nama}}</td> <td>{{$a->nama}}</td>
<td>{{$a->namaRequestFasilitas}}</td> <td>{{$a->nama_request_fasilitas}}</td>
<td>{{$a->deskripsi}}</td> <td>{{$a->deskripsi}}</td>
<td>{{$a->jumlah}}</td> <td>{{$a->jumlah}}</td>
<td>@if($a->gambar==null) <td>@if($a->gambar==null)
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<tbody> <tbody>
@foreach($data as $a) @foreach($data as $a)
<tr class="success"> <tr class="success">
<td>{{$a->noRekening}}</td> <td>{{$a->no_rekening}}</td>
<td>{{$a->nama}}</td> <td>{{$a->nama}}</td>
<td>{{$a->total_pembayaran}}</td> <td>{{$a->total_pembayaran}}</td>
<td> <td>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="form-group"> <div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">No.Telepon</label> <label for="inputPassword3" class="col-sm-2 control-label">No.Telepon</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" name="noTelepon" class="form-control" id="inputPassword3" value="{{$data->noTelepon}}"> <input type="text" name="noTelepon" class="form-control" id="inputPassword3" value="{{$data->no_telepon}}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
<td>{{$a->nama}}</td> <td>{{$a->nama}}</td>
<td>{{$a->namaRequestFasilitas}}</td> <td>{{$a->nama_request_fasilitas}}</td>
<td>{{$a->deskripsi}}</td> <td>{{$a->deskripsi}}</td>
<td>{{$a->jumlah}}</td> <td>{{$a->jumlah}}</td>
<td> <td>
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
<td>{{$a->nama}}</td> <td>{{$a->nama}}</td>
<td>{{$a->namaHomestay}}</td> <td>{{$a->nama_homestay}}</td>
<td>{{$a->jumlahKamar}}</td> <td>{{$a->jumlah_kamar}}</td>
<td>@if($a->status==0) Sedang Menunggu <td>@if($a->status==0) Sedang Menunggu
@elseif($a->status==1) Diterima @elseif($a->status==1) Diterima
@elseif($a->status==2) Ditolak @elseif($a->status==2) Ditolak
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-bookmark"></i> <i class="fa fa-bookmark"></i>
</div> </div>
<input type="text" class="form-control" placeholder="Nama Request Fasilitas" name="namaUpdate" value="{{$data->namaHomestay}}"/> <input type="text" class="form-control" placeholder="Nama Request Fasilitas" name="namaUpdate" value="{{$data->nama_homestay}}"/>
</div> </div>
</div> </div>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<tr> <tr>
<td>{{$a->nama}}</td> <td>{{$a->nama}}</td>
<td>{{$a->alamat}}</td> <td>{{$a->alamat}}</td>
<td>{{$a->noTelepon}}</td> <td>{{$a->no_telepon}}</td>
<td>{{$a->tanggal_mulai}}</td> <td>{{$a->tanggal_mulai}}</td>
<td>{{$a->tanggal_berakhir}}</td> <td>{{$a->tanggal_berakhir}}</td>
<td>{{$a->lama_menginap}} Hari</td> <td>{{$a->lama_menginap}} Hari</td>
......
...@@ -37,12 +37,12 @@ ...@@ -37,12 +37,12 @@
<tr> <tr>
<th>No Telepon</th> <th>No Telepon</th>
<td>: </td> <td>: </td>
<td>{{$data->noTelepon}}</td> <td>{{$data->no_telepon}}</td>
</tr> </tr>
<tr> <tr>
<th>No Rekening </th> <th>No Rekening </th>
<td>: </td> <td>: </td>
<td>{{$data->noRekening}}</td> <td>{{$data->no_rekening}}</td>
</tr> </tr>
</table> </table>
</div> </div>
......
...@@ -36,9 +36,9 @@ ...@@ -36,9 +36,9 @@
<label>Pekerjaan</label> <label>Pekerjaan</label>
<input type="text" name="pekerjaan" value="{{$data->pekerjaan}}" id="pekerjaan" class="form-control"> <input type="text" name="pekerjaan" value="{{$data->pekerjaan}}" id="pekerjaan" class="form-control">
<label>Nomor Telepon</label> <label>Nomor Telepon</label>
<input type="text" name="noTelepon" value="{{$data->noTelepon}}" id="noTelepon" class="form-control"> <input type="text" name="noTelepon" value="{{$data->no_telepon}}" id="noTelepon" class="form-control">
<label>Nomor Rekening</label> <label>Nomor Rekening</label>
<input type="text" name="noRekening" value="{{$data->noRekening}}" id="noRekening" class="form-control"> <input type="text" name="noRekening" value="{{$data->no_rekening}}" id="noRekening" class="form-control">
<label>Foto</label> <label>Foto</label>
<input type="file" name="picture" id="picture" class="form-control"><br> <input type="file" name="picture" id="picture" class="form-control"><br>
<div class="form-group" align="right"> <div class="form-group" align="right">
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="banner agileits w3layouts"> <div class="banner agileits w3layouts">
<img src="{{asset('/img/'.$data->gambar)}}" alt="Agileits W3layouts" style="max-height:500px; width:"> <img src="{{asset('/img/'.$data->gambar)}}" alt="Agileits W3layouts" style="max-height:500px; width:">
<h1 class="wow agileits w3layouts fadeInDown">{{$data->namaHomestay}}</h1> <h1 class="wow agileits w3layouts fadeInDown">{{$data->nama_homestay}}</h1>
</div> </div>
<!-- //Banner --> <!-- //Banner -->
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</div> </div>
<!-- Booking --> <!-- Booking -->
<div class="details agilets w3layouts" style="margin-bottom:0px; margin-top:0px;"> <div class="details agilets w3layouts" style="margin-bottom:0px; margin-top:0px;">
<h2 > Daftar Booking di {{$data->namaHomestay}}</h2> <h2 > Daftar Booking di {{$data->nama_homestay}}</h2>
<div class="container"> <div class="container">
<table class="table table-hover" style="background-color: white; margin-top:20px;"> <table class="table table-hover" style="background-color: white; margin-top:20px;">
...@@ -98,10 +98,10 @@ ...@@ -98,10 +98,10 @@
<h2 style="margin-bottom: 10px;"> Info Pemilik </h2> <h2 style="margin-bottom: 10px;"> Info Pemilik </h2>
<ul style="list-style-type: none;"> <ul style="list-style-type: none;">
<li> Pemilik : {{$data->nama}}</li> <li> Pemilik : {{$data->nama}}</li>
<li> No Telp : {{$data->noTelepon}} </li> <li> No Telp : {{$data->no_telepon}} </li>
<li> Alamat : {{$data->alamat}}</li> <li> Alamat : {{$data->alamat}}</li>
<li> Pekerjaan : {{$data->pekerjaan}}</li> <li> Pekerjaan : {{$data->pekerjaan}}</li>
<li> No Rekening : {{$data->noRekening}}</li> <li> No Rekening : {{$data->no_rekening}}</li>
<li> Avilable Room : {{$avilable}}</li> <li> Avilable Room : {{$avilable}}</li>
</ul> </ul>
</div> </div>
......
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