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
7 years ago
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;
...
@@ -7,6 +7,6 @@ use Illuminate\Database\Eloquent\Model;
class
Barang
extends
Model
class
Barang
extends
Model
{
{
protected
$fillable
=
[
protected
$fillable
=
[
'nama'
,
'
jumlah
'
,
'harga'
,
'deskripsi'
,
'kategori'
,
'gambar'
,
'nama'
,
'
stock
'
,
'harga'
,
'deskripsi'
,
'kategori'
,
'gambar'
,
];
];
}
}
This diff is collapsed.
Click to expand it.
app/Http/Controllers/InventoriController.php
View file @
f2274a90
...
@@ -3,19 +3,11 @@
...
@@ -3,19 +3,11 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
App\Http\Requests
;
use
App\Http\Requests
;
use
App\Barang
;
use
App\Barang
;
use
App\RequestBarang
;
use
App\RequestBarang
;
use
App\DataRequest
;
use
App\DataRequest
;
use
App\RequestBarang
;
use
App\DataRequest
;
class
InventoriController
extends
Controller
class
InventoriController
extends
Controller
{
{
public
function
ListBarang
()
public
function
ListBarang
()
...
@@ -32,16 +24,16 @@ class InventoriController extends Controller
...
@@ -32,16 +24,16 @@ class InventoriController extends Controller
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
$this
->
validate
(
$request
,
[
$this
->
validate
(
$request
,
[
'nama'
=>
'required'
,
'nama
_barang
'
=>
'required'
,
'
jumlah
'
=>
'required'
,
'
stock
'
=>
'required'
,
'harga'
=>
'required'
,
'harga'
=>
'required'
,
'kategori'
=>
'required'
,
'kategori'
=>
'required'
,
'gambar'
=>
'required'
,
'gambar'
=>
'required'
,
]);
]);
$barangs
=
new
Barang
();
$barangs
=
new
Barang
();
$barangs
->
nama
=
$request
[
'nama
'
];
$barangs
->
nama
_barang
=
$request
[
'nama_barang
'
];
$barangs
->
jumlah
=
$request
[
'jumlah
'
];
$barangs
->
stock
=
$request
[
'stock
'
];
$barangs
->
harga
=
$request
[
'harga'
];
$barangs
->
harga
=
$request
[
'harga'
];
$barangs
->
kategori
=
$request
[
'kategori'
];
$barangs
->
kategori
=
$request
[
'kategori'
];
$barangs
->
gambar
=
$request
[
'gambar'
];
$barangs
->
gambar
=
$request
[
'gambar'
];
...
@@ -60,16 +52,16 @@ class InventoriController extends Controller
...
@@ -60,16 +52,16 @@ class InventoriController extends Controller
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
$this
->
validate
(
$request
,
[
$this
->
validate
(
$request
,
[
'nama'
=>
'required'
,
'nama
_barang
'
=>
'required'
,
'
jumlah
'
=>
'required'
,
'
stock
'
=>
'required'
,
'harga'
=>
'required'
,
'harga'
=>
'required'
,
'kategori'
=>
'required'
,
'kategori'
=>
'required'
,
'gambar'
=>
'required'
,
'gambar'
=>
'required'
,
]);
]);
$barangs
=
Barang
::
findOrFail
(
$id
);
$barangs
=
Barang
::
findOrFail
(
$id
);
$barangs
->
nama
=
$request
->
nama
;
$barangs
->
nama
_barang
=
$request
->
nama_barang
;
$barangs
->
jumlah
=
$request
->
jumlah
;
$barangs
->
stock
=
$request
->
stock
;
$barangs
->
harga
=
$request
->
harga
;
$barangs
->
harga
=
$request
->
harga
;
$barangs
->
kategori
=
$request
->
kategori
;
$barangs
->
kategori
=
$request
->
kategori
;
$barangs
->
gambar
=
$request
->
gambar
;
$barangs
->
gambar
=
$request
->
gambar
;
...
@@ -86,14 +78,6 @@ class InventoriController extends Controller
...
@@ -86,14 +78,6 @@ class InventoriController extends Controller
return
redirect
(
'ListBarang'
);
return
redirect
(
'ListBarang'
);
}
}
public
function
ListRequest
()
{
$request_barangs
=
RequestBarang
::
all
();
return
view
(
'adminlte::inventori.ListRequest.index'
,
compact
(
'request_barangs'
));
}
<<<<<<<
HEAD
//----------------------------List Request----------------------//
//----------------------------List Request----------------------//
public
function
ListRequest
()
public
function
ListRequest
()
...
@@ -105,10 +89,6 @@ class InventoriController extends Controller
...
@@ -105,10 +89,6 @@ class InventoriController extends Controller
public
function
editRequest
(
$id
)
public
function
editRequest
(
$id
)
{
{
=======
public
function
editRequest
(
$id
)
{
>>>>>>>
226
a4f92be2de6ce884543bf9425346660a5031f
$request_barangs
=
RequestBarang
::
where
(
'id'
,
$id
)
->
first
();
$request_barangs
=
RequestBarang
::
where
(
'id'
,
$id
)
->
first
();
return
view
(
'adminlte::inventori.ListRequest.edit'
)
->
with
(
'request_barangs'
,
$request_barangs
);
return
view
(
'adminlte::inventori.ListRequest.edit'
)
->
with
(
'request_barangs'
,
$request_barangs
);
}
}
...
@@ -142,42 +122,6 @@ class InventoriController extends Controller
...
@@ -142,42 +122,6 @@ class InventoriController extends Controller
$data_requests
->
harga
=
$request
[
'harga'
];
$data_requests
->
harga
=
$request
[
'harga'
];
$data_requests
->
save
();
$data_requests
->
save
();
return
redirect
(
'DataRequest'
);
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
...
@@ -212,6 +156,5 @@ class InventoriController extends Controller
$data_requests
->
delete
();
$data_requests
->
delete
();
return
redirect
(
'DataRequest'
);
return
redirect
(
'DataRequest'
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/Http/Controllers/KasirController.php
View file @
f2274a90
...
@@ -3,6 +3,7 @@ namespace App\Http\Controllers;
...
@@ -3,6 +3,7 @@ namespace App\Http\Controllers;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
App\Http\Requests
;
use
App\Http\Requests
;
use
Illuminate\Support\Facades\Input
;
use
App\User
;
use
App\User
;
use
App\Transaksi
;
use
App\Transaksi
;
...
@@ -35,9 +36,22 @@ class KasirController extends Controller
...
@@ -35,9 +36,22 @@ class KasirController extends Controller
return
redirect
(
'ListCustomer'
);
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
){
public
function
KonfirmasiBarang
(
$id
){
DB
::
table
(
'request_barangs'
)
->
where
(
'id'
,
$id
)
->
update
([
'status_request'
=>
1
]);
DB
::
table
(
'request_barangs'
)
->
where
(
'id'
,
$id
)
->
update
([
'status_request'
=>
1
]);
return
redirect
()
->
back
();
return
redirect
()
->
back
();
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
resources/views/vendor/adminlte/inventori/ListBarang/create.blade.php
View file @
f2274a90
...
@@ -14,25 +14,25 @@
...
@@ -14,25 +14,25 @@
<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
">
{!! csrf_field() !!}
{!! 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>
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Nama
Barang
</label>
<div class="
col
-
md
-
6
">
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
nama
" value="
{{
old
(
'nama
'
)
}}
" >
<input type="
text
" class="
form
-
control
" name="
nama
_barang
" value="
{{
old
(
'nama_barang
'
)
}}
" >
@if (
$errors->has
('nama'))
@if (
$errors->has
('nama
_barang
'))
<span class="
help
-
block
">
<span class="
help
-
block
">
<strong>{{
$errors->first
('nama') }}</strong>
<strong>{{
$errors->first
('nama
_barang
') }}</strong>
</span>
</span>
@endif
@endif
</div>
</div>
</div>
</div>
<div class="
form
-
group
{{
$errors
->
has
(
'
jumlah
'
)
?
' has-error'
:
''
}}
">
<div class="
form
-
group
{{
$errors
->
has
(
'
stock
'
)
?
' 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
">
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
jumlah
" value="
{{
old
(
'jumlah
'
)
}}
" >
<input type="
text
" class="
form
-
control
" name="
stock
" value="
{{
old
(
'stock
'
)
}}
" >
@if (
$errors->has
('
jumlah
'))
@if (
$errors->has
('
stock
'))
<span class="
help
-
block
">
<span class="
help
-
block
">
<strong>{{
$errors->first
('
jumlah
') }}</strong>
<strong>{{
$errors->first
('
stock
') }}</strong>
</span>
</span>
@endif
@endif
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
resources/views/vendor/adminlte/inventori/ListBarang/edit.blade.php
View file @
f2274a90
...
@@ -14,13 +14,13 @@
...
@@ -14,13 +14,13 @@
<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
">
{!! csrf_field() !!}
{!! 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>
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Nama</label>
<div class="
col
-
md
-
6
">
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
nama
" value="
{{
$barangs
->
nama
}}
" >
<input type="
text
" class="
form
-
control
" name="
nama
_barang
" value="
{{
$barangs
->
nama_barang
}}
" >
@if (
$errors->has
('nama'))
@if (
$errors->has
('nama
_barang
'))
<span class="
help
-
block
">
<span class="
help
-
block
">
<strong>{{
$errors->first
('nama') }}</strong>
<strong>{{
$errors->first
('nama
_barang
') }}</strong>
</span>
</span>
@endif
@endif
</div>
</div>
...
@@ -28,12 +28,12 @@
...
@@ -28,12 +28,12 @@
<div class="
form
-
group
{{
$errors
->
has
(
'jumlah'
)
?
' has-error'
:
''
}}
">
<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
">
<div class="
col
-
md
-
6
">
<input type="
text
" class="
form
-
control
" name="
jumlah
" value="
{{
$barangs
->
jumlah
}}
" >
<input type="
text
" class="
form
-
control
" name="
stock
" value="
{{
$barangs
->
stock
}}
" >
@if (
$errors->has
('
jumlah
'))
@if (
$errors->has
('
stock
'))
<span class="
help
-
block
">
<span class="
help
-
block
">
<strong>{{
$errors->first
('
jumlah
') }}</strong>
<strong>{{
$errors->first
('
stock
') }}</strong>
</span>
</span>
@endif
@endif
</div>
</div>
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
</div>
</div>
</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>
<label for="
title
" class="
col
-
md
-
4
control
-
label
">Gambar</label>
<div class="
col
-
md
-
6
">
<div class="
col
-
md
-
6
">
<input type="
file
" class="
inputimages
" name="
gambar
" value="
{{
$barangs
->
gambar
}}
" >
<input type="
file
" class="
inputimages
" name="
gambar
" value="
{{
$barangs
->
gambar
}}
" >
...
...
This diff is collapsed.
Click to expand it.
resources/views/vendor/adminlte/inventori/ListBarang/index.blade.php
View file @
f2274a90
...
@@ -24,8 +24,8 @@
...
@@ -24,8 +24,8 @@
<tbody>
<tbody>
@foreach(
$barangs
as
$barang
)
@foreach(
$barangs
as
$barang
)
<tr>
<tr>
<td>
{
{$barang->nama}
}
</td>
<td>
{
{$barang->nama
_barang
}
}
</td>
<td>
{
{$barang->
jumlah
}
}
</td>
<td>
{
{$barang->
stock
}
}
</td>
<td>
{
{$barang->harga}
}
</td>
<td>
{
{$barang->harga}
}
</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><img src="
{{
asset
(
'image/'
.
$barang
->
gambar
)
}}
" style="
height
:
150
px
;
width
:
200
px
;
"> </td>
...
...
This diff is collapsed.
Click to expand it.
resources/views/vendor/adminlte/kasir/ListCustomer/index.blade.php
View file @
f2274a90
...
@@ -5,6 +5,12 @@
...
@@ -5,6 +5,12 @@
@
endsection
@
endsection
@
section
(
'contentheader_title'
)
@
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>
<center>List Customer</center>
@endsection
@endsection
...
...
This diff is collapsed.
Click to expand it.
resources/views/vendor/adminlte/layouts/partials/sidebar.blade.php
View file @
f2274a90
...
@@ -35,7 +35,6 @@
...
@@ -35,7 +35,6 @@
@if(Auth::user()->status=="admin")
@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('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")
@elseif(Auth::user()->status=="customer")
<li><a
href=
"{{ url('/BeliBarang') }}"
><i
class=
'fa fa-link'
></i>
<span>
Beli Barang
</span></a></li>
<li><a
href=
"{{ url('/BeliBarang') }}"
><i
class=
'fa fa-link'
></i>
<span>
Beli Barang
</span></a></li>
...
...
This diff is collapsed.
Click to expand it.
routes/web.php
View file @
f2274a90
...
@@ -94,6 +94,7 @@ Route::group(['middleware' => ['web','auth','inventori']], function () {
...
@@ -94,6 +94,7 @@ Route::group(['middleware' => ['web','auth','inventori']], function () {
Route
::
group
([
'middleware'
=>
[
'web'
,
'auth'
,
'kasir'
]],
function
()
{
Route
::
group
([
'middleware'
=>
[
'web'
,
'auth'
,
'kasir'
]],
function
()
{
Route
::
get
(
'/ListCustomer'
,
'KasirController@ListCustomer'
);
Route
::
get
(
'/ListCustomer'
,
'KasirController@ListCustomer'
);
Route
::
get
(
'/ListTransaksi'
,
'KasirController@ListTransaksi'
);
Route
::
get
(
'/ListTransaksi'
,
'KasirController@ListTransaksi'
);
Route
::
get
(
'/cariCustomer'
,
'KasirController@cariCustomer'
);
Route
::
get
(
'/addSaldo/{id}'
,
'KasirController@addSaldo'
);
Route
::
get
(
'/addSaldo/{id}'
,
'KasirController@addSaldo'
);
Route
::
put
(
'/saldo/{id}'
,
'KasirController@saldo'
);
Route
::
put
(
'/saldo/{id}'
,
'KasirController@saldo'
);
});
});
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