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
2ee9b1c4
Commit
2ee9b1c4
authored
May 09, 2017
by
Juliper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Controller Customer and Register
parent
3ebac740
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
159 additions
and
28 deletions
+159
-28
Customer.php
app/Customer.php
+14
-0
AdminController.php
app/Http/Controllers/AdminController.php
+0
-14
RegisterController.php
app/Http/Controllers/Auth/RegisterController.php
+29
-7
CustomerController.php
app/Http/Controllers/CustomerController.php
+54
-0
login.blade.php
resources/views/vendor/adminlte/auth/login.blade.php
+1
-1
register.blade.php
resources/views/vendor/adminlte/auth/register.blade.php
+1
-1
profiles.blade.php
...iews/vendor/adminlte/layouts/customers/profiles.blade.php
+55
-0
mainheader.blade.php
...ews/vendor/adminlte/layouts/partials/mainheader.blade.php
+1
-1
mainheader.blade.php
...s/vendor/adminlte/layouts/partialweb/mainheader.blade.php
+1
-3
web.php
routes/web.php
+3
-1
No files found.
app/Customer.php
0 → 100644
View file @
2ee9b1c4
<?php
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
class
Customer
extends
Model
{
protected
$table
=
"pelanggan"
;
protected
$fillable
=
[
'id_Akun'
,
'nama'
,
'alamat'
,
'noTelepon'
,
'pekerjaan'
,
];
}
app/Http/Controllers/AdminController.php
View file @
2ee9b1c4
...
...
@@ -61,20 +61,6 @@ class AdminController extends Controller
return
redirect
(
url
(
'admin/create'
))
->
with
(
'info'
,
'User berhasil ditambah '
);
}
public
function
show
(
$id
)
{
//
}
public
function
edit
(
$id
)
{
//
}
public
function
update
(
Request
$request
,
$id
)
{
//
}
public
function
RequestHomestay
(){
...
...
app/Http/Controllers/Auth/RegisterController.php
View file @
2ee9b1c4
...
...
@@ -2,7 +2,9 @@
namespace
App\Http\Controllers\Auth
;
use
App\Customer
;
use
App\User
;
use
Illuminate\Support\Facades\DB
;
use
Validator
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Foundation\Auth\RegistersUsers
;
...
...
@@ -77,12 +79,32 @@ class RegisterController extends Controller
*/
protected
function
create
(
array
$data
)
{
return
User
::
create
([
'name'
=>
$data
[
'name'
],
'username'
=>
$data
[
'username'
],
'email'
=>
$data
[
'email'
],
'password'
=>
bcrypt
(
$data
[
'password'
]),
'role'
=>
'Customer'
,
]);
//dd("masuk agan");
$user
=
new
User
();
$user
->
name
=
$data
[
'name'
];
$user
->
username
=
$data
[
'username'
];
$user
->
email
=
$data
[
'email'
];
$user
->
password
=
bcrypt
(
$data
[
'password'
]);
$user
->
role
=
"Customer"
;
$user
->
foto
=
"gravatar.png"
;
$user
->
save
();
$dataPel
=
DB
::
table
(
'users'
)
->
select
(
'users.id'
)
->
where
(
'users.username'
,
'='
,
$data
[
'username'
])
->
get
();
$cus
=
new
Customer
();
$cus
->
id_Akun
=
$dataPel
[
0
]
->
id
;
$cus
->
nama
=
$data
[
'name'
]
;
$cus
->
alamat
=
"---"
;
$cus
->
noTelepon
=
"---"
;
$cus
->
pekerjaan
=
"---"
;
$cus
->
save
();
//return redirect('/');
}
}
app/Http/Controllers/CustomerController.php
0 → 100644
View file @
2ee9b1c4
<?php
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
use
App\User
;
use
App\Customer
;
use
Illuminate\Support\Facades\DB
;
class
CustomerController
extends
Controller
{
public
function
profile
(){
//dd("masuk agan");
// dd(Auth::user()->id);
return
view
(
'adminlte::layouts.customers.profiles'
);
}
public
function
register
(){
return
view
(
'adminlte::auth.register'
);
}
public
function
registerStore
(
Request
$data
){
$user
=
new
User
();
$user
->
name
=
$data
[
'name'
];
$user
->
username
=
$data
[
'username'
];
$user
->
email
=
$data
[
'email'
];
$user
->
password
=
bcrypt
(
$data
[
'password'
]);
$user
->
role
=
"Customer"
;
$user
->
foto
=
"gravatar.png"
;
$user
->
save
();
$dataPel
=
DB
::
table
(
'users'
)
->
select
(
'users.id'
)
->
where
(
'users.username'
,
'='
,
$data
[
'username'
])
->
get
();
$cus
=
new
Customer
();
$cus
->
id_Akun
=
$dataPel
[
0
]
->
id
;
$cus
->
nama
=
$data
[
'name'
]
;
$cus
->
alamat
=
"---"
;
$cus
->
noTelepon
=
"---"
;
$cus
->
pekerjaan
=
"---"
;
$cus
->
save
();
return
redirect
(
'/'
);
}
}
resources/views/vendor/adminlte/auth/login.blade.php
View file @
2ee9b1c4
...
...
@@ -52,7 +52,7 @@
<a href="
{{
url
(
'/password/reset'
)
}}
">{{ trans('adminlte_lang::message.forgotpassword') }}</a><br>
<a href="
{{
url
(
'/
registe
r'
)
}}
" class="
text
-
center
">{{ trans('adminlte_lang::message.registermember') }}</a>
<a href="
{{
url
(
'/
dafta
r'
)
}}
" class="
text
-
center
">{{ trans('adminlte_lang::message.registermember') }}</a>
</div><!-- /.login-box-body -->
...
...
resources/views/vendor/adminlte/auth/register.blade.php
View file @
2ee9b1c4
...
...
@@ -26,7 +26,7 @@
<div class="
register
-
box
-
body
">
<p class="
login
-
box
-
msg
">{{ trans('adminlte_lang::message.registermember') }}</p>
<form action="
{{
url
(
'/
registe
r'
)
}}
" method="
post
">
<form action="
{{
url
(
'/
dafta
r'
)
}}
" method="
post
">
<input type="
hidden
" name="
_token
" value="
{{
csrf_token
()
}}
">
<div class="
form
-
group
has
-
feedback
">
<input type="
text
" class="
form
-
control
" placeholder="
{{
trans
(
'adminlte_lang::message.fullname'
)
}}
" name="
name
" value="
{{
old
(
'name'
)
}}
"/>
...
...
resources/views/vendor/adminlte/layouts/customers/profiles.blade.php
0 → 100644
View file @
2ee9b1c4
@
extends
(
'adminlte::layouts.master'
)
@
section
(
'main-content'
)
<
div
class
="
cuisines
agileits
w3layouts
" style="
padding
-
top
:
50
px
;
margin
-
top
:
40
px
;
">
<div class="
container
">
<div class="
col
-
md
-
4
col
-
sm
-
4
cuisines
-
grids
agileits
w3layouts
cuisines
-
grids
-
2
wow
slideInRight
">
<img src="
img
/
avatar3
.
png
" alt="
Agileits
W3layouts
">
<h2 style="
text
-
align
:
center
;
margin
-
top
:
3
px
;
"> Palti Sinaga </h2>
</div>
<div class="
col
-
md
-
8
col
-
sm
-
8
cuisines
-
grids
agileits
w3layouts
cuisines
-
grids
-
1
wow
slideInLeft
">
<h3>Data Diri</h3>
<table class="
table
-
condensed
" style="
font
-
size
:
16
px
;
margin
-
left
:
-
3
px
;
color
:
#777">
<
tr
>
<
td
>
Tempat
/
Tanggal
Lahir
</
td
>
<
td
>
Palti
Sinaga
</
td
>
</
tr
>
<
tr
>
<
td
>
Kelaasdas
</
td
>
<
td
>
test
</
td
>
</
tr
>
<
tr
>
<
td
>
Tempaasfasdt
/
Tanggal
Lahir
</
td
>
<
td
>
Palti
Sinaga
</
td
>
</
tr
>
<
tr
>
<
td
>
Kelasdas
</
td
>
<
td
>
test
</
td
>
</
tr
>
<
tr
>
<
td
>
Tempaqwdat
/
Tanggal
Lahir
</
td
>
<
td
>
Palti
Sinaga
</
td
>
</
tr
>
<
tr
>
<
td
>
Keasddlas
</
td
>
<
td
>
test
</
td
>
</
tr
>
</
table
>
<
br
><
br
>
<
h3
>
Testimoni
</
h3
>
<
p
>
Lorem
ipsum
dolor
sit
amet
,
consectetur
adipisicing
elit
,
sed
do
eiusmod
tempor
incididunt
ut
labore
et
dolore
magna
aliqua
.
Ut
enim
ad
minim
veniam
,
quis
nostrud
exercitation
ullamco
laboris
nisi
ut
aliquip
ex
ea
commodo
consequat
.
Duis
aute
irure
dolor
in
reprehenderit
in
voluptate
velit
esse
cillum
dolore
eu
fugiat
nulla
pariatur
.
Excepteur
sint
occaecat
cupidatat
non
proident
,
sunt
in
culpa
qui
officia
deserunt
mollit
anim
id
est
laborum
.</
p
>
<
div
class
="
services
agileits
w3layouts
" style="
background
-
color
:
#fff; padding: 1px 1px 1px 0px; margin-top: 30px;">
<
a
class
="
agileits
w3layoutswow
slideInLeft
" href="
gallery
.
html
" >Edit Profile <span class="
glyphicon
agileits
w3layouts
glyphicon
-
arrow
-
right
" aria-hidden="
true
"></span></a>
<a class="
agileits
w3layoutswow
slideInLeft
" href="
gallery
.
html
">History <span class="
glyphicon
agileits
w3layouts
glyphicon
-
arrow
-
right
" aria-hidden="
true
"></span></a>
</div>
</div>
<div class="
clearfix
"></div>
</div>
</div>
@endsection
\ No newline at end of file
resources/views/vendor/adminlte/layouts/partials/mainheader.blade.php
View file @
2ee9b1c4
...
...
@@ -78,7 +78,7 @@
<!-- Menu Footer-->
<li
class=
"user-footer"
>
<div
class=
"pull-left"
>
<a
href=
"{{ url('
p
rofile') }}"
class=
"btn btn-default btn-flat"
>
{{ trans('adminlte_lang::message.profile') }}
</a>
<a
href=
"{{ url('
customerP
rofile') }}"
class=
"btn btn-default btn-flat"
>
{{ trans('adminlte_lang::message.profile') }}
</a>
</div>
<div
class=
"pull-right"
>
<a
href=
"{{ url('/logout') }}"
class=
"btn btn-default btn-flat"
...
...
resources/views/vendor/adminlte/layouts/partialweb/mainheader.blade.php
View file @
2ee9b1c4
...
...
@@ -45,7 +45,7 @@
<!-- Menu Footer-->
<li
class=
"user-footer"
>
<div
class=
"pull-left"
>
<a
href=
"{{ url('
p
rofile') }}"
class=
"btn btn-default btn-flat"
>
{{ trans('adminlte_lang::message.profile') }}
</a>
<a
href=
"{{ url('
customerP
rofile') }}"
class=
"btn btn-default btn-flat"
>
{{ trans('adminlte_lang::message.profile') }}
</a>
</div>
<div
class=
"pull-right"
>
<a
href=
"{{ url('/logout') }}"
class=
"btn btn-default btn-flat"
...
...
@@ -75,4 +75,3 @@
<div
class=
"clearfix"
style=
"margin-bottom: 15px;"
></div>
</div>
<!-- //Header
\ No newline at end of file
routes/web.php
View file @
2ee9b1c4
...
...
@@ -44,10 +44,12 @@ Route::group(['middleware' => 'auth'], function () {
#adminlte_routes
});
Route
::
get
(
'daftar'
,
'CustomerController@register'
);
Route
::
post
(
'daftar'
,
'CustomerController@registerStore'
);
Route
::
resource
(
'admin'
,
'AdminController'
);
Route
::
get
(
'listowner'
,
'AdminController@listOwner'
);
Route
::
resource
(
'owner'
,
'OwnerController'
);
Route
::
get
(
'customerProfile'
,
'CustomerController@profile'
);
route
::
get
(
'profile'
,
'OwnerController@profile'
);
Route
::
get
(
'profile/{id}/profiledit'
,
'OwnerController@editProfile'
);
Route
::
get
(
'profileUpdate/{id}'
,
'OwnerController@updatePro'
);
...
...
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