Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pa21617d4ti08
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
jhon
pa21617d4ti08
Commits
b0271184
Commit
b0271184
authored
May 13, 2017
by
PratiwiOkuli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CRUD Petugas oleh Admin
parent
05871c57
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
309 additions
and
27 deletions
+309
-27
AdminController.php
app/Http/Controllers/AdminController.php
+60
-0
index.blade.php
...ws/vendor/adminlte/admin/laporanTransaksi/index.blade.php
+26
-8
create.blade.php
.../views/vendor/adminlte/admin/listPetugas/create.blade.php
+99
-0
edit.blade.php
...es/views/vendor/adminlte/admin/listPetugas/edit.blade.php
+93
-0
index.blade.php
...s/views/vendor/adminlte/admin/listPetugas/index.blade.php
+25
-19
web.php
routes/web.php
+6
-0
No files found.
app/Http/Controllers/AdminController.php
View file @
b0271184
...
@@ -12,4 +12,63 @@ class AdminController extends Controller
...
@@ -12,4 +12,63 @@ class AdminController extends Controller
{
{
return
view
(
'adminlte::admin.listPetugas.index'
);
return
view
(
'adminlte::admin.listPetugas.index'
);
}
}
public
function
createPetugas
()
{
return
view
(
'adminlte::admin.listPetugas.create'
);
}
public
function
storePetugas
(
Request
$request
)
{
$this
->
validate
(
$request
,
[
'name'
=>
'required'
,
'email'
=>
'required'
,
'username'
=>
'required'
,
'password'
=>
'required'
,
'status'
=>
'required'
,
]);
$users
=
new
User
();
$users
->
name
=
$request
[
'name'
];
$users
->
email
=
$request
[
'email'
];
$users
->
username
=
$request
[
'username'
];
$users
->
password
=
bcrypt
(
$request
[
'password'
]);
$users
->
status
=
$request
[
'status'
];
$users
->
save
();
return
redirect
(
'listPetugas'
);
}
public
function
destroyPetugas
(
$id
)
{
$users
=
User
::
find
(
$id
);
$users
->
delete
();
return
redirect
(
'listPetugas'
);
}
public
function
editPetugas
(
$id
)
{
$users
=
User
::
where
(
'id'
,
$id
)
->
first
();
return
view
(
'adminlte::admin.listPetugas.edit'
)
->
with
(
'users'
,
$users
);
}
public
function
updatePetugas
(
Request
$request
,
$id
)
{
$this
->
validate
(
$request
,
[
'name'
=>
'required'
,
'email'
=>
'required'
,
'username'
=>
'required'
,
'password'
=>
'required'
,
'status'
=>
'required'
,
]);
$users
=
User
::
findOrFail
(
$id
);
$users
->
name
=
$request
->
name
;
$users
->
email
=
$request
->
email
;
$users
->
username
=
$request
->
username
;
$users
->
password
=
bcrypt
(
$request
->
password
);
$users
->
status
=
$request
->
status
;
$users
->
save
();
return
redirect
(
'listPetugas'
);
}
}
}
\ No newline at end of file
resources/views/vendor/adminlte/admin/laporanTransaksi/index.blade.php
View file @
b0271184
...
@@ -9,13 +9,31 @@
...
@@ -9,13 +9,31 @@
@
endsection
@
endsection
@
section
(
'main-content'
)
@
section
(
'main-content'
)
<
div
class
="
container
-
fluid
spark
-
screen
">
<
table
class
="
table
table
-
striped
">
<div class="
row
">
<thead>
<div class="
col
-
md
-
8
col
-
md
-
offset
-
2
">
<tr>
<div class="
panel
panel
-
default
">
<th>Username/th>
</div>
<th>Nama Barang</th>
</div>
<th>Kategori</th>
</div>
<th>Jumlah</th>
</div>
<th>Total Harga</th>
<th>Status Pengantaran</th>
</tr>
</thead>
<tbody>
@foreach(
$transaksis
as
$transaksi
)
<tr>
<td>
{
{$transaksi->username}
}
</td>
<td>
{
{$transaksi->nama_barang}
}
</td>
<td>
{
{$transaksi->kategori}
}
</td>
<td>
{
{$transaksi->jumlah}
}
</td>
<td>
{
{$transaksi->total_harga}
}
</td>
<td>
<a href="
{{
url
(
'/konfirmasi'
,
$transaksi
->
id
)
}}
" type="
submit
" button type="
button
" class="
btn
btn
-
warning
">Konfirmasi</a>
</tr>
@endforeach
</tbody>
</table>
@endsection
@endsection
resources/views/vendor/adminlte/admin/listPetugas/create.blade.php
0 → 100644
View file @
b0271184
@
extends
(
'adminlte::layouts.auth'
)
@
extends
(
'adminlte::layouts.app'
)
@
section
(
'htmlheader_title'
)
{{
trans
(
'adminlte_lang::message.home'
)
}}
@
endsection
@
section
(
'contentheader_title'
)
<
center
>
Register
Petugas
</
center
>
@
section
(
'main-content'
)
<
body
class
="
hold
-
transition
register
-
page
">
<div id="
app
">
<div class="
register
-
box
">
<!-- @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
-->
<div class="
register
-
box
-
body
">
<p class="
login
-
box
-
msg
">{{ trans('adminlte_lang::message.registermember') }}</p>
<form action="
{{
url
(
'/storePetugas'
)
}}
" 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'
)
}}
"/>
<span class="
glyphicon
glyphicon
-
user
form
-
control
-
feedback
"></span>
</div>
<div class="
form
-
group
has
-
feedback
">
<input type="
email
" class="
form
-
control
" placeholder="
{{
trans
(
'adminlte_lang::message.email'
)
}}
" name="
email
" value="
{{
old
(
'email'
)
}}
"/>
<span class="
glyphicon
glyphicon
-
envelope
form
-
control
-
feedback
"></span>
</div>
<div class="
form
-
group
has
-
feedback
">
<input type="
text
" class="
form
-
control
" placeholder="
Username
" name="
username
" value="
{{
old
(
'username'
)
}}
"/>
<span class="
glyphicon
glyphicon
-
user
form
-
control
-
feedback
"></span>
</div>
<div class="
form
-
group
has
-
feedback
">
<input type="
password
" class="
form
-
control
" placeholder="
{{
trans
(
'adminlte_lang::message.password'
)
}}
" name="
password
"/>
<span class="
glyphicon
glyphicon
-
lock
form
-
control
-
feedback
"></span>
</div>
<div class="
form
-
group
has
-
feedback
">
<input type="
password
" class="
form
-
control
" placeholder="
{{
trans
(
'adminlte_lang::message.retrypepassword'
)
}}
" name="
password_confirmation
"/>
<span class="
glyphicon
glyphicon
-
log
-
in
form
-
control
-
feedback
"></span>
</div>
<div class="
form
-
group
has
-
feedback
">
<input type="
int
" class="
form
-
control
" placeholder="
0
" name="
saldo
" readonly/>
<span class="
glyphicon
glyphicon
-
log
-
in
form
-
control
-
feedback
"></span>
</div>
<div class="
form
-
group
has
-
feedback
">
<select name="
status
" class="
form
-
control
">
<option value="
kasir
">Kasir</option>
<option value="
inventori
">Inventori</option>
</select>
</div>
<div class="
row
">
<div class="
col
-
xs
-
1
">
<label>
</label>
</div><!-- /.col -->
<div class="
col
-
xs
-
6
">
<div class="
form
-
group
">
</div>
</div><!-- /.col -->
<div class="
col
-
xs
-
4
col
-
xs
-
push
-
1
">
<button type="
submit
" class="
btn
btn
-
primary
btn
-
block
btn
-
flat
">{{ trans('adminlte_lang::message.register') }}</button>
</div><!-- /.col -->
</div>
</form>
</div><!-- /.form-box -->
</div><!-- /.register-box -->
</div>
@include('adminlte::layouts.partials.scripts_auth')
@include('adminlte::auth.terms')
<script>
$(function () {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
</script>
</body>
@endsection
@endsection
resources/views/vendor/adminlte/admin/listPetugas/edit.blade.php
0 → 100644
View file @
b0271184
@
extends
(
'adminlte::layouts.app'
)
@
section
(
'htmlheader_title'
)
Edit
@
endsection
@
section
(
'contentheader_title'
)
Page
Edit
Request
@
endsection
@
section
(
'main-content'
)
<
div
class
="
container
">
<div class="
col
-
md
-
8
col
-
md
-
offset
-
2
">
<div class="
panel
-
body
">
<form class="
form
-
horizontal
" action="
{{
url
(
'/updatePetugas'
,
$users
->
id
)
}}
" method="
POST
">
{!! csrf_field() !!}
<div class="
form
-
group
{{
$errors
->
has
(
'name'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Nama</label>
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
name
" value="
{{
$users
->
name
}}
" >
@if (
$errors->has
('name'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('name') }}</strong>
</span>
@endif
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'email'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Email</label>
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
email
" value="
{{
$users
->
email
}}
" >
@if (
$errors->has
('email'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('email') }}</strong>
</span>
@endif
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'username'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Username</label>
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
username
" value="
{{
$users
->
username
}}
" >
@if (
$errors->has
('username'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('username') }}</strong>
</span>
@endif
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'password'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Password</label>
<div class="
col
-
md
-
6
">
<input type="
password
" class="
form
-
control
" name="
password
" value="
{{
$users
->
password
}}
" >
@if (
$errors->has
('password'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'status'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
" value="
{{
$users
->
status
}}
">Status</label>
@if (
$errors->has
('status'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('status') }}</strong>
</span>
@endif
<div class="
col
-
md
-
6
">
<select name="
status
" class="
form
-
control
">
<option value="
kasir
">Kasir</option>
<option value="
inventori
">Inventori</option>
</select>
</div>
</div>
<div class="
form
-
group
">
<div class="
col
-
md
-
6
col
-
md
-
offset
-
4
">
<button type="
submit
" class="
btn
btn
-
primary
">
Simpan
</button>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
\ No newline at end of file
resources/views/vendor/adminlte/admin/listPetugas/index.blade.php
View file @
b0271184
...
@@ -9,24 +9,30 @@
...
@@ -9,24 +9,30 @@
@
endsection
@
endsection
@
section
(
'main-content'
)
@
section
(
'main-content'
)
<
div
class
="
container
-
fluid
spark
-
screen
">
<
table
class
="
table
table
-
striped
">
<div class="
row
">
<thead>
<div class="
col
-
md
-
8
col
-
md
-
offset
-
2
">
<tr>
<div class="
panel
panel
-
default
">
<th>Nama</th>
<!-- <div class="
panel
-
heading
">Home</div>
<th>Email</th>
<div class="
panel
-
body
">
<th>Username</th>
<label style="
font
-
weight
:
bolder
;
color
:
black
;
font
-
size
:
17
px
">List Pegawai</label><br>
<th>Status</th>
Merupakan halaman list pegawai UD Antoni. Admin dapat melihat daftar pegawai dan melakukan penghapusan dan penambahan pegawai baru.
<th>Action</th>
<br><br>
</tr>
</thead>
<label style="
font
-
weight
:
bolder
;
color
:
black
;
font
-
size
:
17
px
">Laporan Transaksi</label><br>
<tbody>
Merupakan halaman list transaksi dari layanan admin. User dapat melihat daftar member cafe dan melakukan penghapusan terhadap member.
@foreach(
$users
as
$user
)
</li>
<tr>
{{ trans('adminlte_lang::message.logged') }}
<td>
{
{$user->username}
}
</td>
</div> -->
<td>
{
{$user->email}
}
</td>
</div>
<td>
{
{$user->username}
}
</td>
</div>
<td>
{
{$user->status}
}
</div>
<td>
</div>
<a href="
{{
url
(
'/editPetugas'
,
$user
->
id
)
}}
" type="
submit
" button type="
button
" class="
btn
btn
-
warning
">Edit</a>
<a href="
{{
url
(
'/deletePetugas'
,
$user
->
id
)
}}
" type="
submit
" button type="
button
" class="
btn
btn
-
warning
">Delete</a></td>
</tr>
@endforeach
</tbody>
</table>
<a href="
{{
url
(
'/createPetugas'
)
}}
" button type="
button
" class="
btn
btn
-
info
">Create</a></button>
@endsection
@endsection
routes/web.php
View file @
b0271184
...
@@ -37,6 +37,12 @@ Route::group(['middleware' => ['web','auth']], function(){
...
@@ -37,6 +37,12 @@ Route::group(['middleware' => ['web','auth']], function(){
Route
::
group
([
'middleware'
=>
[
'web'
,
'auth'
,
'admin'
]],
function
()
{
Route
::
group
([
'middleware'
=>
[
'web'
,
'auth'
,
'admin'
]],
function
()
{
Route
::
get
(
'/laporanTransaksi'
,
'AdminController@laporanTransaksi'
);
Route
::
get
(
'/laporanTransaksi'
,
'AdminController@laporanTransaksi'
);
Route
::
get
(
'/listPetugas'
,
'AdminController@listPetugas'
);
Route
::
get
(
'/listPetugas'
,
'AdminController@listPetugas'
);
Route
::
get
(
'/listPetugas'
,
'AdminController@listPetugas'
);
Route
::
get
(
'/createPetugas'
,
'AdminController@createPetugas'
);
Route
::
post
(
'/storePetugas'
,
'AdminController@storePetugas'
);
Route
::
get
(
'/editPetugas/{id}'
,
'AdminController@editPetugas'
);
Route
::
post
(
'/updatePetugas/{id}'
,
'AdminController@updatePetugas'
);
Route
::
get
(
'/deletePetugas/{id}'
,
'AdminController@destroyPetugas'
);
});
});
...
...
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