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
c5d1f3ff
Commit
c5d1f3ff
authored
May 15, 2017
by
jhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inventori-> Daftar Request
parent
5a06f618
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
263 additions
and
1 deletion
+263
-1
InventoriController.php
app/Http/Controllers/InventoriController.php
+81
-1
createDataRequest.blade.php
...dminlte/inventori/DataRequest/createDataRequest.blade.php
+72
-0
editDataRequest.blade.php
.../adminlte/inventori/DataRequest/editDataRequest.blade.php
+73
-0
index.blade.php
...ews/vendor/adminlte/inventori/DataRequest/index.blade.php
+37
-0
No files found.
app/Http/Controllers/InventoriController.php
View file @
c5d1f3ff
...
...
@@ -8,6 +8,11 @@ use App\Http\Requests;
use
App\Barang
;
use
App\RequestBarang
;
use
App\DataRequest
;
class
InventoriController
extends
Controller
{
public
function
ListBarang
()
...
...
@@ -84,8 +89,82 @@ class InventoriController extends Controller
//----------------------------List Request----------------------//
public
function
ListRequest
()
{
return
view
(
'adminlte::inventori.ListRequest.index'
);
$request_barangs
=
RequestBarang
::
all
();
return
view
(
'adminlte::inventori.ListRequest.index'
,
compact
(
'request_barangs'
));
}
public
function
editRequest
(
$id
)
{
$request_barangs
=
RequestBarang
::
where
(
'id'
,
$id
)
->
first
();
return
view
(
'adminlte::inventori.ListRequest.edit'
)
->
with
(
'request_barangs'
,
$request_barangs
);
}
//----------------------------Data Request----------------------//
public
function
DataRequest
()
{
$data_requests
=
DataRequest
::
all
();
return
view
(
'adminlte::inventori.DataRequest.index'
,
compact
(
'data_requests'
));
}
public
function
createDataRequest
()
{
return
view
(
'adminlte::inventori.DataRequest.createDataRequest'
);
}
public
function
storeDataRequest
(
Request
$request
)
{
$this
->
validate
(
$request
,
[
'nama_barang'
=>
'required'
,
'kategori'
=>
'required'
,
'harga'
=>
'required'
,
]);
$data_requests
=
new
DataRequest
();
$data_requests
->
nama_barang
=
$request
[
'nama_barang'
];
$data_requests
->
kategori
=
$request
[
'kategori'
];
$data_requests
->
harga
=
$request
[
'harga'
];
$data_requests
->
save
();
return
redirect
(
'DataRequest'
);
}
public
function
editDataRequest
(
$id
)
{
$data_requests
=
DataRequest
::
where
(
'id'
,
$id
)
->
first
();
return
view
(
'adminlte::inventori.DataRequest.editDataRequest'
)
->
with
(
'data_requests'
,
$data_requests
);
}
public
function
updateDataRequest
(
Request
$request
,
$id
)
{
$this
->
validate
(
$request
,
[
'nama_barang'
=>
'required'
,
'kategori'
=>
'required'
,
'harga'
=>
'required'
,
]);
$data_requests
=
DataRequest
::
findOrFail
(
$id
);
$data_requests
->
nama_barang
=
$request
->
nama_barang
;
$data_requests
->
kategori
=
$request
->
kategori
;
$data_requests
->
harga
=
$request
->
harga
;
$data_requests
->
save
();
return
redirect
(
'DataRequest'
);
}
public
function
destroyDataRequest
(
$id
)
{
$data_requests
=
DataRequest
::
find
(
$id
);
$data_requests
->
delete
();
return
redirect
(
'DataRequest'
);
}
}
\ No newline at end of file
resources/views/vendor/adminlte/inventori/DataRequest/createDataRequest.blade.php
0 → 100644
View file @
c5d1f3ff
@
extends
(
'adminlte::layouts.app'
)
@
section
(
'htmlheader_title'
)
Create
@
endsection
@
section
(
'contentheader_title'
)
Page
Create
List
Barang
@
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
(
'storeDataRequest'
)
}}
" method="
POST
">
{!! csrf_field() !!}
<div class="
form
-
group
{{
$errors
->
has
(
'nama_barang'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Nama Barang</label>
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
nama_barang
" value="
{{
old
(
'nama_barang'
)
}}
" >
@if (
$errors->has
('nama_barang'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('nama_barang') }}</strong>
</span>
@endif
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'kategori'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Kategori</label>
<div class="
col
-
md
-
6
">
<select name="
kategori
" class="
form
-
control
">
<option value="
makanan
">Makanan</option>
<option value="
minuman
">Minuman</option>
<option value="
alat
tulis
">Alat Tulis</option>
<option value="
alat
mandi
">Alat Mandi</option>
</select>
@if (
$errors->has
('kategori'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('kategori') }}</strong>
</span>
@endif
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'harga'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Harga</label>
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
harga
" value="
{{
old
(
'harga'
)
}}
" >
@if (
$errors->has
('harga'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('harga') }}</strong>
</span>
@endif
</div>
</div>
<div class="
form
-
group
">
<div class="
col
-
md
-
6
col
-
md
-
offset
-
4
">
<input type="
hidden
" name="
_token
" value="
{{
csrf_token
()
}}
">
<button type="
submit
" class="
btn
btn
-
primary
">
Tambah
</button>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
\ No newline at end of file
resources/views/vendor/adminlte/inventori/DataRequest/editDataRequest.blade.php
0 → 100644
View file @
c5d1f3ff
@
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
(
'updateDataRequest'
,
$data_requests
->
id
)
}}
" method="
POST
">
{!! csrf_field() !!}
<div class="
form
-
group
{{
$errors
->
has
(
'nama_barang'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Nama Barang</label>
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
nama_barang
" value="
{{
$data_requests
->
nama_barang
}}
" >
@if (
$errors->has
('nama_barang'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('nama_barang') }}</strong>
</span>
@endif
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'kategori'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
" value="
{{
$data_requests
->
kategori
}}
">Kategori</label>
<div class="
col
-
md
-
6
">
<select name="
kategori
" class="
form
-
control
">
<option value="
makanan
">Makanan</option>
<option value="
minuman
">Minuman</option>
<option value="
alat
tulis
">Alat Tulis</option>
<option value="
alat
mandi
">Alat Mandi</option>
</select>
@if (
$errors->has
('kategori'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('kategori') }}</strong>
</span>
@endif
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'harga'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">harga</label>
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
harga
" value="
{{
$data_requests
->
harga
}}
" >
@if (
$errors->has
('harga'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('harga') }}</strong>
</span>
@endif
</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/inventori/DataRequest/index.blade.php
0 → 100644
View file @
c5d1f3ff
@
extends
(
'adminlte::layouts.app'
)
@
section
(
'htmlheader_title'
)
{{
trans
(
'adminlte_lang::message.home'
)
}}
@
endsection
@
section
(
'contentheader_title'
)
<
center
>
Data
Request
</
center
>
@
endsection
@
section
(
'main-content'
)
<
table
class
="
table
table
-
striped
">
<thead>
<tr>
<th>Nama Barang</th>
<th>Kategori</th>
<th>Harga</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach(
$data_requests
as
$dataRequest
)
<tr>
<td>
{
{$dataRequest->nama_barang}
}
</td>
<td>
{
{$dataRequest->kategori}
}
</td>
<td>
{
{$dataRequest->harga}
}
</td>
<td>
<a href="
{{
url
(
'/editDataRequest'
,
$dataRequest
->
id
)
}}
" type="
submit
" button type="
button
" class="
btn
btn
-
warning
">Edit</a>
<a href="
{{
url
(
'/deleteDataRequest'
,
$dataRequest
->
id
)
}}
" class="
btn
btn
-
warning
">Delete</a>
</td>
</tr>
@endforeach
</tbody>
</table>
<a href="
{{
url
(
'/createDataRequest'
)
}}
" button type="
button
" class="
btn
btn
-
info
">Create</a></button>
@endsection
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