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
344e93f8
Commit
344e93f8
authored
Apr 30, 2017
by
Juliper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update profil
parent
3d90ab1a
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
137 additions
and
9 deletions
+137
-9
AdminController.php
app/Http/Controllers/AdminController.php
+10
-1
OwnerController.php
app/Http/Controllers/OwnerController.php
+26
-2
Owner.php
app/Owner.php
+15
-0
profil.blade.php
...rces/views/vendor/adminlte/layouts/owner/profil.blade.php
+28
-4
updateProfil.blade.php
...iews/vendor/adminlte/layouts/owner/updateProfil.blade.php
+54
-0
mainheader.blade.php
...ews/vendor/adminlte/layouts/partials/mainheader.blade.php
+1
-1
sidebar.blade.php
.../views/vendor/adminlte/layouts/partials/sidebar.blade.php
+0
-1
web.php
routes/web.php
+2
-0
message.php
.../admin-lte-template-laravel/resources/lang/en/message.php
+1
-0
No files found.
app/Http/Controllers/AdminController.php
View file @
344e93f8
...
@@ -7,6 +7,7 @@ use App\User;
...
@@ -7,6 +7,7 @@ use App\User;
use
Validator
;
use
Validator
;
use
App\Http\Controllers\Controller
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Foundation\Auth\RegistersUsers
;
use
Illuminate\Foundation\Auth\RegistersUsers
;
use
App\Owner
;
class
AdminController
extends
Controller
class
AdminController
extends
Controller
{
{
...
@@ -55,10 +56,18 @@ class AdminController extends Controller
...
@@ -55,10 +56,18 @@ class AdminController extends Controller
$user
->
password
=
bcrypt
(
$data
[
'password'
]);
$user
->
password
=
bcrypt
(
$data
[
'password'
]);
$user
->
role
=
'Owner'
;
$user
->
role
=
'Owner'
;
$owner
=
new
Owner
();
$owner
->
nama
=
$data
[
'name'
];
$owner
->
alamat
=
'--'
;
$owner
->
pekerjaan
=
'--'
;
$owner
->
noTelepon
=
'--'
;
$owner
->
noRekening
=
'--'
;
$owner
->
foto
=
'img/gravatar.png'
;
//dd($user);
//dd($user);
$user
->
save
();
$user
->
save
();
$owner
->
save
();
//dd("berhasil agan");
return
redirect
(
url
(
'admin/create'
))
->
with
(
'info'
,
'User berhasil ditambah '
);
return
redirect
(
url
(
'admin/create'
))
->
with
(
'info'
,
'User berhasil ditambah '
);
}
}
...
...
app/Http/Controllers/OwnerController.php
View file @
344e93f8
...
@@ -3,6 +3,10 @@
...
@@ -3,6 +3,10 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
App\User
;
use
App\Owner
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\DB
;
class
OwnerController
extends
Controller
class
OwnerController
extends
Controller
{
{
...
@@ -17,7 +21,15 @@ class OwnerController extends Controller
...
@@ -17,7 +21,15 @@ class OwnerController extends Controller
}
}
public
function
profile
(){
public
function
profile
(){
return
view
(
'adminlte::layouts.owner.profil'
);
$users
=
User
::
find
(
Auth
::
user
()
->
id
);
//dd($users->name);
//$data = Owner::where('nama',$users->name);
$data
=
DB
::
table
(
'pemilikhomestay'
)
->
where
(
'nama'
,
$users
->
name
)
->
first
();
//dd($data);
return
view
(
'adminlte::layouts.owner.profil'
)
->
with
(
'data'
,
$data
);
}
}
/**
/**
* Show the form for creating a new resource.
* Show the form for creating a new resource.
...
@@ -62,6 +74,19 @@ class OwnerController extends Controller
...
@@ -62,6 +74,19 @@ class OwnerController extends Controller
//
//
}
}
public
function
editProfile
(
$id
){
//$users = User::find(Auth::user()->id);
$data
=
Owner
::
find
(
$id
);
//all()->where('id_Owner',$id);
//dd($data);
return
view
(
'adminlte::layouts.owner.updateProfil'
)
->
with
(
'data'
,
$data
);
}
public
function
updateProfile
(
Request
$request
,
$id
){
dd
(
$request
,
$id
);
}
/**
/**
* Update the specified resource in storage.
* Update the specified resource in storage.
*
*
...
@@ -71,7 +96,6 @@ class OwnerController extends Controller
...
@@ -71,7 +96,6 @@ class OwnerController extends Controller
*/
*/
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
//
}
}
/**
/**
...
...
app/Owner.php
0 → 100644
View file @
344e93f8
<?php
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
class
Owner
extends
Model
{
protected
$table
=
"pemilikhomestay"
;
protected
$fillable
=
[
'nama'
,
'alamat'
,
'pekerjaan'
,
'noTelepon'
,
'noRekening'
,
'foto'
,
];
}
resources/views/vendor/adminlte/layouts/owner/profil.blade.php
View file @
344e93f8
...
@@ -15,17 +15,41 @@
...
@@ -15,17 +15,41 @@
<div class="
panel
-
body
">
<div class="
panel
-
body
">
<div class="
row
">
<div class="
row
">
<div class="
col
-
md
-
3
col
-
lg
-
3
" align="
center
">
<div class="
col
-
md
-
3
col
-
lg
-
3
" align="
center
">
<img alt="
User
Pic
" src="
img
/
gravatar
.
png
" class="
img
-
circle
img
-
responsive
">
<img alt="
User
Pic
" src="
{{
$data
->
foto
}}
" class="
img
-
circle
img
-
responsive
">
</div>
</div>
<div class="
col
-
md
-
9
col
-
lg
-
9
">
<div class="
col
-
md
-
9
col
-
lg
-
8
">
<table class="
table
table
-
user
-
information
">
<table class="
table
table
-
user
-
information
">
<tr>
<th>Nama </th>
<td>: </td>
<td>
{
{$data->nama}
}
</td>
</tr>
<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->noTelepon}
}
</td>
</tr>
<tr>
<th>No Rekening </th>
<td>: </td>
<td>
{
{$data->noRekening}
}
</td>
</tr>
</table>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="
panel
-
footer
">
<div class="
panel
-
footer
">
<a href="" data-original-title="
Edit
this
user
" data-toggle="
tooltio
" type="
button
" class="
btn
btn
-
sm
btn
-
warning
">
<a href="
{{
url
(
'profile/'
.
$data
->
id_Owner
.
'/profiledit'
)}}
" data-original-title="
Edit
this
user
" data-toggle="
tooltio
" type="
button
" class="
btn
btn
-
sm
btn
-
warning
">
<i class="
glyphicon
glyphicon
-
edit
"></i>
<i class="
glyphicon
glyphicon
-
edit
"></i>
</a>
</a>
</div>
</div>
...
...
resources/views/vendor/adminlte/layouts/owner/updateProfil.blade.php
0 → 100644
View file @
344e93f8
@
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
-
body
">
@if(Session::has('alert-success'))
<div class="
alert
alert
-
success
">
{{ Session::get('alert-success') }}
</div>
@endif
@if (count(
$errors
) > 0)
<div class="
alert
alert
-
danger
">
<ul>
@foreach (
$errors->all
() as
$error
)
<li>{{
$error
}}</li>
@endforeach
</ul>
</div>
@endif
<form action="
{{
url
(
'profileUpdate/'
.
$data
->
id
)}}
" method="
post
" enctype="
multipart
/
form
-
data
"><input type="
hidden
" name="
_method
" value="
PUT
">
{
{csrf_field()}
}
<label>Nama</label>
<input type="
text
" name="
nama
" value="
{{
$data
->
nama
}}
" id="
nama
" class="
form
-
control
">
<label>Alamat</label>
<input type="
text
" name="
alamt
" value="
{{
$data
->
alamat
}}
" id="
alamat
" class="
form
-
control
">
<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
">
<label>Nomor Rekening</label>
<input type="
text
" name="
noRekening
" value="
{{
$data
->
noRekening
}}
" 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
">
<input type="
submit
" class="
btn
btn
-
primary
" value="
simpan
">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection
\ No newline at end of file
resources/views/vendor/adminlte/layouts/partials/mainheader.blade.php
View file @
344e93f8
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
<!-- Menu Footer-->
<!-- Menu Footer-->
<li
class=
"user-footer"
>
<li
class=
"user-footer"
>
<div
class=
"pull-left"
>
<div
class=
"pull-left"
>
<a
href=
"{{ url('
/settings
') }}"
class=
"btn btn-default btn-flat"
>
{{ trans('adminlte_lang::message.profile') }}
</a>
<a
href=
"{{ url('
profile
') }}"
class=
"btn btn-default btn-flat"
>
{{ trans('adminlte_lang::message.profile') }}
</a>
</div>
</div>
<div
class=
"pull-right"
>
<div
class=
"pull-right"
>
<a
href=
"{{ url('/logout') }}"
class=
"btn btn-default btn-flat"
<a
href=
"{{ url('/logout') }}"
class=
"btn btn-default btn-flat"
...
...
resources/views/vendor/adminlte/layouts/partials/sidebar.blade.php
View file @
344e93f8
...
@@ -40,7 +40,6 @@
...
@@ -40,7 +40,6 @@
@elseif(Auth::user()->role=="Owner")
@elseif(Auth::user()->role=="Owner")
<li
class=
"header"
>
{{ trans('adminlte_lang::message.header') }}
</li>
<li
class=
"header"
>
{{ trans('adminlte_lang::message.header') }}
</li>
<li><a
href=
"{{ url('profile') }}"
><i
class=
'glyphicon glyphicon-user'
></i>
<span>
{{ trans('adminlte_lang::message.profile') }}
</span></a></li>
@endif
@endif
...
...
routes/web.php
View file @
344e93f8
...
@@ -33,4 +33,6 @@ Route::resource('admin', 'AdminController');
...
@@ -33,4 +33,6 @@ Route::resource('admin', 'AdminController');
Route
::
get
(
'listowner'
,
'AdminController@listOwner'
);
Route
::
get
(
'listowner'
,
'AdminController@listOwner'
);
Route
::
resource
(
'owner'
,
'OwnerController'
);
Route
::
resource
(
'owner'
,
'OwnerController'
);
route
::
get
(
'profile'
,
'OwnerController@profile'
);
route
::
get
(
'profile'
,
'OwnerController@profile'
);
Route
::
get
(
'profile/{id}/profiledit'
,
'OwnerController@editProfile'
);
Route
::
get
(
'profileUpdate/{id}'
,
'OwnerController@updateProfile'
);
vendor/acacha/admin-lte-template-laravel/resources/lang/en/message.php
View file @
344e93f8
...
@@ -134,6 +134,7 @@ return [
...
@@ -134,6 +134,7 @@ return [
'username'
=>
'Username'
,
'username'
=>
'Username'
,
'listOwner'
=>
'List Owner'
,
'listOwner'
=>
'List Owner'
,
'profile'
=>
'Profile'
,
'profile'
=>
'Profile'
,
'namaHomestay'
=>
'Nama Homestay'
,
];
];
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