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
9211fb20
Commit
9211fb20
authored
Apr 26, 2017
by
Juliper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add owner page adn list owner
parent
f474339c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
180 additions
and
1 deletion
+180
-1
AdminController.php
app/Http/Controllers/AdminController.php
+8
-0
LoginController.php
app/Http/Controllers/Auth/LoginController.php
+3
-0
OwnerController.php
app/Http/Controllers/OwnerController.php
+84
-0
listOwner.blade.php
...s/views/vendor/adminlte/layouts/admin/listOwner.blade.php
+60
-0
home.blade.php
resources/views/vendor/adminlte/layouts/owner/home.blade.php
+21
-0
sidebar.blade.php
.../views/vendor/adminlte/layouts/partials/sidebar.blade.php
+1
-1
web.php
routes/web.php
+3
-0
No files found.
app/Http/Controllers/AdminController.php
View file @
9211fb20
...
...
@@ -21,6 +21,14 @@ class AdminController extends Controller
return
view
(
'adminlte::home'
);
}
public
function
listOwner
(){
$count
=
User
::
all
()
->
where
(
'role'
,
"Owner"
)
->
count
();
$data
=
User
::
all
()
->
where
(
'role'
,
"Owner"
);
//dd($data);
return
view
(
'adminlte::layouts.admin.listOwner'
)
->
with
(
'data'
,
$data
)
->
with
(
'count'
,
$count
);
}
/**
* Show the form for creating a new resource.
*
...
...
app/Http/Controllers/Auth/LoginController.php
View file @
9211fb20
...
...
@@ -57,6 +57,9 @@ class LoginController extends Controller
if
(
Auth
::
user
()
->
role
==
'Admin'
)
{
return
redirect
()
->
intended
(
'/admin'
);
}
else
if
(
Auth
::
user
()
->
role
==
'Owner'
){
return
redirect
()
->
intended
(
'/owner'
);
}
else
{
$validator
->
errors
()
->
add
(
'password'
,
'Password tidak benar'
);
return
redirect
(
'/login'
)
...
...
app/Http/Controllers/OwnerController.php
0 → 100644
View file @
9211fb20
<?php
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
class
OwnerController
extends
Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public
function
index
()
{
return
view
(
'adminlte::layouts.owner.home'
);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public
function
create
()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public
function
store
(
Request
$request
)
{
//
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
show
(
$id
)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
edit
(
$id
)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
update
(
Request
$request
,
$id
)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
destroy
(
$id
)
{
//
}
}
resources/views/vendor/adminlte/layouts/admin/listOwner.blade.php
View file @
9211fb20
@
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 id="
app
">
@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>
@endif
<br>
<div class="
col
-
md
-
4
col
-
sm
-
6
col
-
xs
-
12
">
<div class="
info
-
box
bg
-
info
">
<span class="
info
-
box
-
icon
bg
-
yellow
"><i class="
ion
ion
-
ios
-
people
-
outline
"></i></span>
<div class="
info
-
box
-
content
">
<span class="
info
-
box
-
text
">List Owner</span>
<span class="
info
-
box
-
number
">
{
{$count}
}
</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<br>
<table class="
table
table
-
striped
">
<tr>
<th>Name</th>
<th>Username</th>
<th>Email</th>
</tr>
@foreach(
$data
as
$a
)
<td>
{
{$a->name}
}
</td>
<td>
{
{$a->username}
}
</td>
<td>
{
{$a->email}
}
</td>
@endforeach
</table>
</div>
</div>
</div>
</div>
</div>
@endsection
resources/views/vendor/adminlte/layouts/owner/home.blade.php
0 → 100644
View file @
9211fb20
@
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
-
8
col
-
md
-
offset
-
2
">
<div class="
panel
panel
-
default
">
<div class="
panel
-
heading
">Home</div>
<div class="
panel
-
body
">
{{ trans('adminlte_lang::message.logged') }}
</div>
</div>
</div>
</div>
</div>
@endsection
resources/views/vendor/adminlte/layouts/partials/sidebar.blade.php
View file @
9211fb20
...
...
@@ -36,7 +36,7 @@
<!-- Optionally, you can add icons to the links -->
<li><a
href=
"{{ url('home') }}"
><i
class=
'fa fa-home'
></i>
<span>
{{ trans('adminlte_lang::message.home') }}
</span></a></li>
<li><a
href=
"{{url('admin/create')}}"
><i
class=
'fa fa-plus'
></i>
<span>
{{ trans('adminlte_lang::message.addOwner') }}
</span></a></li>
<li><a
href=
"{{url('
admin/create
')}}"
><i
class=
'fa fa-list'
></i>
<span>
{{ trans('adminlte_lang::message.listOwner') }}
</span></a></li>
<li><a
href=
"{{url('
listowner
')}}"
><i
class=
'fa fa-list'
></i>
<span>
{{ trans('adminlte_lang::message.listOwner') }}
</span></a></li>
@elseif(Auth::user()->role=="Owner")
...
...
routes/web.php
View file @
9211fb20
...
...
@@ -30,3 +30,6 @@ Route::group(['middleware' => 'auth'], function () {
Route
::
resource
(
'admin'
,
'AdminController'
);
Route
::
get
(
'listowner'
,
'AdminController@listOwner'
);
Route
::
resource
(
'owner'
,
'OwnerController'
);
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