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
05871c57
Commit
05871c57
authored
7 years ago
by
PratiwiOkuli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Browse Image pada CRUD Barang
parent
5a06f618
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
63 deletions
+27
-63
InventoriController.php
app/Http/Controllers/InventoriController.php
+1
-5
create.blade.php
...ews/vendor/adminlte/inventori/ListBarang/create.blade.php
+6
-18
edit.blade.php
...views/vendor/adminlte/inventori/ListBarang/edit.blade.php
+4
-22
index.blade.php
...iews/vendor/adminlte/inventori/ListBarang/index.blade.php
+16
-18
No files found.
app/Http/Controllers/InventoriController.php
View file @
05871c57
...
@@ -23,11 +23,10 @@ class InventoriController extends Controller
...
@@ -23,11 +23,10 @@ class InventoriController extends Controller
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
$this
->
validate
(
$request
,
[
$this
->
validate
(
$request
,
[
'nama'
=>
'required'
,
'nama'
=>
'required'
,
'jumlah'
=>
'required'
,
'jumlah'
=>
'required'
,
'harga'
=>
'required'
,
'harga'
=>
'required'
,
'deskripsi'
=>
'required'
,
'kategori'
=>
'required'
,
'kategori'
=>
'required'
,
'gambar'
=>
'required'
,
'gambar'
=>
'required'
,
]);
]);
...
@@ -36,7 +35,6 @@ class InventoriController extends Controller
...
@@ -36,7 +35,6 @@ class InventoriController extends Controller
$barangs
->
nama
=
$request
[
'nama'
];
$barangs
->
nama
=
$request
[
'nama'
];
$barangs
->
jumlah
=
$request
[
'jumlah'
];
$barangs
->
jumlah
=
$request
[
'jumlah'
];
$barangs
->
harga
=
$request
[
'harga'
];
$barangs
->
harga
=
$request
[
'harga'
];
$barangs
->
deskripsi
=
$request
[
'deskripsi'
];
$barangs
->
kategori
=
$request
[
'kategori'
];
$barangs
->
kategori
=
$request
[
'kategori'
];
$barangs
->
gambar
=
$request
[
'gambar'
];
$barangs
->
gambar
=
$request
[
'gambar'
];
$barangs
->
save
();
$barangs
->
save
();
...
@@ -57,7 +55,6 @@ class InventoriController extends Controller
...
@@ -57,7 +55,6 @@ class InventoriController extends Controller
'nama'
=>
'required'
,
'nama'
=>
'required'
,
'jumlah'
=>
'required'
,
'jumlah'
=>
'required'
,
'harga'
=>
'required'
,
'harga'
=>
'required'
,
'deskripsi'
=>
'required'
,
'kategori'
=>
'required'
,
'kategori'
=>
'required'
,
'gambar'
=>
'required'
,
'gambar'
=>
'required'
,
]);
]);
...
@@ -66,7 +63,6 @@ class InventoriController extends Controller
...
@@ -66,7 +63,6 @@ class InventoriController extends Controller
$barangs
->
nama
=
$request
->
nama
;
$barangs
->
nama
=
$request
->
nama
;
$barangs
->
jumlah
=
$request
->
jumlah
;
$barangs
->
jumlah
=
$request
->
jumlah
;
$barangs
->
harga
=
$request
->
harga
;
$barangs
->
harga
=
$request
->
harga
;
$barangs
->
deskripsi
=
$request
->
deskripsi
;
$barangs
->
kategori
=
$request
->
kategori
;
$barangs
->
kategori
=
$request
->
kategori
;
$barangs
->
gambar
=
$request
->
gambar
;
$barangs
->
gambar
=
$request
->
gambar
;
$barangs
->
save
();
$barangs
->
save
();
...
...
This diff is collapsed.
Click to expand it.
resources/views/vendor/adminlte/inventori/ListBarang/create.blade.php
View file @
05871c57
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
@
endsection
@
endsection
@
section
(
'main-content'
)
@
section
(
'main-content'
)
<
div
class
="
container
">
<
div
class
="
container
">
<div class="
col
-
md
-
8
col
-
md
-
offset
-
2
">
<div class="
col
-
md
-
8
col
-
md
-
offset
-
2
">
<div class="
panel
-
body
">
<div class="
panel
-
body
">
<form class="
form
-
horizontal
" action="
{{
url
(
'store'
)
}}
" method="
POST
">
<form class="
form
-
horizontal
" action="
{{
url
(
'store'
)
}}
" method="
POST
">
...
@@ -50,19 +50,6 @@
...
@@ -50,19 +50,6 @@
</div>
</div>
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'deskripsi'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Deskripsi</label>
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
deskripsi
" value="
{{
old
(
'deskripsi'
)
}}
" >
@if (
$errors->has
('deskripsi'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('deskripsi') }}</strong>
</span>
@endif
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'kategori'
)
?
' has-error'
:
''
}}
">
<div class="
form
-
group
{{
$errors
->
has
(
'kategori'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Kategori</label>
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Kategori</label>
<div class="
col
-
md
-
6
">
<div class="
col
-
md
-
6
">
...
@@ -81,18 +68,19 @@
...
@@ -81,18 +68,19 @@
</div>
</div>
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'
gambar
'
)
?
' has-error'
:
''
}}
">
<div class="
form
-
group
{{
$errors
->
has
(
'
images
'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Gambar</label>
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Gambar</label>
<div class="
col
-
md
-
6
">
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
gambar
" value="
{{
old
(
'gambar'
)
}}
" >
<input type="
file
" class="
inputimages
" name="
gambar
" value="
{{
old
(
'gambar'
)
}}
" >
@if (
$errors->has
('
gambar
'))
@if (
$errors->has
('
image
'))
<span class="
help
-
block
">
<span class="
help
-
block
">
<strong>{{
$errors->first
('
gambar
') }}</strong>
<strong>{{
$errors->first
('
image
') }}</strong>
</span>
</span>
@endif
@endif
</div>
</div>
</div>
</div>
<div class="
form
-
group
">
<div class="
form
-
group
">
<div class="
col
-
md
-
6
col
-
md
-
offset
-
4
">
<div class="
col
-
md
-
6
col
-
md
-
offset
-
4
">
<input type="
hidden
" name="
_token
" value="
{{
csrf_token
()
}}
">
<input type="
hidden
" name="
_token
" value="
{{
csrf_token
()
}}
">
...
...
This diff is collapsed.
Click to expand it.
resources/views/vendor/adminlte/inventori/ListBarang/edit.blade.php
View file @
05871c57
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
@
endsection
@
endsection
@
section
(
'main-content'
)
@
section
(
'main-content'
)
<
div
class
="
container
">
<
div
class
="
container
">
<div class="
col
-
md
-
8
col
-
md
-
offset
-
2
">
<div class="
col
-
md
-
8
col
-
md
-
offset
-
2
">
<div class="
panel
-
body
">
<div class="
panel
-
body
">
<form class="
form
-
horizontal
" action="
{{
url
(
'update'
,
$barangs
->
id
)
}}
" method="
POST
">
<form class="
form
-
horizontal
" action="
{{
url
(
'update'
,
$barangs
->
id
)
}}
" method="
POST
">
...
@@ -51,18 +51,6 @@
...
@@ -51,18 +51,6 @@
</div>
</div>
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'deskripsi'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Deskripsi</label>
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
deskripsi
" value="
{{
$barangs
->
deskripsi
}}
" >
@if (
$errors->has
('deskripsi'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('deskripsi') }}</strong>
</span>
@endif
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'kategori'
)
?
' has-error'
:
''
}}
">
<div class="
form
-
group
{{
$errors
->
has
(
'kategori'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
" value="
{{
$barangs
->
gambar
}}
">Kategori</label>
<label for="
title
" class="
col
-
md
-
4
control
-
label
" value="
{{
$barangs
->
gambar
}}
">Kategori</label>
...
@@ -82,20 +70,14 @@
...
@@ -82,20 +70,14 @@
</div>
</div>
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'
gambar
'
)
?
' has-error'
:
''
}}
">
<div class="
form
-
group
{{
$errors
->
has
(
'
image
'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Gambar</label>
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Gambar</label>
<div class="
col
-
md
-
6
">
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
gambar
" value="
{{
$barangs
->
gambar
}}
" >
<input type="
file
" class="
inputimages
" name="
gambar
" value="
{{
$barangs
->
gambar
}}
" >
@if (
$errors->has
('gambar'))
{!!
$errors->first
('gambar', '<p class="
help
-
block
">:message</p>') !!}
<span class="
help
-
block
">
<strong>{{
$errors->first
('gambar') }}</strong>
</span>
@endif
</div>
</div>
</div>
</div>
<div class="
form
-
group
">
<div class="
form
-
group
">
<div class="
col
-
md
-
6
col
-
md
-
offset
-
4
">
<div class="
col
-
md
-
6
col
-
md
-
offset
-
4
">
<button type="
submit
" class="
btn
btn
-
primary
">
<button type="
submit
" class="
btn
btn
-
primary
">
...
...
This diff is collapsed.
Click to expand it.
resources/views/vendor/adminlte/inventori/ListBarang/index.blade.php
View file @
05871c57
...
@@ -11,32 +11,30 @@
...
@@ -11,32 +11,30 @@
@
section
(
'main-content'
)
@
section
(
'main-content'
)
<
table
class
="
table
table
-
striped
">
<
table
class
="
table
table
-
striped
">
<thead>
<thead>
<tr>
<tr>
<th>Nama Barang</th>
<th>Nama Barang</th>
<th>Stock</th>
<th>Stock</th>
<th>Harga</th>
<th>Harga</th>
<th>Deskripsi</th>
<th>Kategori</th>
<th>Kategori</th>
<th>Gambar</th>
<th>Gambar</th>
<th>Action</th>
<th>Action</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
@foreach(
$barangs
as
$barang
)
@foreach(
$barangs
as
$barang
)
<tr>
<tr>
<td>
{
{$barang->nama}
}
</td>
<td>
{
{$barang->nama}
}
</td>
<td>
{
{$barang->jumlah}
}
</td>
<td>
{
{$barang->jumlah}
}
</td>
<td>
{
{$barang->harga}
}
</td>
<td>
{
{$barang->harga}
}
</td>
<td>
{
{$barang->deskripsi}
}
</td>
<td>
{
{$barang->kategori}
}
</td>
<td>
{
{$barang->kategori}
}
</td>
<td><img src="
{{
asset
(
'image/'
.
$barang
->
gambar
)
}}
" style="
height
:
150
px
;
width
:
200
px
;
"> </td>
<td>
{
{$barang->gambar}
}
</td>
<td>
<td>
<a href="
{{
url
(
'/edit'
,
$barang
->
id
)
}}
" type="
submit
" button type="
button
" class="
btn
btn
-
warning
">Edit</a>
<a href="
{{
url
(
'/edit'
,
$barang
->
id
)
}}
" type="
submit
" button type="
button
" class="
btn
btn
-
warning
">Edit</a>
<a href="
{{
url
(
'/delete'
,
$barang
->
id
)
}}
" class="
btn
btn
-
warning
">Delete</a>
<a href="
{{
url
(
'/delete'
,
$barang
->
id
)
}}
" class="
btn
btn
-
warning
">Delete</a>
<!-- <a href="
{{
url
(
'/delete'
,
$barang
->
id
)
}}
" <onclick="
return
confirm
(
'Yakin mau hapus data ini sob?'
)
" class="
btn
btn
-
warning
">Delete</a> -->
<!-- <a href="
{{
url
(
'/delete'
,
$barang
->
id
)
}}
" <onclick="
return
confirm
(
'Yakin mau hapus data ini sob?'
)
" class="
btn
btn
-
warning
">Delete</a> -->
</tr>
</tr>
@endforeach
@endforeach
</tbody>
</tbody>
</table>
</table>
<a href="
{{
url
(
'/create'
)
}}
" button type="
button
" class="
btn
btn
-
info
">Create</a></button>
<a href="
{{
url
(
'/create'
)
}}
" button type="
button
" class="
btn
btn
-
info
">Create</a></button>
...
...
This diff is collapsed.
Click to expand it.
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