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
e1f85c35
Commit
e1f85c35
authored
May 17, 2017
by
Juliper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
back to owner
parent
5f547409
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
29 deletions
+51
-29
OwnerController.php
app/Http/Controllers/OwnerController.php
+32
-12
fanta_strawbery.jpg
public/img/fanta_strawbery.jpg
+0
-0
EditRoom.blade.php
...es/views/vendor/adminlte/layouts/owner/EditRoom.blade.php
+5
-5
listRoom.blade.php
...es/views/vendor/adminlte/layouts/owner/listRoom.blade.php
+10
-8
sidebar.blade.php
.../views/vendor/adminlte/layouts/partials/sidebar.blade.php
+0
-1
web.php
routes/web.php
+4
-3
No files found.
app/Http/Controllers/OwnerController.php
View file @
e1f85c35
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use
App\RequestFasilitas
;
use
App\RequestFasilitas
;
use
App\RequestHomestay
;
use
App\RequestHomestay
;
use
App\Room
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
App\User
;
use
App\User
;
use
App\Owner
;
use
App\Owner
;
...
@@ -18,16 +19,35 @@ class OwnerController extends Controller
...
@@ -18,16 +19,35 @@ class OwnerController extends Controller
return
view
(
'adminlte::layouts.owner.home'
);
return
view
(
'adminlte::layouts.owner.home'
);
}
}
public
function
updateRoom
(
Request
$request
,
$id
){
$dataKamar
=
Room
::
find
(
$id
);
$dataKamar
->
jumlah_bed
=
$request
[
'jumlah_bed'
];
$dataKamar
->
fasilitas
=
$request
[
'fasilitas'
];
if
(
$request
->
file
(
'foto'
)
==
null
){
$dataKamar
->
foto
=
$dataKamar
->
foto
;
}
else
{
$file
=
$request
->
file
(
'foto'
);
$fileName
=
$file
->
getClientOriginalName
();
$request
->
file
(
'foto'
)
->
move
(
"img/"
,
$fileName
);
$dataKamar
->
gambar
=
$fileName
;
}
$dataKamar
->
update
();
return
redirect
(
'daftarKamar'
);
}
public
function
editRoom
(
$id
){
$dataKamar
=
Room
::
find
(
$id
);
return
view
(
'adminlte::layouts.owner.EditRoom'
)
->
with
(
'data'
,
$dataKamar
);
}
public
function
daftarKamar
(){
public
function
daftarKamar
(){
/*$dataTrans = DB::table('homestay')
$dataPemilik
=
DB
::
table
(
'pemilikhomestay'
)
->join('transaksi','homestay.id','=','transaksi.id_homestay')
->join('pemilikhomestay','homestay.idPemilik','=','pemilikhomestay.id')
->select('transaksi.*','pemilikhomestay.nama','pemilikhomestay.noRekening')
->where('transaksi.id_pelanggan','=',$data[0]->id)
->get();
*/
$pem
=
DB
::
table
(
'pemilikhomestay'
)
->
select
(
'pemilikhomestay.*'
)
->
select
(
'pemilikhomestay.*'
)
->
where
(
'pemilikhomestay.id_Akun'
,
'='
,
Auth
::
user
()
->
id
)
->
where
(
'pemilikhomestay.id_Akun'
,
'='
,
Auth
::
user
()
->
id
)
->
get
();
->
get
();
...
@@ -35,11 +55,11 @@ class OwnerController extends Controller
...
@@ -35,11 +55,11 @@ class OwnerController extends Controller
$data
=
DB
::
table
(
'homestay'
)
$data
=
DB
::
table
(
'homestay'
)
->
join
(
'pemilikhomestay'
,
'homestay.idPemilik'
,
'pemilikhomestay.id'
)
->
join
(
'pemilikhomestay'
,
'homestay.idPemilik'
,
'pemilikhomestay.id'
)
->
join
(
'kamar'
,
'homestay.id'
,
'='
,
'kamar.idHomestay'
)
->
join
(
'kamar'
,
'homestay.id'
,
'='
,
'kamar.idHomestay'
)
->
select
(
'kamar.*'
,
'homestay.*'
,
'pemilikhomestay.*'
)
->
select
(
'kamar.*'
)
->
where
(
'pemilikhomestay.id'
,
'='
,
$
pem
[
0
]
->
id
)
->
where
(
'pemilikhomestay.id'
,
'='
,
$
dataPemilik
[
0
]
->
id
)
->
get
();
->
get
();
//dd($data);
dd
(
"masuk gan"
,
Auth
::
user
()
->
id
,
$data
,
$pem
);
return
view
(
'adminlte::layouts.owner.listRoom'
)
->
with
(
'data'
,
$data
)
->
with
(
'count'
,
$data
->
count
()
);
}
}
public
function
listTransaction
(){
public
function
listTransaction
(){
...
...
public/img/fanta_strawbery.jpg
0 → 100644
View file @
e1f85c35
16.7 KB
resources/views/vendor/adminlte/layouts/owner/EditRoom.blade.php
View file @
e1f85c35
...
@@ -26,13 +26,13 @@
...
@@ -26,13 +26,13 @@
</div>
</div>
@endif
@endif
<form action="" method="
post
" enctype="
multipart
/
form
-
data
">
<form action="
{{
url
(
'editRoom/'
.
$data
->
id
)}}
" method="
post
" enctype="
multipart
/
form
-
data
">
<input type="
hidden
" name="
_method
" value="
PUT
">
<input type="
hidden
" name="
_method
" value="
PUT
">
<!--
{
{csrf_field()}
}
-->
{
{csrf_field()}
}
<
!-- <label>Nama
</label>
<
label>Jumlah Bed
</label>
<input
type="
text
" name="
nama
" value="" id="
nama
" class="
form
-
control
"> --
>
<input
class="
form
-
control
" value="
{{
$data
->
jumlah_bed
}}
" name="
jumlah_bed
"
>
<label>Fasilitas</label>
<label>Fasilitas</label>
<textarea name="
fasilitas
" value="" id="
fasilitas
" class="
form
-
control
" style="
height
:
200
px
;
"></textarea>
<textarea name="
fasilitas
" value="
{{
$data
->
fasilitas
}}
" id="
fasilitas
" class="
form
-
control
" style="
height
:
200
px
;
"></textarea>
<label>Foto</label>
<label>Foto</label>
<input type="
file
" value="
Browse
" name="
foto
" id="
picture
" >
<input type="
file
" value="
Browse
" name="
foto
" id="
picture
" >
...
...
resources/views/vendor/adminlte/layouts/owner/listRoom.blade.php
View file @
e1f85c35
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
@
section
(
'main-content'
)
@
section
(
'main-content'
)
<
div
class
="
container
-
fluid
spark
-
screen
">
<
div
class
="
container
-
fluid
spark
-
screen
">
<div class="
row
">
<div class="
row
">
<div class="
col
-
md
-
1
0
col
-
md
-
offset
-
1
">
<div class="
col
-
md
-
1
2
">
<div class="
panel
panel
-
default
">
<div class="
panel
panel
-
default
">
<div id="
app
">
<div id="
app
">
...
@@ -41,18 +41,22 @@
...
@@ -41,18 +41,22 @@
<th>No Kamar</th>
<th>No Kamar</th>
<th>Jumlah Bed</th>
<th>Jumlah Bed</th>
<td>Detail</td>
<td>Detail</td>
<td>
Edit
</td>
<td>
Foto
</td>
<td
>Delete
</td>
<td
colspan="
2
">Aksi
</td>
</tr>
</tr>
@foreach(
$data
as
$a
)
@foreach(
$data
as
$a
)
<tr>
<tr>
<td>
{
{$a->nomor_kamar}
}
</td>
<td>
{
{$a->nomor_kamar}
}
</td>
<td>
{
{$a->jumlah_bed}
}
</td>
<td>
{
{$a->jumlah_bed}
}
</td>
<td>
<td>
{
{$a->fasilitas}
}
</td>
<a href="
{{
url
(
'room/'
.
$a
->
id
)}}
" class="
btn
btn
-
primary
"><i class="
glyphicon
glyphicon
-
eye
-
open
"></i></a>
<td>@if(
$a->gambar
== null)
<img alt="
Belum
ada
foto
">
@else
<img src="
/
img
/
{{
$a
->
gambar
}}
">
@endif
</td>
</td>
<td>
<td>
<a href="
{{
url
(
'
room/'
.
$a
->
id
.
'/edit'
)}}
" class="
btn
btn
-
primary
"><i class="
glyphicon
glyphicon
-
edit
"></i></a>
<a href="
{{
url
(
'
editRoom/'
.
$a
->
id
)}}
" class="
btn
btn
-
primary
"><i class="
glyphicon
glyphicon
-
edit
"></i></a>
</td>
</td>
<td>
<td>
<form action="
{{
url
(
'room/'
.
$a
->
id
)}}
" method="
POST
">
<form action="
{{
url
(
'room/'
.
$a
->
id
)}}
" method="
POST
">
...
@@ -62,8 +66,6 @@
...
@@ -62,8 +66,6 @@
</form>
</form>
</td>
</td>
</tr>
</tr>
@endforeach
@endforeach
</table>
</table>
...
...
resources/views/vendor/adminlte/layouts/partials/sidebar.blade.php
View file @
e1f85c35
...
@@ -33,7 +33,6 @@
...
@@ -33,7 +33,6 @@
<li><a
href=
"{{url('listowner')}}"
><i
class=
'fa fa-list'
></i>
<span>
Melihat Daftar Owner
</span></a></li>
<li><a
href=
"{{url('listowner')}}"
><i
class=
'fa fa-list'
></i>
<span>
Melihat Daftar Owner
</span></a></li>
@elseif(Auth::user()->role=="Owner")
@elseif(Auth::user()->role=="Owner")
<li><a
href=
"{{url('EditRoom')}}"
><i
class=
'fa fa-list'
></i>
<span>
Edit Room
</span></a></li>
<li><a
href=
"{{url('pesanan')}}"
><i
class=
'fa fa-list'
></i>
<span>
Daftar Pesanan
</span></a></li>
<li><a
href=
"{{url('pesanan')}}"
><i
class=
'fa fa-list'
></i>
<span>
Daftar Pesanan
</span></a></li>
<li><a
href=
"{{url('reqFasilitas')}}"
><i
class=
'fa fa-list'
></i>
<span>
Request Fasilitas
</span></a></li>
<li><a
href=
"{{url('reqFasilitas')}}"
><i
class=
'fa fa-list'
></i>
<span>
Request Fasilitas
</span></a></li>
<li><a
href=
"#"
><i
class=
'fa fa-list'
></i>
<span>
Add Book Manual
</span></a></li>
<li><a
href=
"#"
><i
class=
'fa fa-list'
></i>
<span>
Add Book Manual
</span></a></li>
...
...
routes/web.php
View file @
e1f85c35
...
@@ -47,9 +47,9 @@ Route::group(['middleware' => 'auth'], function () {
...
@@ -47,9 +47,9 @@ Route::group(['middleware' => 'auth'], function () {
});
});
Route
::
get
(
'EditRoom'
,
function
(){
/*
Route::get('EditRoom', function(){
return view('adminlte::layouts.owner.EditRoom');
return view('adminlte::layouts.owner.EditRoom');
});
});
*/
Route
::
get
(
'AddBook'
,
function
(){
Route
::
get
(
'AddBook'
,
function
(){
return
view
(
'adminlte::layouts.owner.AddBookManual'
);
return
view
(
'adminlte::layouts.owner.AddBookManual'
);
});
});
...
@@ -57,7 +57,8 @@ Route::get('DataPemesanan', function(){
...
@@ -57,7 +57,8 @@ Route::get('DataPemesanan', function(){
return
view
(
'adminlte::layouts.admin.dataPemesanan'
);
return
view
(
'adminlte::layouts.admin.dataPemesanan'
);
});
});
Route
::
put
(
'editRoom/{id}'
,
'OwnerController@updateRoom'
);
Route
::
get
(
'editRoom/{id}'
,
'OwnerController@editRoom'
);
Route
::
get
(
'daftarKamar'
,
'OwnerController@daftarKamar'
);
Route
::
get
(
'daftarKamar'
,
'OwnerController@daftarKamar'
);
Route
::
get
(
'pesanan'
,
'OwnerController@listTransaction'
);
Route
::
get
(
'pesanan'
,
'OwnerController@listTransaction'
);
Route
::
put
(
'upload/{id}'
,
'CustomerController@upload'
);
Route
::
put
(
'upload/{id}'
,
'CustomerController@upload'
);
...
...
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