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
04ebd427
Commit
04ebd427
authored
May 15, 2017
by
ropelita esterlina sihombing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
melengkapi aktor manager sesuai usecase yang ada
parent
e6d48c6a
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
63 additions
and
46 deletions
+63
-46
workspace.xml
.idea/workspace.xml
+0
-0
Author.php
app/Author.php
+1
-1
Book.php
app/Book.php
+1
-1
BooksController.php
app/Http/Controllers/BooksController.php
+3
-2
GuestController.php
app/Http/Controllers/GuestController.php
+4
-3
pegawaiController.php
app/Http/Controllers/pegawaiController.php
+2
-0
StoreBookRequest.php
app/Http/Requests/StoreBookRequest.php
+1
-0
app.php
config/app.php
+1
-1
mail.php
config/mail.php
+2
-2
2016_12_12_120408_create_books_table.php
database/migrations/2016_12_12_120408_create_books_table.php
+1
-0
UsersSeeder.php
database/seeds/UsersSeeder.php
+5
-5
create_pegawai.blade.php
resources/views/authors/create_pegawai.blade.php
+3
-3
index.blade.php
resources/views/authors/index.blade.php
+2
-2
_form.blade.php
resources/views/books/_form.blade.php
+22
-12
export.blade.php
resources/views/books/export.blade.php
+1
-1
index.blade.php
resources/views/guest/index.blade.php
+1
-1
app.blade.php
resources/views/layouts/app.blade.php
+10
-9
books.blade.php
resources/views/pdf/books.blade.php
+2
-2
welcome.blade.php
resources/views/welcome.blade.php
+1
-1
No files found.
.idea/workspace.xml
View file @
04ebd427
This source diff could not be displayed because it is too large. You can
view the blob
instead.
app/Author.php
View file @
04ebd427
...
...
@@ -17,7 +17,7 @@ class Author extends Model
if
(
$author
->
books
->
count
()
>
0
)
{
$html
=
'Makanan tidak
bisa dipesan
masih memiliki pesanan : '
;
$html
=
'Makanan tidak
dapat dipesan,
masih memiliki pesanan : '
;
$html
.=
'<ul>'
;
foreach
(
$author
->
books
as
$book
)
{
$html
.=
"<li>
$book->title
</li>"
;
...
...
app/Book.php
View file @
04ebd427
...
...
@@ -7,7 +7,7 @@ use Illuminate\Support\Facades\Session;
class
Book
extends
Model
{
protected
$fillable
=
[
'title'
,
'author_id'
,
'amount'
];
protected
$fillable
=
[
'title'
,
'author_id'
,
'amount'
,
'harga'
];
public
static
function
boot
()
{
...
...
app/Http/Controllers/BooksController.php
View file @
04ebd427
...
...
@@ -25,7 +25,7 @@ class BooksController extends Controller
public
function
index
(
Request
$request
,
Builder
$htmlBuilder
)
{
if
(
$request
->
ajax
())
{
$books
=
Book
::
with
(
'author'
);
//Penggunaan method with() akan meload relasi dari Book ke Author dengan teknik eager loading
$books
=
Book
::
with
(
'author'
);
return
Datatables
::
of
(
$books
)
->
addColumn
(
'stock'
,
function
(
$book
){
return
$book
->
stock
;
...
...
@@ -43,7 +43,8 @@ return $book->stock;
$html
=
$htmlBuilder
->
addColumn
([
'data'
=>
'title'
,
'name'
=>
'title'
,
'title'
=>
'Jenis Makanan'
])
->
addColumn
([
'data'
=>
'stock'
,
'name'
=>
'amount'
,
'title'
=>
'Stok'
])
->
addColumn
([
'data'
=>
'stock'
,
'name'
=>
'amount'
,
'title'
=>
'Stock'
])
->
addColumn
([
'data'
=>
'harga'
,
'name'
=>
'harga'
,
'title'
=>
'Harga'
])
->
addColumn
([
'data'
=>
'author.name'
,
'name'
=>
'author.name'
,
'title'
=>
'Pemesan'
])
->
addColumn
([
'data'
=>
'action'
,
'name'
=>
'action'
,
'title'
=>
'Action'
,
'orderable'
=>
false
,
'searchable'
=>
false
]);
...
...
app/Http/Controllers/GuestController.php
View file @
04ebd427
...
...
@@ -21,14 +21,15 @@ return Datatables::of($books)
return
$book
->
stock
;
})
->
addColumn
(
'action'
,
function
(
$book
){
if
(
Laratrust
::
hasRole
(
'admin'
))
return
''
;
// jika admin tidak muncul tombol pinjam
if
(
Laratrust
::
hasRole
(
'admin'
))
return
''
;
return
'<a class="btn btn-xs btn-primary" href="'
.
route
(
'guest.books.borrow'
,
$book
->
id
)
.
'">Pesan</a>'
;
})
->
make
(
true
);
}
$html
=
$htmlBuilder
->
addColumn
([
'data'
=>
'title'
,
'name'
=>
'title'
,
'title'
=>
'Jenis Makanan'
])
->
addColumn
([
'data'
=>
'stock'
,
'name'
=>
'stock'
,
'title'
=>
'Jumlah Makanan'
,
'orderable'
=>
false
,
'searchable'
=>
false
])
->
addColumn
([
'data'
=>
'author.name'
,
'name'
=>
'author.name'
,
'title'
=>
'Nama Pemesan'
])
->
addColumn
([
'data'
=>
'stock'
,
'name'
=>
'stock'
,
'title'
=>
'Stock'
,
'orderable'
=>
false
,
'searchable'
=>
false
])
->
addColumn
([
'data'
=>
'harga'
,
'name'
=>
'harga'
,
'title'
=>
'Harga'
])
->
addColumn
([
'data'
=>
'author.name'
,
'name'
=>
'author.name'
,
'title'
=>
'Pemesan'
])
->
addColumn
([
'data'
=>
'action'
,
'name'
=>
'action'
,
'title'
=>
''
,
'orderable'
=>
false
,
'searchable'
=>
false
]);
return
view
(
'guest.index'
)
->
with
(
compact
(
'html'
));
}
...
...
app/Http/Controllers/pegawaiController.php
View file @
04ebd427
...
...
@@ -19,6 +19,8 @@ class pegawaiController extends Controller
return
view
(
'dashboard.admin'
,
[
'data'
=>
$data
]);
}
/**
* Show the form for creating a new resource.
*
...
...
app/Http/Requests/StoreBookRequest.php
View file @
04ebd427
...
...
@@ -28,6 +28,7 @@ class StoreBookRequest extends FormRequest
'title'
=>
'required|unique:books,title'
,
'author_id'
=>
'required|exists:authors,id'
,
'amount'
=>
'numeric'
,
'amount'
=>
'harga'
,
'cover'
=>
'image|max:2048'
];
}
...
...
config/app.php
View file @
04ebd427
...
...
@@ -12,7 +12,7 @@ return [
| any other location as required by the application or its packages.
*/
'name'
=>
'
FoodBooking
'
,
'name'
=>
'
PizzaAndaliman
'
,
/*
|--------------------------------------------------------------------------
...
...
config/mail.php
View file @
04ebd427
...
...
@@ -56,8 +56,8 @@ return [
*/
'from'
=>
[
'address'
=>
'
admin@ultraperpus
.com'
,
'name'
=>
'
Admin UltraPerpus
'
,
'address'
=>
'
foodbooking@gmail
.com'
,
'name'
=>
'
PizzaAndaliman
'
,
],
/*
...
...
database/migrations/2016_12_12_120408_create_books_table.php
View file @
04ebd427
...
...
@@ -18,6 +18,7 @@ $table->increments('id');
$table
->
string
(
'title'
);
$table
->
integer
(
'author_id'
)
->
unsigned
();
$table
->
integer
(
'amount'
)
->
unsigned
();
$table
->
integer
(
'harga'
)
->
unsigned
();
$table
->
string
(
'cover'
)
->
nullable
();
$table
->
timestamps
();
$table
->
foreign
(
'author_id'
)
->
references
(
'id'
)
->
on
(
'authors'
)
...
...
database/seeds/UsersSeeder.php
View file @
04ebd427
...
...
@@ -18,16 +18,16 @@ $memberRole->display_name = "Member";
$memberRole
->
save
();
// Membuat sample admin
$admin
=
new
User
();
$admin
->
name
=
'Admin
Ultraviolet
'
;
$admin
->
email
=
'
ultraviolet
@gmail.com'
;
$admin
->
password
=
bcrypt
(
'
verly123
'
);
$admin
->
name
=
'Admin
Pizza Andaliman
'
;
$admin
->
email
=
'
admin
@gmail.com'
;
$admin
->
password
=
bcrypt
(
'
admin
'
);
$admin
->
save
();
$admin
->
attachRole
(
$adminRole
);
// Membuat sample member
$member
=
new
User
();
$member
->
name
=
"Sample Member"
;
$member
->
email
=
'
member
@gmail.com'
;
$member
->
password
=
bcrypt
(
'
rahasia
'
);
$member
->
email
=
'
nicolas
@gmail.com'
;
$member
->
password
=
bcrypt
(
'
nikolas
'
);
$member
->
save
();
$member
->
attachRole
(
$memberRole
);
}
...
...
resources/views/authors/create_pegawai.blade.php
View file @
04ebd427
...
...
@@ -11,12 +11,12 @@
<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
">Tambah
Pelanggan
</li>
<li><a href="
{{
url
(
'/admin/authors'
)
}}
">
pegawai
</a></li>
<li class="
active
">Tambah
pegawai
</li>
</ul>
<div class="
panel
panel
-
default
">
<div class="
panel
-
heading
">
<h2 class="
panel
-
title
">Tambah
Pelanggan
</h2>
<h2 class="
panel
-
title
">Tambah
pegawai
</h2>
</div>
<div class="
panel
-
body
">
...
...
resources/views/authors/index.blade.php
View file @
04ebd427
...
...
@@ -11,11 +11,11 @@
<div class="
col
-
md
-
10
">
<ul class="
breadcrumb
">
<li><a href="
{{
url
(
'/home'
)
}}
">PizzaAndaliman</a></li>
<li class="
active
">P
elangg
an</li>
<li class="
active
">P
izzaAndalim
an</li>
</ul>
<div class="
panel
panel
-
default
">
<div class="
panel
-
heading
">
<h2 class="
panel
-
title
">P
elangg
an</h2>
<h2 class="
panel
-
title
">P
izzaAndalim
an</h2>
</div>
<div class="
panel
-
body
">
...
...
resources/views/books/_form.blade.php
View file @
04ebd427
...
...
@@ -6,27 +6,37 @@
</div>
</div>
<div
class=
"form-group {!! $errors->has('author_id') ? 'has-error' : '' !!}"
>
{!! Form::label('author_id', 'id_makanan', ['class'=>'col-md-2 control-label']) !!}
<div
class=
"col-md-4"
>
{!! Form::select('author_id', [''=>'']+App\Author::pluck('name','id')->all(), null, [
'class'=>'js-selectize',
'placeholder' => 'Pilih makanan']) !!}
{!! $errors->first('author_id', '
<p
class=
"help-block"
>
:message
</p>
') !!}
</div>
</div>
<div
class=
"form-group{{ $errors->has('amount') ? ' has-error' : '' }}"
>
{!! Form::label('amount', 's
isa makanan
', ['class'=>'col-md-2 control-label']) !!}
{!! Form::label('amount', 's
tock
', ['class'=>'col-md-2 control-label']) !!}
<div
class=
"col-md-4"
>
{!! Form::number('amount', null, ['class'=>'form-control', 'min'=>1]) !!}
{!! $errors->first('amount', '
<p
class=
"help-block"
>
:message
</p>
') !!}
@if (isset($book))
<p
class=
"help-block"
>
{{ $book->borrowed }}
M
akanan sedang dipesan
</p>
<p
class=
"help-block"
>
{{ $book->borrowed }}
m
akanan sedang dipesan
</p>
@endif
</div>
</div>
<div
class=
"form-group {!! $errors->has('harga') ? 'has-error' : '' !!}"
>
{!! Form::label('harga', 'Harga', ['class'=>'col-md-2 control-label']) !!}
<div
class=
"col-md-4"
>
{!! Form::select('harga', [''=>'']+App\Author::pluck('name','id')->all(), null, [
'class'=>'js-selectize',
'placeholder' => 'harga']) !!}
{!! $errors->first('harga', '
<p
class=
"help-block"
>
:message
</p>
') !!}
</div>
</div>
<div
class=
"form-group {!! $errors->has('author_id') ? 'has-error' : '' !!}"
>
{!! Form::label('author_id', 'pemesan', ['class'=>'col-md-2 control-label']) !!}
<div
class=
"col-md-4"
>
{!! Form::select('author_id', [''=>'']+App\Author::pluck('name','id')->all(), null, [
'class'=>'js-selectize',
'placeholder' => 'Pilih makanan']) !!}
{!! $errors->first('author_id', '
<p
class=
"help-block"
>
:message
</p>
') !!}
</div>
</div>
<div
class=
"form-group{{ $errors->has('cover') ? ' has-error' : '' }}"
>
{!! Form::label('cover', 'pembayaran', ['class'=>'col-md-2 control-label']) !!}
<div
class=
"col-md-4"
>
...
...
resources/views/books/export.blade.php
View file @
04ebd427
...
...
@@ -23,7 +23,7 @@
{!! Form::open(['url' => route('export.books.post'),
'method' => 'post', 'class'=>'form-horizontal']) !!}
<div class="
form
-
group
{
!!
$errors
->
has
(
'author_id'
)
?
'has-error'
:
''
!!
}
">
{!! Form::label('author_id', '
Penulis
', ['class'=>'col-md-2 control-label']) !!}
{!! Form::label('author_id', '
Stock
', ['class'=>'col-md-2 control-label']) !!}
<div class="
col
-
md
-
4
">
{!! Form::select('author_id[]', [''=>'']+App\Author::pluck('name','id')->all(), null, [
'class'=>'js-selectize',
...
...
resources/views/guest/index.blade.php
View file @
04ebd427
...
...
@@ -11,7 +11,7 @@
<div class="
col
-
md
-
10
">
<div class="
panel
panel
-
default
">
<div class="
panel
-
heading
">
<h2 class="
panel
-
title
">
Daftar
Makanan</h2>
<h2 class="
panel
-
title
">
List
Makanan</h2>
</div>
<div class="
panel
-
body
">
...
...
resources/views/layouts/app.blade.php
View file @
04ebd427
...
...
@@ -87,29 +87,30 @@
</li>
@endif
@role('admin')
<li
class=
"sub-menu"
>
<a
href=
"javascript:;"
>
<i
class=
"fa fa-
desktop
"
></i>
<span>
Data
Pelangg
an
</span>
<i
class=
"fa fa-
book
"
></i>
<span>
Data
Makan
an
</span>
</a>
<ul
class=
"sub"
>
<li><a
href=
"{{ route('authors.index') }}"
>
Pelangg
an
</a></li>
<li><a
href=
"{{ route('books.index') }}"
>
Makan
an
</a></li>
</ul>
</li>
<li
class=
"sub-menu"
>
<a
href=
"javascript:;"
>
<i
class=
"fa fa-
book
"
></i>
<span>
Data
Makan
an
</span>
<i
class=
"fa fa-
desktop
"
></i>
<span>
Data
Pelangg
an
</span>
</a>
<ul
class=
"sub"
>
<li><a
href=
"{{ route('books.index') }}"
>
Makan
an
</a></li>
<li><a
href=
"{{ route('authors.index') }}"
>
Pelangg
an
</a></li>
</ul>
</li>
<li
class=
"sub-menu"
>
<a
href=
"javascript:;"
>
<i
class=
"fa fa-desktop"
></i>
...
...
resources/views/pdf/books.blade.php
View file @
04ebd427
<!DOCTYPE html>
<html>
<head>
<title>
Data
Foodbooking
</title>
<title>
Data
PizzaAndaliman
</title>
<style>
/* --------------------------------------------------------------
...
...
@@ -70,7 +70,7 @@ img,tr {page-break-inside: avoid;}
</style>
</head>
<body>
<h1>
Data foodbooking
</h1>
<h1>
PizzaAndaliman
</h1>
<hr>
<table>
<thead>
...
...
resources/views/welcome.blade.php
View file @
04ebd427
...
...
@@ -6,7 +6,7 @@
<div class="
panel
panel
-
default
">
<div class="
panel
-
heading
">Halo</div>
<div class="
panel
-
body
">
Selamat datang
di Menu PizzaAndaliman
!
Selamat datang
, Sistem Informasi PizzaAndaliman siap melayani Anda
!
</div>
</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