Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pa2d4ti06
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Juliper
pa2d4ti06
Commits
1da5d4f1
Commit
1da5d4f1
authored
May 26, 2017
by
Juliper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
063c10bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
36 deletions
+34
-36
AdminController.php
app/Http/Controllers/AdminController.php
+15
-6
OwnerController.php
app/Http/Controllers/OwnerController.php
+17
-5
ListPengajuanHomestay.blade.php
...or/adminlte/layouts/owner/ListPengajuanHomestay.blade.php
+2
-25
No files found.
app/Http/Controllers/AdminController.php
View file @
1da5d4f1
...
@@ -83,16 +83,25 @@ class AdminController extends Controller
...
@@ -83,16 +83,25 @@ class AdminController extends Controller
$user
->
email
=
$data
[
'email'
];
$user
->
email
=
$data
[
'email'
];
$user
->
password
=
bcrypt
(
$data
[
'password'
]);
$user
->
password
=
bcrypt
(
$data
[
'password'
]);
$user
->
role
=
'Owner'
;
$user
->
role
=
'Owner'
;
$user
->
save
();
$dataPemilik
=
DB
::
table
(
'users'
)
->
select
(
'users.id'
)
->
where
(
'username'
,
'='
,
$data
[
'username'
])
->
get
();
//dd($dataPemilik->id);
$owner
=
new
Owner
();
$owner
=
new
Owner
();
$owner
->
nama
=
$data
[
'name'
];
$owner
->
nama
=
$data
[
'name'
];
$owner
->
id_akun
=
$dataPemilik
[
0
]
->
id
;
$owner
->
alamat
=
'--'
;
$owner
->
alamat
=
'--'
;
$owner
->
pekerjaan
=
'--'
;
$owner
->
pekerjaan
=
'--'
;
$owner
->
no_telepon
=
'--'
;
$owner
->
no_telepon
=
'--'
;
$owner
->
no_rekening
=
'--'
;
$owner
->
no_rekening
=
'--'
;
$owner
->
foto
=
'gravatar.png'
;
$owner
->
foto
=
'gravatar.png'
;
$user
->
save
();
$owner
->
save
();
$owner
->
save
();
return
redirect
(
url
(
'admin/create'
))
->
with
(
'info'
,
'User berhasil ditambah '
);
return
redirect
(
url
(
'admin/create'
))
->
with
(
'info'
,
'User berhasil ditambah '
);
}
}
...
@@ -153,15 +162,15 @@ class AdminController extends Controller
...
@@ -153,15 +162,15 @@ class AdminController extends Controller
$data
=
DB
::
table
(
'pengajuan_homestay'
)
$data
=
DB
::
table
(
'pengajuan_homestay'
)
->
join
(
'pemilikhomestay'
,
'pemilikhomestay.id'
,
'='
,
'pengajuan_homestay.id_pemilik_homestay'
)
->
join
(
'pemilikhomestay'
,
'pemilikhomestay.id'
,
'='
,
'pengajuan_homestay.id_pemilik_homestay'
)
->
select
(
'pemilikhomestay.nama'
,
'pemilikhomestay.alamat'
)
->
select
(
'pemilikhomestay.nama'
,
'pemilikhomestay.alamat'
)
->
where
(
'pemilikhomestay.id'
,
'='
,
$RH
->
id
PemilikH
omestay
)
->
where
(
'pemilikhomestay.id'
,
'='
,
$RH
->
id
_pemilik_h
omestay
)
->
get
();
->
get
();
//dd($data);
$hs
=
new
Homestay
();
$hs
=
new
Homestay
();
$hs
->
id_pemilik
=
$RH
->
id
PemilikH
omestay
;
$hs
->
id_pemilik
=
$RH
->
id
_pemilik_h
omestay
;
$hs
->
nama_homestay
=
$RH
->
nama
H
omestay
;
$hs
->
nama_homestay
=
$RH
->
nama
_h
omestay
;
$hs
->
owner
=
$data
[
0
]
->
nama
;
$hs
->
owner
=
$data
[
0
]
->
nama
;
$hs
->
alamat
=
$data
[
0
]
->
alamat
;
$hs
->
alamat
=
$data
[
0
]
->
alamat
;
$hs
->
jumlah_kamar
=
$RH
->
jumlah
K
amar
;
$hs
->
jumlah_kamar
=
$RH
->
jumlah
_k
amar
;
$hs
->
harga
=
150000
;
$hs
->
harga
=
150000
;
$hs
->
status
=
'----'
;
$hs
->
status
=
'----'
;
...
...
app/Http/Controllers/OwnerController.php
View file @
1da5d4f1
...
@@ -27,6 +27,7 @@ class OwnerController extends Controller
...
@@ -27,6 +27,7 @@ class OwnerController extends Controller
return
view
(
'adminlte::layouts.owner.home'
);
return
view
(
'adminlte::layouts.owner.home'
);
}
}
//Menyimpan Data untuk di update
//Menyimpan Data untuk di update
public
function
updateProfil
(
Request
$request
,
$id
){
public
function
updateProfil
(
Request
$request
,
$id
){
$owner
=
Owner
::
where
(
'id'
,
$id
)
->
first
();
$owner
=
Owner
::
where
(
'id'
,
$id
)
->
first
();
...
@@ -59,6 +60,7 @@ class OwnerController extends Controller
...
@@ -59,6 +60,7 @@ class OwnerController extends Controller
return
redirect
(
'profile'
);
return
redirect
(
'profile'
);
}
}
//Mengakses Halaman untuk Melakukan edit Profile
//Mengakses Halaman untuk Melakukan edit Profile
public
function
profileEdit
(
$id
){
public
function
profileEdit
(
$id
){
$data
=
Owner
::
find
(
$id
);
$data
=
Owner
::
find
(
$id
);
...
@@ -66,6 +68,7 @@ class OwnerController extends Controller
...
@@ -66,6 +68,7 @@ class OwnerController extends Controller
return
view
(
'adminlte::layouts.owner.updateProfil'
)
->
with
(
'data'
,
$data
);
return
view
(
'adminlte::layouts.owner.updateProfil'
)
->
with
(
'data'
,
$data
);
}
}
//Mengakses Halaman profile
//Mengakses Halaman profile
public
function
profile
(){
public
function
profile
(){
...
@@ -75,6 +78,7 @@ class OwnerController extends Controller
...
@@ -75,6 +78,7 @@ class OwnerController extends Controller
return
view
(
'adminlte::layouts.owner.profil'
)
->
with
(
'data'
,
$data
);
return
view
(
'adminlte::layouts.owner.profil'
)
->
with
(
'data'
,
$data
);
}
}
//Mengakses Halaman daftar Feedback
//Mengakses Halaman daftar Feedback
public
function
feddback
(){
public
function
feddback
(){
$dataPemilik
=
DB
::
table
(
'pemilikhomestay'
)
$dataPemilik
=
DB
::
table
(
'pemilikhomestay'
)
...
@@ -91,6 +95,7 @@ class OwnerController extends Controller
...
@@ -91,6 +95,7 @@ class OwnerController extends Controller
return
view
(
'adminlte::layouts.owner.listfeedback'
)
->
with
(
'data'
,
$dataFeedback
);
return
view
(
'adminlte::layouts.owner.listfeedback'
)
->
with
(
'data'
,
$dataFeedback
);
}
}
//Menyimpan Data Update Homestay
//Menyimpan Data Update Homestay
public
function
updateHomestay
(
Request
$request
,
$id
){
public
function
updateHomestay
(
Request
$request
,
$id
){
$this
->
validate
(
$request
,[
$this
->
validate
(
$request
,[
...
@@ -131,6 +136,7 @@ class OwnerController extends Controller
...
@@ -131,6 +136,7 @@ class OwnerController extends Controller
return
redirect
(
'updateHomestay'
);
return
redirect
(
'updateHomestay'
);
}
}
//Mengakses Halaman Update Homestay
//Mengakses Halaman Update Homestay
public
function
update
(){
public
function
update
(){
$dataPemilik
=
DB
::
table
(
'pemilikhomestay'
)
$dataPemilik
=
DB
::
table
(
'pemilikhomestay'
)
...
@@ -142,7 +148,7 @@ class OwnerController extends Controller
...
@@ -142,7 +148,7 @@ class OwnerController extends Controller
->
select
(
'homestay.*'
)
->
select
(
'homestay.*'
)
->
where
(
'homestay.id_pemilik'
,
'='
,
$dataPemilik
[
0
]
->
id
)
->
where
(
'homestay.id_pemilik'
,
'='
,
$dataPemilik
[
0
]
->
id
)
->
get
();
->
get
();
//dd($dataHomestay[0]);
return
view
(
'adminlte::layouts.owner.UpdateHomestay'
)
->
with
(
'data'
,
$dataHomestay
[
0
]);
return
view
(
'adminlte::layouts.owner.UpdateHomestay'
)
->
with
(
'data'
,
$dataHomestay
[
0
]);
}
}
...
@@ -304,11 +310,13 @@ class OwnerController extends Controller
...
@@ -304,11 +310,13 @@ class OwnerController extends Controller
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
());
}
}
//Mengakses Halaman untuk melakukan Request Fasilitas
//Mengakses Halaman untuk melakukan Request Fasilitas
public
function
requestFasilitas
(){
public
function
requestFasilitas
(){
return
view
(
'adminlte::layouts.owner.RequestFasilitas'
)
->
with
(
'message'
,
'Request Fasilitas Berhasil Dikirim!'
);
return
view
(
'adminlte::layouts.owner.RequestFasilitas'
)
->
with
(
'message'
,
'Request Fasilitas Berhasil Dikirim!'
);
}
}
//Menyimpan Data Request Fasilitas
//Menyimpan Data Request Fasilitas
public
function
storeRequest
(
Request
$request
){
public
function
storeRequest
(
Request
$request
){
$this
->
validate
(
$request
,[
$this
->
validate
(
$request
,[
...
@@ -350,11 +358,13 @@ class OwnerController extends Controller
...
@@ -350,11 +358,13 @@ class OwnerController extends Controller
}
}
//Mengakses Halaman untuk melakukan Pengajuan
//Mengakses Halaman untuk melakukan Pengajuan
public
function
pengajuan
(){
public
function
pengajuan
(){
return
view
(
'adminlte::layouts.owner.PengajuanHomestay'
);
return
view
(
'adminlte::layouts.owner.PengajuanHomestay'
);
}
}
//Menyimpan Data Pengajuan
//Menyimpan Data Pengajuan
public
function
storePengajuan
(
Request
$request
){
public
function
storePengajuan
(
Request
$request
){
...
@@ -375,16 +385,17 @@ class OwnerController extends Controller
...
@@ -375,16 +385,17 @@ class OwnerController extends Controller
$data
=
new
RequestHomestay
();
$data
=
new
RequestHomestay
();
$data
->
id_pemili_homestay
=
$idPemilik
[
0
]
->
id
;
$data
->
id_pemili
k
_homestay
=
$idPemilik
[
0
]
->
id
;
$data
->
nama_homestay
=
$request
[
'namaHomestay'
];
$data
->
nama_homestay
=
$request
[
'namaHomestay'
];
$data
->
jumlah_kamar
=
$request
[
'jumlahKamar'
];
$data
->
jumlah_kamar
=
$request
[
'jumlahKamar'
];
$data
->
status
=
0
;
$data
->
status
=
0
;
$data
->
save
();
$data
->
save
();
dd
(
$request
[
'namaHomestay'
],
$request
[
'jumlahKamar'
]
);
return
redirect
(
'listPengajuan'
);
}
}
//Melihat Daftar Pengajuan Homestay
//Melihat Daftar Pengajuan Homestay
public
function
listPengajuan
(){
public
function
listPengajuan
(){
...
@@ -393,18 +404,19 @@ class OwnerController extends Controller
...
@@ -393,18 +404,19 @@ class OwnerController extends Controller
->
select
(
'pemilikhomestay.id'
)
->
select
(
'pemilikhomestay.id'
)
->
where
(
'users.id'
,
'='
,
Auth
::
user
()
->
id
)
->
where
(
'users.id'
,
'='
,
Auth
::
user
()
->
id
)
->
get
();
->
get
();
//dd($idPemilik,Auth::user()->id);
$data
=
DB
::
table
(
'pengajuan_homestay'
)
$data
=
DB
::
table
(
'pengajuan_homestay'
)
->
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
)
->
get
();
->
get
();
//dd('masuk');
$count
=
$data
->
count
();
$count
=
$data
->
count
();
return
view
(
'adminlte::layouts.owner.ListPengajuanHomestay'
)
->
with
(
'data'
,
$data
)
->
with
(
'count'
,
$count
);
return
view
(
'adminlte::layouts.owner.ListPengajuanHomestay'
)
->
with
(
'data'
,
$data
)
->
with
(
'count'
,
$count
);
}
}
//Melihat Daftar Pengajuan Fasilitas
//Melihat Daftar Pengajuan Fasilitas
public
function
listPengajuanFasilitas
(){
public
function
listPengajuanFasilitas
(){
$idPemilik
=
DB
::
table
(
'users'
)
$idPemilik
=
DB
::
table
(
'users'
)
...
...
resources/views/vendor/adminlte/layouts/owner/ListPengajuanHomestay.blade.php
View file @
1da5d4f1
...
@@ -30,29 +30,6 @@
...
@@ -30,29 +30,6 @@
<!-- /.info-box-content -->
<!-- /.info-box-content -->
</div>
</div>
<table class="
table
table
-
striped
">
<tr>
<th>Pengaju</th>
<th>Nama Homestay</th>
<td>Jumlah Kamar</td>
<td>Status</td>
</tr>
@foreach(
$data
as
$a
)
<tr>
<td>
{
{$a->nama}
}
</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
@endif
</td>
</tr>
@endforeach
</table>
<!-- /.info-box -->
<!-- /.info-box -->
<br>
<br>
</div>
</div>
...
@@ -66,8 +43,8 @@
...
@@ -66,8 +43,8 @@
@foreach(
$data
as
$a
)
@foreach(
$data
as
$a
)
<tr>
<tr>
<td>
{
{$a->nama}
}
</td>
<td>
{
{$a->nama}
}
</td>
<td>
{
{$a->nama
H
omestay}
}
</td>
<td>
{
{$a->nama
_h
omestay}
}
</td>
<td>
{
{$a->jumlah
K
amar}
}
</td>
<td>
{
{$a->jumlah
_k
amar}
}
</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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment