Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PA2-1617-D3TK05
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
ropelita esterlina sihombing
PA2-1617-D3TK05
Commits
e5c957f0
Commit
e5c957f0
authored
Jun 06, 2017
by
ropelita esterlina sihombing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
melengkapi usecase untuk setiap aktor
parent
86710ee0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
169 additions
and
34 deletions
+169
-34
workspace.xml
.idea/workspace.xml
+0
-0
BooksController.php
app/Http/Controllers/BooksController.php
+1
-1
GuestController.php
app/Http/Controllers/GuestController.php
+1
-1
PesananController.php
app/Http/Controllers/PesananController.php
+3
-4
pegawaiController.php
app/Http/Controllers/pegawaiController.php
+32
-21
e77e2e90781ff7b4b0f08f6ba8425af9.JPG
public/img/e77e2e90781ff7b4b0f08f6ba8425af9.JPG
+0
-0
_form_pegawai.blade.php
resources/views/authors/_form_pegawai.blade.php
+36
-0
create.blade.php
resources/views/authors/create.blade.php
+1
-1
create_data_pegawai.blade.php
resources/views/authors/create_data_pegawai.blade.php
+42
-0
_form.blade.php
resources/views/books/_form.blade.php
+3
-3
export.blade.php
resources/views/books/export.blade.php
+1
-1
app.blade.php
resources/views/layouts/app.blade.php
+49
-2
No files found.
.idea/workspace.xml
View file @
e5c957f0
This diff is collapsed.
Click to expand it.
app/Http/Controllers/BooksController.php
View file @
e5c957f0
...
@@ -45,7 +45,7 @@ return $book->stock;
...
@@ -45,7 +45,7 @@ return $book->stock;
->
addColumn
([
'data'
=>
'title'
,
'name'
=>
'title'
,
'title'
=>
'Jenis Makanan'
])
->
addColumn
([
'data'
=>
'title'
,
'name'
=>
'title'
,
'title'
=>
'Jenis Makanan'
])
->
addColumn
([
'data'
=>
'stock'
,
'name'
=>
'amount'
,
'title'
=>
'Stock'
])
->
addColumn
([
'data'
=>
'stock'
,
'name'
=>
'amount'
,
'title'
=>
'Stock'
])
->
addColumn
([
'data'
=>
'harga'
,
'name'
=>
'harga'
,
'title'
=>
'harga'
])
->
addColumn
([
'data'
=>
'harga'
,
'name'
=>
'harga'
,
'title'
=>
'harga'
])
->
addColumn
([
'data'
=>
'author.name'
,
'name'
=>
'author.name'
,
'title'
=>
'
Pemesan
'
])
->
addColumn
([
'data'
=>
'author.name'
,
'name'
=>
'author.name'
,
'title'
=>
'
chef
'
])
->
addColumn
([
'data'
=>
'action'
,
'name'
=>
'action'
,
'title'
=>
'Action'
,
'orderable'
=>
false
,
'searchable'
=>
false
]);
->
addColumn
([
'data'
=>
'action'
,
'name'
=>
'action'
,
'title'
=>
'Action'
,
'orderable'
=>
false
,
'searchable'
=>
false
]);
...
...
app/Http/Controllers/GuestController.php
View file @
e5c957f0
...
@@ -29,7 +29,7 @@ $html = $htmlBuilder
...
@@ -29,7 +29,7 @@ $html = $htmlBuilder
->
addColumn
([
'data'
=>
'title'
,
'name'
=>
'title'
,
'title'
=>
'Jenis Makanan'
])
->
addColumn
([
'data'
=>
'title'
,
'name'
=>
'title'
,
'title'
=>
'Jenis Makanan'
])
->
addColumn
([
'data'
=>
'stock'
,
'name'
=>
'stock'
,
'title'
=>
'Stock'
,
'orderable'
=>
false
,
'searchable'
=>
false
])
->
addColumn
([
'data'
=>
'stock'
,
'name'
=>
'stock'
,
'title'
=>
'Stock'
,
'orderable'
=>
false
,
'searchable'
=>
false
])
->
addColumn
([
'data'
=>
'harga'
,
'name'
=>
'harga'
,
'title'
=>
'harga'
])
->
addColumn
([
'data'
=>
'harga'
,
'name'
=>
'harga'
,
'title'
=>
'harga'
])
->
addColumn
([
'data'
=>
'author.name'
,
'name'
=>
'author.name'
,
'title'
=>
'
Pemesan
'
])
->
addColumn
([
'data'
=>
'author.name'
,
'name'
=>
'author.name'
,
'title'
=>
'
chef
'
])
->
addColumn
([
'data'
=>
'action'
,
'name'
=>
'action'
,
'title'
=>
''
,
'orderable'
=>
false
,
'searchable'
=>
false
]);
->
addColumn
([
'data'
=>
'action'
,
'name'
=>
'action'
,
'title'
=>
''
,
'orderable'
=>
false
,
'searchable'
=>
false
]);
return
view
(
'guest.index'
)
->
with
(
compact
(
'html'
));
return
view
(
'guest.index'
)
->
with
(
compact
(
'html'
));
}
}
...
...
app/Http/Controllers/PesananController.php
View file @
e5c957f0
...
@@ -38,7 +38,7 @@ class PesananController extends Controller
...
@@ -38,7 +38,7 @@ class PesananController extends Controller
->
addColumn
([
'data'
=>
'title'
,
'name'
=>
'title'
,
'title'
=>
'Jenis Makanan'
])
->
addColumn
([
'data'
=>
'title'
,
'name'
=>
'title'
,
'title'
=>
'Jenis Makanan'
])
->
addColumn
([
'data'
=>
'stock'
,
'name'
=>
'amount'
,
'title'
=>
'Stock'
])
->
addColumn
([
'data'
=>
'stock'
,
'name'
=>
'amount'
,
'title'
=>
'Stock'
])
->
addColumn
([
'data'
=>
'harga'
,
'name'
=>
'harga'
,
'title'
=>
'harga'
])
->
addColumn
([
'data'
=>
'harga'
,
'name'
=>
'harga'
,
'title'
=>
'harga'
])
->
addColumn
([
'data'
=>
'author.name'
,
'name'
=>
'author.name'
,
'title'
=>
'
Pemesan
'
])
->
addColumn
([
'data'
=>
'author.name'
,
'name'
=>
'author.name'
,
'title'
=>
'
chef
'
])
->
addColumn
([
'data'
=>
'action'
,
'name'
=>
'action'
,
'title'
=>
'Action'
,
'orderable'
=>
false
,
'searchable'
=>
false
]);
->
addColumn
([
'data'
=>
'action'
,
'name'
=>
'action'
,
'title'
=>
'Action'
,
'orderable'
=>
false
,
'searchable'
=>
false
]);
...
@@ -132,9 +132,8 @@ class PesananController extends Controller
...
@@ -132,9 +132,8 @@ class PesananController extends Controller
*/
*/
public
function
edit
(
$id
)
public
function
edit
(
$id
)
{
{
$book
=
Book
::
find
(
$id
);
$author
=
Author
::
find
(
$id
);
return
view
(
'books.edit'
)
->
with
(
compact
(
'book'
));
return
view
(
'authors.edit'
)
->
with
(
compact
(
'author'
));
}
}
/**
/**
...
...
app/Http/Controllers/pegawaiController.php
View file @
e5c957f0
...
@@ -8,6 +8,9 @@ use App\Http\Requests\StorePegawaiRequest;
...
@@ -8,6 +8,9 @@ use App\Http\Requests\StorePegawaiRequest;
use
App\Http\Requests\UpdatePegawaiRequest
;
use
App\Http\Requests\UpdatePegawaiRequest
;
use
Yajra\Datatables\Html\Builder
;
use
Yajra\Datatables\Html\Builder
;
use
Yajra\Datatables\Datatables
;
use
Yajra\Datatables\Datatables
;
use
App\Book
;
use
App\Author
;
use
App\session
;
class
pegawaiController
extends
Controller
class
pegawaiController
extends
Controller
{
{
...
@@ -56,7 +59,7 @@ class pegawaiController extends Controller
...
@@ -56,7 +59,7 @@ class pegawaiController extends Controller
*/
*/
public
function
create
()
public
function
create
()
{
{
return
view
(
'authors.
create
'
);
return
view
(
'authors.
_form_pegawai
'
);
}
}
/**
/**
...
@@ -70,24 +73,24 @@ class pegawaiController extends Controller
...
@@ -70,24 +73,24 @@ class pegawaiController extends Controller
$pegawai
=
pegawai
::
create
(
$request
->
except
(
'cover'
));
$pegawai
=
pegawai
::
create
(
$request
->
except
(
'cover'
));
// isi field cover jika ada cover yang diupload
// isi field cover jika ada cover yang diupload
if
(
$request
->
hasFile
(
'cover'
))
{
//
if ($request->hasFile('cover')) {
// Mengambil file yang diupload
//
//
Mengambil file yang diupload
$uploaded_cover
=
$request
->
file
(
'cover'
);
//
$uploaded_cover = $request->file('cover');
// mengambil extension file
//
//
mengambil extension file
$extension
=
$uploaded_cover
->
getClientOriginalExtension
();
//
$extension = $uploaded_cover->getClientOriginalExtension();
// membuat nama file random berikut extension
//
//
membuat nama file random berikut extension
$filename
=
md5
(
time
())
.
'.'
.
$extension
;
//
$filename = md5(time()) . '.' . $extension;
// menyimpan cover ke folder public/img
//
//
menyimpan cover ke folder public/img
$destinationPath
=
public_path
()
.
DIRECTORY_SEPARATOR
.
'img'
;
//
$destinationPath = public_path() . DIRECTORY_SEPARATOR . 'img';
$uploaded_cover
->
move
(
$destinationPath
,
$filename
);
//
$uploaded_cover->move($destinationPath, $filename);
// mengisi field cover di pegawai dengan filename yang baru dibuat
//
//
mengisi field cover di pegawai dengan filename yang baru dibuat
$pegawai
->
cover
=
$filename
;
//
$pegawai->cover = $filename;
$pegawai
->
save
();
//
$pegawai->save();
}
//
}
Session
::
flash
(
"flash_notification"
,
[
//
Session::flash("flash_notification", [
"level"
=>
"success"
,
//
"level"=>"success",
"message"
=>
"Berhasil menyimpan
$pegawai->name
"
//
"message"=>"Berhasil menyimpan $pegawai->name"
]);
//
]);
return
redirect
()
->
route
(
'pegawai.index'
);
return
redirect
()
->
route
(
'pegawai.index'
);
}
}
/**
/**
...
@@ -109,7 +112,8 @@ class pegawaiController extends Controller
...
@@ -109,7 +112,8 @@ class pegawaiController extends Controller
*/
*/
public
function
edit
(
$id
)
public
function
edit
(
$id
)
{
{
//
$author
=
Author
::
find
(
$id
);
return
view
(
'authors.create'
)
->
with
(
compact
(
'author'
));
}
}
/**
/**
...
@@ -132,6 +136,13 @@ class pegawaiController extends Controller
...
@@ -132,6 +136,13 @@ class pegawaiController extends Controller
*/
*/
public
function
destroy
(
$id
)
public
function
destroy
(
$id
)
{
{
//
if
(
!
Author
::
destroy
(
$id
))
return
redirect
()
->
back
();
Session
::
flash
(
"flash_notification"
,
[
"level"
=>
"success"
,
"message"
=>
"Berhasil dihapus"
]);
return
redirect
()
->
route
(
'authors.index'
);
}
}
}
}
public/img/e77e2e90781ff7b4b0f08f6ba8425af9.JPG
0 → 100644
View file @
e5c957f0
This diff is collapsed.
Click to expand it.
resources/views/authors/_form_pegawai.blade.php
0 → 100644
View file @
e5c957f0
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
section
id
=
"main-content"
>
<
section
class
="
wrapper
">
<div class="
container
">
<div class="
row
">
<br>
<div class="
col
-
md
-
10
">
<ul class="
breadcrumb
">
<li><a href="
{{
url
(
'/home'
)
}}
">Dashboard</a></li>
<li><a href="
{{
url
(
'/admin/authors'
)
}}
">Pelanggan</a></li>
<li class="
active
">Ubah Pelanggan</li>
</ul>
<div class="
panel
panel
-
default
">
<div class="
panel
-
heading
">
<h2 class="
panel
-
title
">Ubah Pelanggan</h2>
</div>
<div class="
panel
-
body
">
{!! Form::model(
$author
, ['url' => route('authors.update',
$author->id
),
'method'=>'put', 'class'=>'form-horizontal']) !!}
@include('authors.create_data_pegawai')
{!! Form::close() !!}
</div>
</div>
</div>
</div>
</div>
</section>
</section>
@endsection
resources/views/authors/create.blade.php
View file @
e5c957f0
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<div class="
panel
-
body
">
<div class="
panel
-
body
">
{!! Form::open(['url' => route('pegawai.store'),
{!! Form::open(['url' => route('pegawai.store'),
'method' => 'post', 'enctype'=>'multipart/form-data','files'=>'true', 'class'=>'form-horizontal']) !!}
'method' => 'post', 'enctype'=>'multipart/form-data','files'=>'true', 'class'=>'form-horizontal']) !!}
@include('
books._form
')
@include('
authors.create_data_pegawai
')
{!! Form::close() !!}
{!! Form::close() !!}
</div>
</div>
</div>
</div>
...
...
resources/views/authors/create_data_pegawai.blade.php
0 → 100644
View file @
e5c957f0
<div
class=
"form-group{{ $errors->has('name') ? ' has-error' : '' }}"
>
{!! Form::label('name', 'Nama', ['class'=>'col-md-2 control-label']) !!}
<div
class=
"col-md-4"
>
{!! Form::text('name', null, ['class'=>'form-control']) !!}
{!! $errors->first('name', '
<p
class=
"help-block"
>
:message
</p>
') !!}
</div>
</div>
<div
class=
"form-group{{ $errors->has('alamat') ? ' has-error' : '' }}"
>
{!! Form::label('alamat', 'Alamat', ['class'=>'col-md-2 control-label']) !!}
<div
class=
"col-md-4"
>
{!! Form::text('alamat', null, ['class'=>'form-control']) !!}
{!! $errors->first('alamat', '
<p
class=
"help-block"
>
:message
</p>
') !!}
</div>
</div>
<div
class=
"form-group{{ $errors->has('umur') ? ' has-error' : '' }}"
>
{!! Form::label('umur', 'Umur', ['class'=>'col-md-2 control-label']) !!}
<div
class=
"col-md-4"
>
{!! Form::number('umur', null, ['class'=>'form-control', 'min'=>1]) !!}
{!! $errors->first('umur', '
<p
class=
"help-block"
>
:message
</p>
') !!}
</div>
</div>
<div
class=
"form-group{{ $errors->has('golongan') ? ' has-error' : '' }}"
>
{!! Form::label('golongan', 'Golongan', ['class'=>'col-md-2 control-label']) !!}
<div
class=
"col-md-4"
>
{!! Form::text('golongan', null, ['class'=>'form-control']) !!}
{!! $errors->first('golongan', '
<p
class=
"help-block"
>
:message
</p>
') !!}
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"col-md-4 col-md-offset-2"
>
{!! Form::submit('Simpan', ['class'=>'btn btn-primary']) !!}
</div>
</div>
resources/views/books/_form.blade.php
View file @
e5c957f0
...
@@ -29,17 +29,17 @@
...
@@ -29,17 +29,17 @@
</div>
</div>
<div
class=
"form-group {!! $errors->has('author_id') ? 'has-error' : '' !!}"
>
<div
class=
"form-group {!! $errors->has('author_id') ? 'has-error' : '' !!}"
>
{!! Form::label('author_id', '
pemesan
', ['class'=>'col-md-2 control-label']) !!}
{!! Form::label('author_id', '
chef
', ['class'=>'col-md-2 control-label']) !!}
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
{!! Form::select('author_id', [''=>'']+App\Author::pluck('name','id')->all(), null, [
{!! Form::select('author_id', [''=>'']+App\Author::pluck('name','id')->all(), null, [
'class'=>'js-selectize',
'class'=>'js-selectize',
'placeholder' => '
Pilih makanan
']) !!}
'placeholder' => '']) !!}
{!! $errors->first('author_id', '
<p
class=
"help-block"
>
:message
</p>
') !!}
{!! $errors->first('author_id', '
<p
class=
"help-block"
>
:message
</p>
') !!}
</div>
</div>
</div>
</div>
<div
class=
"form-group{{ $errors->has('cover') ? ' has-error' : '' }}"
>
<div
class=
"form-group{{ $errors->has('cover') ? ' has-error' : '' }}"
>
{!! Form::label('cover', '
pembayaran
', ['class'=>'col-md-2 control-label']) !!}
{!! Form::label('cover', '
gambar
', ['class'=>'col-md-2 control-label']) !!}
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
{!! Form::file('cover') !!}
{!! Form::file('cover') !!}
@if (isset($book)
&&
$book->cover)
@if (isset($book)
&&
$book->cover)
...
...
resources/views/books/export.blade.php
View file @
e5c957f0
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
{!! Form::select('author_id[]', [''=>'']+App\Author::pluck('name','id')->all(), null, [
{!! Form::select('author_id[]', [''=>'']+App\Author::pluck('name','id')->all(), null, [
'class'=>'js-selectize',
'class'=>'js-selectize',
'multiple',
'multiple',
'placeholder' => 'Pilih Pe
nulis
']) !!}
'placeholder' => 'Pilih Pe
mesan
']) !!}
{!!
$errors->first
('author_id', '<p class="
help
-
block
">:message</p>') !!}
{!!
$errors->first
('author_id', '<p class="
help
-
block
">:message</p>') !!}
</div>
</div>
</div>
</div>
...
...
resources/views/layouts/app.blade.php
View file @
e5c957f0
...
@@ -88,7 +88,6 @@
...
@@ -88,7 +88,6 @@
@endif
@endif
@role('manager')
@role('manager')
<li
class=
"sub-menu"
>
<li
class=
"sub-menu"
>
<a
href=
"javascript:;"
>
<a
href=
"javascript:;"
>
<i
class=
"fa fa-book"
></i>
<i
class=
"fa fa-book"
></i>
...
@@ -133,7 +132,43 @@
...
@@ -133,7 +132,43 @@
<span>
Data pesanan
</span>
<span>
Data pesanan
</span>
</a>
</a>
<ul
class=
"sub"
>
<ul
class=
"sub"
>
<li><a
href=
"{{ route('authors.index') }}"
>
Pesanan
</a></li>
<li><a
href=
"{{ route('books.index') }}"
>
Pesanan
</a></li>
<li><a
href=
"{{ route('pegawai.index') }}"
>
Pembayaran
</a></li>
<li><a
href=
"{{ route('books.index') }}"
>
laporan
</a></li>
</ul>
</li>
{{--
<li
class=
"sub-menu"
>
--}}
{{--
<a
href=
"javascript:;"
>
--}}
{{--
<i
class=
"fa fa-desktop"
></i>
--}}
{{--
<span>
pembayaran
</span>
--}}
{{--
</a>
--}}
{{--
<ul
class=
"sub"
>
--}}
{{--
<li><a
href=
"{{ route('authors.index') }}"
>
Pembayaran
</a></li>
--}}
{{--
</ul>
--}}
{{--
</li>
--}}
{{--
<li
class=
"sub-menu"
>
--}}
{{--
<a
href=
"javascript:;"
>
--}}
{{--
<i
class=
"fa fa-book"
></i>
--}}
{{--
<span>
Laporan
</span>
--}}
{{--
</a>
--}}
{{--
<ul
class=
"sub"
>
--}}
{{--
<li><a
href=
"{{ route('books.index') }}"
>
laporan
</a></li>
--}}
{{--
</ul>
--}}
{{--
</li>
--}}
@endrole
@role('deliver')
<li
class=
"sub-menu"
>
<a
href=
"javascript:;"
>
<i
class=
"fa fa-book"
></i>
<span>
Data Pesanan
</span>
</a>
<ul
class=
"sub"
>
<li><a
href=
"{{ route('books.index') }}"
>
pesanan
</a></li>
</ul>
</ul>
</li>
</li>
...
@@ -141,6 +176,18 @@
...
@@ -141,6 +176,18 @@
@endrole
@endrole
@role('chef')
<li
class=
"sub-menu"
>
<a
href=
"javascript:;"
>
<i
class=
"fa fa-book"
></i>
<span>
Data Pesanan
</span>
</a>
<ul
class=
"sub"
>
<li><a
href=
"{{ route('books.index') }}"
>
Makanan
</a></li>
</ul>
</li>
@endrole
</ul>
</ul>
<!-- sidebar menu end-->
<!-- sidebar menu end-->
</div>
</div>
...
...
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