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
3664c6aa
Commit
3664c6aa
authored
Jun 13, 2017
by
Palti Sinaga
Browse files
Options
Browse Files
Download
Plain Diff
tape
parents
179f8af6
07340e30
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
217 additions
and
35 deletions
+217
-35
AdminController.php
app/Http/Controllers/AdminController.php
+43
-3
OwnerController.php
app/Http/Controllers/OwnerController.php
+1
-31
login.blade.php
resources/views/vendor/adminlte/auth/login.blade.php
+1
-1
listOwner.blade.php
...s/views/vendor/adminlte/layouts/admin/listOwner.blade.php
+12
-0
profil.blade.php
...rces/views/vendor/adminlte/layouts/admin/profil.blade.php
+51
-0
updateOwner.blade.php
...views/vendor/adminlte/layouts/admin/updateOwner.blade.php
+106
-0
web.php
routes/web.php
+3
-0
No files found.
app/Http/Controllers/AdminController.php
View file @
3664c6aa
...
@@ -34,6 +34,49 @@ class AdminController extends Controller
...
@@ -34,6 +34,49 @@ class AdminController extends Controller
return
view
(
'adminlte::layouts.admin.listOwner'
)
->
with
(
'data'
,
$data
)
->
with
(
'count'
,
$count
);
return
view
(
'adminlte::layouts.admin.listOwner'
)
->
with
(
'data'
,
$data
)
->
with
(
'count'
,
$count
);
}
}
public
function
owner
(
$id
){
$data
=
Owner
::
where
(
'id_akun'
,
$id
)
->
get
();
// dd($data[0]);
return
view
(
'adminlte::layouts.admin.updateOwner'
)
->
with
(
'data'
,
$data
[
0
]);
}
public
function
rincian
(
$id
){
$dataPem
=
DB
::
table
(
'pemilikhomestay'
)
->
where
(
'pemilikhomestay.id_akun'
,
'='
,
$id
)
->
get
();
$data
=
Owner
::
find
(
$dataPem
[
0
]
->
id
);
return
view
(
'adminlte::layouts.admin.profil'
)
->
with
(
'data'
,
$data
);
}
public
function
updateOwner
(
Request
$request
,
$id
){
$dataOw
=
Owner
::
find
(
$id
);
$dataOw
->
nama
;
$dataOw
->
alamat
;
$dataOw
->
pekerjaan
;
$dataOw
->
no_telepon
;
$dataOw
->
no_rekening
;
//dd('aman',$dataOw->id_akun);
$dataUs
=
User
::
find
(
$dataOw
->
id_akun
);
$dataUs
->
username
=
$request
[
'username'
];
$dataUs
->
password
=
bcrypt
(
$request
[
'password'
]);
//dd($dataUs);
$dataUs
->
update
();
return
redirect
(
'listowner'
);
//dd($dataOw->id);
}
//Mengakses Daftar Pemesanan
//Mengakses Daftar Pemesanan
public
function
listPesanan
(){
public
function
listPesanan
(){
...
@@ -49,11 +92,8 @@ class AdminController extends Controller
...
@@ -49,11 +92,8 @@ class AdminController extends Controller
public
function
listOwner
(){
public
function
listOwner
(){
$count
=
User
::
all
()
->
where
(
'role'
,
"Owner"
)
->
count
();
$count
=
User
::
all
()
->
where
(
'role'
,
"Owner"
)
->
count
();
$data
=
User
::
all
()
->
where
(
'role'
,
"Owner"
);
$data
=
User
::
all
()
->
where
(
'role'
,
"Owner"
);
//dd($data);
return
view
(
'adminlte::layouts.admin.listOwner'
)
->
with
(
'data'
,
$data
)
->
with
(
'count'
,
$count
);
return
view
(
'adminlte::layouts.admin.listOwner'
)
->
with
(
'data'
,
$data
)
->
with
(
'count'
,
$count
);
}
}
//Menambah owner
//Menambah owner
...
...
app/Http/Controllers/OwnerController.php
View file @
3664c6aa
...
@@ -13,6 +13,7 @@ use App\User;
...
@@ -13,6 +13,7 @@ use App\User;
use
App\Owner
;
use
App\Owner
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\View
;
class
OwnerController
extends
Controller
class
OwnerController
extends
Controller
{
{
...
@@ -24,37 +25,6 @@ class OwnerController extends Controller
...
@@ -24,37 +25,6 @@ class OwnerController extends Controller
public
function
index
()
public
function
index
()
{
{
//coba
// $dataPemilik = DB::table('pemilikhomestay')
// ->select('pemilikhomestay.*')
// ->where('pemilikhomestay.id_akun','=',Auth::user()->id)
// ->get();
//
// $data = DB::table('homestay')
// ->join('pemilikhomestay','homestay.id_pemilik','pemilikhomestay.id')
// ->join('kamar','homestay.id','=','kamar.id_homestay')
// ->select('kamar.*')
// ->where('pemilikhomestay.id','=',$dataPemilik[0]->id)
// ->get();
//
// $dataHomestay = DB::table('homestay')
// ->join('pemilikhomestay','homestay.id_pemilik','pemilikhomestay.id')
// ->select('homestay.id')
// ->where('pemilikhomestay.id','=',$dataPemilik[0]->id)
// ->get();
//
// $dataListOfBook = DB::table('daftar_book')
// ->select('daftar_book.*')
// ->where('daftar_book.homestay','=',$dataHomestay[0]->id)
// ->get();
//
// $dataFeedback = DB::table('feedback')
// ->join('pelanggan','feedback.id_pelanggan','pelanggan.id')
// ->select('feedback.*','pelanggan.nama')
// ->where('feedback.id_pemilik_homestay','=',$dataPemilik[0]->id)
// ->get();
//coba
$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
)
...
...
resources/views/vendor/adminlte/auth/login.blade.php
View file @
3664c6aa
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
<form action="
{{
url
(
'/login'
)
}}
" method="
post
">
<form action="
{{
url
(
'/login'
)
}}
" method="
post
">
<input type="
hidden
" name="
_token
" value="
{{
csrf_token
()
}}
">
<input type="
hidden
" name="
_token
" value="
{{
csrf_token
()
}}
">
<div class="
form
-
group
has
-
feedback
">
<div class="
form
-
group
has
-
feedback
">
<input type="
text
" class="
form
-
control
" placeholder="
u
sername
" name="
username
"/>
<input type="
text
" class="
form
-
control
" placeholder="
U
sername
" name="
username
"/>
<span class="
glyphicon
glyphicon
-
user
form
-
control
-
feedback
"></span>
<span class="
glyphicon
glyphicon
-
user
form
-
control
-
feedback
"></span>
</div>
</div>
<div class="
form
-
group
has
-
feedback
">
<div class="
form
-
group
has
-
feedback
">
...
...
resources/views/vendor/adminlte/layouts/admin/listOwner.blade.php
View file @
3664c6aa
...
@@ -26,6 +26,8 @@
...
@@ -26,6 +26,8 @@
<th>Name</th>
<th>Name</th>
<th>Username</th>
<th>Username</th>
<th>Email</th>
<th>Email</th>
<th></th>
<th></th>
<!--<th></th>-->
<!--<th></th>-->
</tr>
</tr>
@foreach(
$data
as
$a
)
@foreach(
$data
as
$a
)
...
@@ -33,6 +35,16 @@
...
@@ -33,6 +35,16 @@
<td>
{
{$a->name}
}
</td>
<td>
{
{$a->name}
}
</td>
<td>
{
{$a->username}
}
</td>
<td>
{
{$a->username}
}
</td>
<td>
{
{$a->email}
}
</td>
<td>
{
{$a->email}
}
</td>
<td>
<form action="
{{
url
(
'rincianpemilik/'
.
$a
->
id
)}}
">
<input type="
submit
" value="
Rincian
">
</form>
</td>
<td>
<form action="
{{
url
(
'ownerr/'
.
$a
->
id
)}}
">
<input type="
submit
" value="
perbaharui
">
</form>
</td>
<!-- <td> <a href="
{{
url
(
'ownerprofil/'
.
$a
->
id
)}}
" class="
btn
btn
-
primary
"><i class="
glyphicon
glyphicon
-
edit
"></i> </a></td> -->
<!-- <td> <a href="
{{
url
(
'ownerprofil/'
.
$a
->
id
)}}
" class="
btn
btn
-
primary
"><i class="
glyphicon
glyphicon
-
edit
"></i> </a></td> -->
</tr>
</tr>
...
...
resources/views/vendor/adminlte/layouts/admin/profil.blade.php
0 → 100644
View file @
3664c6aa
@
extends
(
'adminlte::layouts.app'
)
@
section
(
'htmlheader_title'
)
{{
trans
(
'adminlte_lang::message.home'
)
}}
@
endsection
@
section
(
'main-content'
)
<
div
class
="
container
-
fluid
spark
-
screen
">
<div class="
row
">
<div class="
col
-
md
-
10
col
-
md
-
offset
-
1
">
<div class="
panel
panel
-
default
">
<div class="
panel
-
heading
">
<h3 class="
panel
-
heading
">
{
{$data->nama}
}
</h3>
</div>
<div class="
panel
-
body
">
<div class="
row
">
<div class="
col
-
md
-
3
col
-
lg
-
3
" align="
center
">
<img alt="
User
Pic
" src="
/
img
/
{{
$data
->
foto
}}
" style="
width
:
200
px
;
border
-
radius
:
10
%
;
">
</div>
<div class="
col
-
md
-
9
col
-
lg
-
8
">
<table class="
table
table
-
user
-
information
">
<tr>
<th>Alamat </th>
<td>: </td>
<td>
{
{$data->alamat}
}
</td>
</tr>
<tr>
<th>Perkerjaan</th>
<td>: </td>
<td>
{
{$data->pekerjaan}
}
</td>
</tr>
<tr>
<th>No Telepon</th>
<td>: </td>
<td>
{
{$data->no_telepon}
}
</td>
</tr>
<tr>
<th>No Rekening </th>
<td>: </td>
<td>
{
{$data->no_rekening}
}
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
@endsection
</div>
</div>
</div>
resources/views/vendor/adminlte/layouts/admin/updateOwner.blade.php
0 → 100644
View file @
3664c6aa
@
extends
(
'adminlte::layouts.app'
)
@
section
(
'htmlheader_title'
)
{{
trans
(
'adminlte_lang::message.home'
)
}}
@
endsection
@
section
(
'main-content'
)
<
div
class
="
box
box
-
primary
">
<div class="
box
-
header
with
-
border
">
<h3 class="
box
-
title
"> UPDATE PROFIL</h3>
@if (count(
$errors
) > 0)
<div class="
alert
alert
-
danger
">
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
<ul>
@foreach (
$errors->all
() as
$error
)
<li>{{
$error
}}</li>
@endforeach
</ul>
</div>
@if(session()->has('message'))
<div class="
alert
alert
-
info
">
{
{session()->get('message')}
}
</div>
@endif
@endif
</div>
<div class="
box
-
body
">
<form action="
{{
url
(
'updateOwner/'
.
$data
->
id
)
}}
" method="
post
" enctype="
multipart
/
form
-
data
">
<input type="
hidden
" name="
_method
" value="
PUT
">
{
{csrf_field()}
}
<div class="
form
-
group
">
<label> Nama </label>
<div class="
input
-
group
">
<div class="
input
-
group
-
addon
">
<i class="
fa
fa
-
bookmark
"></i>
</div>
<input type="
text
" class="
form
-
control
" placeholder="
nama
" name="
nama
" value="
{{
$data
->
nama
}}
"/>
</div>
</div>
<div class="
form
-
group
">
<label> Alamat </label>
<div class="
input
-
group
">
<div class="
input
-
group
-
addon
">
<i class="
fa
fa
-
building
"></i>
</div>
<input type="
text
" class="
form
-
control
" placeholder="
Alamat
" name="
alamat
" value="
{{
$data
->
alamat
}}
"/>
</div>
</div>
<div class="
form
-
group
">
<label> Perkerjaan </label>
<div class="
input
-
group
">
<div class="
input
-
group
-
addon
">
<i class="
fa
fa
-
dollar
"></i>
</div>
<input type="
text
" class="
form
-
control
" value="
{{
$data
->
pekerjaan
}}
" name="
pekerjaan
"/>
</div>
</div>
<div class="
form
-
group
">
<label> No Telepon </label>
<div class="
input
-
group
">
<div class="
input
-
group
-
addon
">
<i class="
fa
fa
-
dollar
"></i>
</div>
<input type="
Number
" class="
form
-
control
" value="
{{
$data
->
no_telepon
}}
" placeholder="
noTelepon
" name="
noTelepon
"/>
</div>
</div>
<div class="
form
-
group
">
<label>No Rekening </label>
<div class="
input
-
group
">
<div class="
input
-
group
-
addon
">
<i class="
fa
fa
-
dollar
"></i>
</div>
<input type="
Number
" class="
form
-
control
" value="
{{
$data
->
no_rekening
}}
" placeholder="
noRekening
" name="
noRekening
"/>
</div>
</div>
<div class="
form
-
group
">
<label>Username</label>
<div class="
input
-
group
">
<div class="
input
-
group
-
addon
">
<input type="
text
" name="
username
" class="
form
-
control
" placeholder="
Username
">
</div>
</div>
</div>
<div class="
form
-
group
">
<label>Password</label>
<div class="
input
-
group
">
<div class="
input
-
group
-
addon
">
<input type="
password
" name="
password
" class="
form
-
control
" placeholder="
Password
">
</div>
</div>
</div>
<div class="
form
-
group
" align="
right
" style="
color
:
black
;
">
<button type="
submit
" class="
btn
btn
-
primary
">Update</button>
</div>
</form>
</div>
</div>
@endsection
routes/web.php
View file @
3664c6aa
...
@@ -109,6 +109,9 @@ Route::group(['middleware' => 'customer'], function () {
...
@@ -109,6 +109,9 @@ Route::group(['middleware' => 'customer'], function () {
Route
::
group
([
'middleware'
=>
'dinaspariwisata'
],
function
()
{
Route
::
group
([
'middleware'
=>
'dinaspariwisata'
],
function
()
{
Route
::
resource
(
'admin'
,
'AdminController'
);
Route
::
resource
(
'admin'
,
'AdminController'
);
Route
::
put
(
'updateOwner/{id}'
,
'AdminController@updateOwner'
);
Route
::
get
(
'ownerr/{id}'
,
'AdminController@owner'
);
Route
::
get
(
'rincianpemilik/{id}'
,
'AdminController@rincian'
);
Route
::
get
(
'listowner'
,
'AdminController@listOwner'
);
Route
::
get
(
'listowner'
,
'AdminController@listOwner'
);
Route
::
get
(
'listPemesanan'
,
'AdminController@listPesanan'
);
Route
::
get
(
'listPemesanan'
,
'AdminController@listPesanan'
);
Route
::
get
(
'requestHomestay'
,
'AdminController@RequestHomestay'
);
Route
::
get
(
'requestHomestay'
,
'AdminController@RequestHomestay'
);
...
...
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