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
f2274a90
Commit
f2274a90
authored
May 21, 2017
by
jhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perbaikan List Barang
parent
eea96b68
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
52 additions
and
89 deletions
+52
-89
Barang.php
app/Barang.php
+1
-1
InventoriController.php
app/Http/Controllers/InventoriController.php
+8
-66
KasirController.php
app/Http/Controllers/KasirController.php
+15
-0
create.blade.php
...ews/vendor/adminlte/inventori/ListBarang/create.blade.php
+10
-10
edit.blade.php
...views/vendor/adminlte/inventori/ListBarang/edit.blade.php
+9
-9
index.blade.php
...iews/vendor/adminlte/inventori/ListBarang/index.blade.php
+2
-2
index.blade.php
.../views/vendor/adminlte/kasir/ListCustomer/index.blade.php
+6
-0
sidebar.blade.php
.../views/vendor/adminlte/layouts/partials/sidebar.blade.php
+0
-1
web.php
routes/web.php
+1
-0
No files found.
app/Barang.php
View file @
f2274a90
...
...
@@ -7,6 +7,6 @@ use Illuminate\Database\Eloquent\Model;
class
Barang
extends
Model
{
protected
$fillable
=
[
'nama'
,
'
jumlah
'
,
'harga'
,
'deskripsi'
,
'kategori'
,
'gambar'
,
'nama'
,
'
stock
'
,
'harga'
,
'deskripsi'
,
'kategori'
,
'gambar'
,
];
}
app/Http/Controllers/InventoriController.php
View file @
f2274a90
...
...
@@ -3,19 +3,11 @@
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
use
App\Http\Requests
;
use
App\Barang
;
use
App\RequestBarang
;
use
App\DataRequest
;
use
App\RequestBarang
;
use
App\DataRequest
;
class
InventoriController
extends
Controller
{
public
function
ListBarang
()
...
...
@@ -32,16 +24,16 @@ class InventoriController extends Controller
public
function
store
(
Request
$request
)
{
$this
->
validate
(
$request
,
[
'nama'
=>
'required'
,
'
jumlah
'
=>
'required'
,
'nama
_barang
'
=>
'required'
,
'
stock
'
=>
'required'
,
'harga'
=>
'required'
,
'kategori'
=>
'required'
,
'gambar'
=>
'required'
,
]);
$barangs
=
new
Barang
();
$barangs
->
nama
=
$request
[
'nama
'
];
$barangs
->
jumlah
=
$request
[
'jumlah
'
];
$barangs
->
nama
_barang
=
$request
[
'nama_barang
'
];
$barangs
->
stock
=
$request
[
'stock
'
];
$barangs
->
harga
=
$request
[
'harga'
];
$barangs
->
kategori
=
$request
[
'kategori'
];
$barangs
->
gambar
=
$request
[
'gambar'
];
...
...
@@ -60,16 +52,16 @@ class InventoriController extends Controller
public
function
update
(
Request
$request
,
$id
)
{
$this
->
validate
(
$request
,
[
'nama'
=>
'required'
,
'
jumlah
'
=>
'required'
,
'nama
_barang
'
=>
'required'
,
'
stock
'
=>
'required'
,
'harga'
=>
'required'
,
'kategori'
=>
'required'
,
'gambar'
=>
'required'
,
]);
$barangs
=
Barang
::
findOrFail
(
$id
);
$barangs
->
nama
=
$request
->
nama
;
$barangs
->
jumlah
=
$request
->
jumlah
;
$barangs
->
nama
_barang
=
$request
->
nama_barang
;
$barangs
->
stock
=
$request
->
stock
;
$barangs
->
harga
=
$request
->
harga
;
$barangs
->
kategori
=
$request
->
kategori
;
$barangs
->
gambar
=
$request
->
gambar
;
...
...
@@ -86,14 +78,6 @@ class InventoriController extends Controller
return
redirect
(
'ListBarang'
);
}
public
function
ListRequest
()
{
$request_barangs
=
RequestBarang
::
all
();
return
view
(
'adminlte::inventori.ListRequest.index'
,
compact
(
'request_barangs'
));
}
<<<<<<<
HEAD
//----------------------------List Request----------------------//
public
function
ListRequest
()
...
...
@@ -105,10 +89,6 @@ class InventoriController extends Controller
public
function
editRequest
(
$id
)
{
=======
public
function
editRequest
(
$id
)
{
>>>>>>>
226
a4f92be2de6ce884543bf9425346660a5031f
$request_barangs
=
RequestBarang
::
where
(
'id'
,
$id
)
->
first
();
return
view
(
'adminlte::inventori.ListRequest.edit'
)
->
with
(
'request_barangs'
,
$request_barangs
);
}
...
...
@@ -142,42 +122,6 @@ class InventoriController extends Controller
$data_requests
->
harga
=
$request
[
'harga'
];
$data_requests
->
save
();
return
redirect
(
'DataRequest'
);
<<<<<<<
HEAD
}
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'
);
=======
>>>>>>>
226
a4f92be2de6ce884543bf9425346660a5031f
}
...
...
@@ -212,6 +156,5 @@ class InventoriController extends Controller
$data_requests
->
delete
();
return
redirect
(
'DataRequest'
);
}
}
\ No newline at end of file
app/Http/Controllers/KasirController.php
View file @
f2274a90
...
...
@@ -3,6 +3,7 @@ namespace App\Http\Controllers;
use
Illuminate\Http\Request
;
use
App\Http\Requests
;
use
Illuminate\Support\Facades\Input
;
use
App\User
;
use
App\Transaksi
;
...
...
@@ -35,9 +36,22 @@ class KasirController extends Controller
return
redirect
(
'ListCustomer'
);
}
public
function
cariCustomer
(){
$key
=
Input
::
get
(
'search'
);
if
(
isset
(
$key
)){
$this
->
data
[
'users'
]
=
User
::
where
(
'email'
,
'like'
,
'%'
.
$key
.
'%'
)
->
orderBy
(
'id'
,
'desc'
)
->
paginate
(
10
);
}
else
{
$this
->
data
[
'users'
]
=
User
::
orderBy
(
'id'
,
'desc'
)
->
paginate
(
10
);
}
return
view
(
'adminlte::kasir.ListCustomer.index'
,
$this
->
data
);
}
public
function
KonfirmasiBarang
(
$id
){
DB
::
table
(
'request_barangs'
)
->
where
(
'id'
,
$id
)
->
update
([
'status_request'
=>
1
]);
return
redirect
()
->
back
();
}
}
\ No newline at end of file
resources/views/vendor/adminlte/inventori/ListBarang/create.blade.php
View file @
f2274a90
...
...
@@ -14,25 +14,25 @@
<div class="
panel
-
body
">
<form class="
form
-
horizontal
" action="
{{
url
(
'store'
)
}}
" method="
POST
">
{!! csrf_field() !!}
<div class="
form
-
group
{{
$errors
->
has
(
'nama'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Nama</label>
<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
" value="
{{
old
(
'nama
'
)
}}
" >
@if (
$errors->has
('nama'))
<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') }}</strong>
<strong>{{
$errors->first
('nama
_barang
') }}</strong>
</span>
@endif
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'
jumlah
'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">
Jumlah
</label>
<div class="
form
-
group
{{
$errors
->
has
(
'
stock
'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">
Stock
</label>
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
jumlah
" value="
{{
old
(
'jumlah
'
)
}}
" >
@if (
$errors->has
('
jumlah
'))
<input type="
text
" class="
form
-
control
" name="
stock
" value="
{{
old
(
'stock
'
)
}}
" >
@if (
$errors->has
('
stock
'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('
jumlah
') }}</strong>
<strong>{{
$errors->first
('
stock
') }}</strong>
</span>
@endif
</div>
...
...
resources/views/vendor/adminlte/inventori/ListBarang/edit.blade.php
View file @
f2274a90
...
...
@@ -14,13 +14,13 @@
<div class="
panel
-
body
">
<form class="
form
-
horizontal
" action="
{{
url
(
'update'
,
$barangs
->
id
)
}}
" method="
POST
">
{!! csrf_field() !!}
<div class="
form
-
group
{{
$errors
->
has
(
'nama'
)
?
' has-error'
:
''
}}
">
<div class="
form
-
group
{{
$errors
->
has
(
'nama
_barang
'
)
?
' 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="
nama
" value="
{{
$barangs
->
nama
}}
" >
@if (
$errors->has
('nama'))
<input type="
text
" class="
form
-
control
" name="
nama
_barang
" value="
{{
$barangs
->
nama_barang
}}
" >
@if (
$errors->has
('nama
_barang
'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('nama') }}</strong>
<strong>{{
$errors->first
('nama
_barang
') }}</strong>
</span>
@endif
</div>
...
...
@@ -28,12 +28,12 @@
<div class="
form
-
group
{{
$errors
->
has
(
'jumlah'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">
Jumlah
</label>
<label for="
title
" class="
col
-
md
-
4
control
-
label
">
Stock
</label>
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
jumlah
" value="
{{
$barangs
->
jumlah
}}
" >
@if (
$errors->has
('
jumlah
'))
<input type="
text
" class="
form
-
control
" name="
stock
" value="
{{
$barangs
->
stock
}}
" >
@if (
$errors->has
('
stock
'))
<span class="
help
-
block
">
<strong>{{
$errors->first
('
jumlah
') }}</strong>
<strong>{{
$errors->first
('
stock
') }}</strong>
</span>
@endif
</div>
...
...
@@ -70,7 +70,7 @@
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'
image
'
)
?
' has-error'
:
''
}}
">
<div class="
form
-
group
{{
$errors
->
has
(
'
gambar
'
)
?
' has-error'
:
''
}}
">
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Gambar</label>
<div class="
col
-
md
-
6
">
<input type="
file
" class="
inputimages
" name="
gambar
" value="
{{
$barangs
->
gambar
}}
" >
...
...
resources/views/vendor/adminlte/inventori/ListBarang/index.blade.php
View file @
f2274a90
...
...
@@ -24,8 +24,8 @@
<tbody>
@foreach(
$barangs
as
$barang
)
<tr>
<td>
{
{$barang->nama}
}
</td>
<td>
{
{$barang->
jumlah
}
}
</td>
<td>
{
{$barang->nama
_barang
}
}
</td>
<td>
{
{$barang->
stock
}
}
</td>
<td>
{
{$barang->harga}
}
</td>
<td>
{
{$barang->kategori}
}
</td>
<td><img src="
{{
asset
(
'image/'
.
$barang
->
gambar
)
}}
" style="
height
:
150
px
;
width
:
200
px
;
"> </td>
...
...
resources/views/vendor/adminlte/kasir/ListCustomer/index.blade.php
View file @
f2274a90
...
...
@@ -5,6 +5,12 @@
@
endsection
@
section
(
'contentheader_title'
)
<
form
action
=
"
{
{url('/cariCustomer')}
}
"
>
<
div
class
="
form
-
group
">
<label style="
margin
:
20
px
20
px
0
;
font
-
size
:
15
px
">Search by Email Username</label>
<input type="
text
" name="
search
" placeholder="
Email
Customer
" id="
search
" class="
form
-
control
" style="
font
-
size
:
15
px
;
color
:
white
;
background
-
color
:
rgba
(
0
,
0
,
0
,
0.4
)
"/>
</div>
</form>
<center>List Customer</center>
@endsection
...
...
resources/views/vendor/adminlte/layouts/partials/sidebar.blade.php
View file @
f2274a90
...
...
@@ -35,7 +35,6 @@
@if(Auth::user()->status=="admin")
<li><a
href=
"{{ url('listPetugas') }}"
><i
class=
'fa fa-link'
></i>
<span>
Daftar Pegawai
</span></a></li>
<!-- <li><a href="{{ url('laporanTransaksi') }}"><i class='fa fa-link'></i> <span>Laporan Transaksi</span></a></li> -->
@elseif(Auth::user()->status=="customer")
<li><a
href=
"{{ url('/BeliBarang') }}"
><i
class=
'fa fa-link'
></i>
<span>
Beli Barang
</span></a></li>
...
...
routes/web.php
View file @
f2274a90
...
...
@@ -94,6 +94,7 @@ Route::group(['middleware' => ['web','auth','inventori']], function () {
Route
::
group
([
'middleware'
=>
[
'web'
,
'auth'
,
'kasir'
]],
function
()
{
Route
::
get
(
'/ListCustomer'
,
'KasirController@ListCustomer'
);
Route
::
get
(
'/ListTransaksi'
,
'KasirController@ListTransaksi'
);
Route
::
get
(
'/cariCustomer'
,
'KasirController@cariCustomer'
);
Route
::
get
(
'/addSaldo/{id}'
,
'KasirController@addSaldo'
);
Route
::
put
(
'/saldo/{id}'
,
'KasirController@saldo'
);
});
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