Commit db6e70c2 by Juliper

no message

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