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
$user
->
email
=
$data
[
'email'
];
$user
->
password
=
bcrypt
(
$data
[
'password'
]);
$user
->
role
=
'Owner'
;
$user
->
save
();
$dataPemilik
=
DB
::
table
(
'users'
)
->
select
(
'users.id'
)
->
where
(
'username'
,
'='
,
$data
[
'username'
])
->
get
();
//dd($dataPemilik->id);
$owner
=
new
Owner
();
$owner
->
nama
=
$data
[
'name'
];
$owner
->
id_akun
=
$dataPemilik
[
0
]
->
id
;
$owner
->
alamat
=
'--'
;
$owner
->
pekerjaan
=
'--'
;
$owner
->
no_telepon
=
'--'
;
$owner
->
no_rekening
=
'--'
;
$owner
->
foto
=
'gravatar.png'
;
$user
->
save
();
$owner
->
save
();
return
redirect
(
url
(
'admin/create'
))
->
with
(
'info'
,
'User berhasil ditambah '
);
}
...
...
@@ -153,15 +162,15 @@ class AdminController extends Controller
$data
=
DB
::
table
(
'pengajuan_homestay'
)
->
join
(
'pemilikhomestay'
,
'pemilikhomestay.id'
,
'='
,
'pengajuan_homestay.id_pemilik_homestay'
)
->
select
(
'pemilikhomestay.nama'
,
'pemilikhomestay.alamat'
)
->
where
(
'pemilikhomestay.id'
,
'='
,
$RH
->
id
PemilikH
omestay
)
->
where
(
'pemilikhomestay.id'
,
'='
,
$RH
->
id
_pemilik_h
omestay
)
->
get
();
//dd($data);
$hs
=
new
Homestay
();
$hs
->
id_pemilik
=
$RH
->
id
PemilikH
omestay
;
$hs
->
nama_homestay
=
$RH
->
nama
H
omestay
;
$hs
->
id_pemilik
=
$RH
->
id
_pemilik_h
omestay
;
$hs
->
nama_homestay
=
$RH
->
nama
_h
omestay
;
$hs
->
owner
=
$data
[
0
]
->
nama
;
$hs
->
alamat
=
$data
[
0
]
->
alamat
;
$hs
->
jumlah_kamar
=
$RH
->
jumlah
K
amar
;
$hs
->
jumlah_kamar
=
$RH
->
jumlah
_k
amar
;
$hs
->
harga
=
150000
;
$hs
->
status
=
'----'
;
...
...
app/Http/Controllers/OwnerController.php
View file @
1da5d4f1
...
...
@@ -27,6 +27,7 @@ class OwnerController extends Controller
return
view
(
'adminlte::layouts.owner.home'
);
}
//Menyimpan Data untuk di update
public
function
updateProfil
(
Request
$request
,
$id
){
$owner
=
Owner
::
where
(
'id'
,
$id
)
->
first
();
...
...
@@ -59,6 +60,7 @@ class OwnerController extends Controller
return
redirect
(
'profile'
);
}
//Mengakses Halaman untuk Melakukan edit Profile
public
function
profileEdit
(
$id
){
$data
=
Owner
::
find
(
$id
);
...
...
@@ -66,6 +68,7 @@ class OwnerController extends Controller
return
view
(
'adminlte::layouts.owner.updateProfil'
)
->
with
(
'data'
,
$data
);
}
//Mengakses Halaman profile
public
function
profile
(){
...
...
@@ -75,6 +78,7 @@ class OwnerController extends Controller
return
view
(
'adminlte::layouts.owner.profil'
)
->
with
(
'data'
,
$data
);
}
//Mengakses Halaman daftar Feedback
public
function
feddback
(){
$dataPemilik
=
DB
::
table
(
'pemilikhomestay'
)
...
...
@@ -91,6 +95,7 @@ class OwnerController extends Controller
return
view
(
'adminlte::layouts.owner.listfeedback'
)
->
with
(
'data'
,
$dataFeedback
);
}
//Menyimpan Data Update Homestay
public
function
updateHomestay
(
Request
$request
,
$id
){
$this
->
validate
(
$request
,[
...
...
@@ -131,6 +136,7 @@ class OwnerController extends Controller
return
redirect
(
'updateHomestay'
);
}
//Mengakses Halaman Update Homestay
public
function
update
(){
$dataPemilik
=
DB
::
table
(
'pemilikhomestay'
)
...
...
@@ -142,7 +148,7 @@ class OwnerController extends Controller
->
select
(
'homestay.*'
)
->
where
(
'homestay.id_pemilik'
,
'='
,
$dataPemilik
[
0
]
->
id
)
->
get
();
//dd($dataHomestay[0]);
return
view
(
'adminlte::layouts.owner.UpdateHomestay'
)
->
with
(
'data'
,
$dataHomestay
[
0
]);
}
...
...
@@ -304,11 +310,13 @@ class OwnerController extends Controller
return
view
(
'adminlte::layouts.owner.listPesanan'
)
->
with
(
'data'
,
$data
)
->
with
(
'count'
,
$data
->
count
());
}
//Mengakses Halaman untuk melakukan Request Fasilitas
public
function
requestFasilitas
(){
return
view
(
'adminlte::layouts.owner.RequestFasilitas'
)
->
with
(
'message'
,
'Request Fasilitas Berhasil Dikirim!'
);
}
//Menyimpan Data Request Fasilitas
public
function
storeRequest
(
Request
$request
){
$this
->
validate
(
$request
,[
...
...
@@ -350,11 +358,13 @@ class OwnerController extends Controller
}
//Mengakses Halaman untuk melakukan Pengajuan
public
function
pengajuan
(){
return
view
(
'adminlte::layouts.owner.PengajuanHomestay'
);
}
//Menyimpan Data Pengajuan
public
function
storePengajuan
(
Request
$request
){
...
...
@@ -375,16 +385,17 @@ class OwnerController extends Controller
$data
=
new
RequestHomestay
();
$data
->
id_pemili_homestay
=
$idPemilik
[
0
]
->
id
;
$data
->
id_pemili
k
_homestay
=
$idPemilik
[
0
]
->
id
;
$data
->
nama_homestay
=
$request
[
'namaHomestay'
];
$data
->
jumlah_kamar
=
$request
[
'jumlahKamar'
];
$data
->
status
=
0
;
$data
->
save
();
dd
(
$request
[
'namaHomestay'
],
$request
[
'jumlahKamar'
]
);
return
redirect
(
'listPengajuan'
);
}
//Melihat Daftar Pengajuan Homestay
public
function
listPengajuan
(){
...
...
@@ -393,18 +404,19 @@ class OwnerController extends Controller
->
select
(
'pemilikhomestay.id'
)
->
where
(
'users.id'
,
'='
,
Auth
::
user
()
->
id
)
->
get
();
//dd($idPemilik,Auth::user()->id);
$data
=
DB
::
table
(
'pengajuan_homestay'
)
->
join
(
'pemilikhomestay'
,
'pengajuan_homestay.id_pemilik_homestay'
,
'='
,
'pemilikhomestay.id'
)
->
select
(
'pemilikhomestay.nama'
,
'pengajuan_homestay.*'
)
->
where
(
'pengajuan_homestay.id_pemilik_homestay'
,
'='
,
$idPemilik
[
0
]
->
id
)
->
get
();
//dd('masuk');
$count
=
$data
->
count
();
return
view
(
'adminlte::layouts.owner.ListPengajuanHomestay'
)
->
with
(
'data'
,
$data
)
->
with
(
'count'
,
$count
);
}
//Melihat Daftar Pengajuan Fasilitas
public
function
listPengajuanFasilitas
(){
$idPemilik
=
DB
::
table
(
'users'
)
...
...
resources/views/vendor/adminlte/layouts/owner/ListPengajuanHomestay.blade.php
View file @
1da5d4f1
...
...
@@ -30,29 +30,6 @@
<!-- /.info-box-content -->
</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 -->
<br>
</div>
...
...
@@ -66,8 +43,8 @@
@foreach(
$data
as
$a
)
<tr>
<td>
{
{$a->nama}
}
</td>
<td>
{
{$a->nama
H
omestay}
}
</td>
<td>
{
{$a->jumlah
K
amar}
}
</td>
<td>
{
{$a->nama
_h
omestay}
}
</td>
<td>
{
{$a->jumlah
_k
amar}
}
</td>
<td>@if(
$a->status
==0) Sedang Menunggu
@elseif(
$a->status
==1) Diterima
@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