Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pa2d4ti06
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
Juliper
pa2d4ti06
Commits
2cd41842
Commit
2cd41842
authored
Jun 15, 2017
by
Juliper
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.del.ac.id/juliper19/pa2d4ti06
parents
d7e0162a
196e320d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
136 additions
and
10 deletions
+136
-10
OwnerController.php
app/Http/Controllers/OwnerController.php
+27
-1
PDFController.php
app/Http/Controllers/PDFController.php
+25
-0
reportOwner.blade.php
resources/views/pdf/reportOwner.blade.php
+65
-0
Report.blade.php
...rces/views/vendor/adminlte/layouts/owner/Report.blade.php
+18
-9
web.php
routes/web.php
+1
-0
No files found.
app/Http/Controllers/OwnerController.php
View file @
2cd41842
...
...
@@ -45,7 +45,33 @@ class OwnerController extends Controller
return
view
(
'adminlte::layouts.owner.Report'
)
->
with
(
'data'
,
$dataPesanan
)
->
with
(
'penghasilan'
,
$penghasilan
)
->
with
(
'jumlahTamu'
,
$jumlah_tamu
);
dd
(
$dataHomestay
,
$request
[
'bulan'
],
$dataPesanan
,
$penghasilan
);
//dd($dataHomestay,$request['bulan'],$dataPesanan,$penghasilan);
}
public
function
printReportOwner
(
Request
$request
){
$dataHomestay
=
DB
::
table
(
'homestay'
)
->
join
(
'pemilikhomestay'
,
'homestay.id_pemilik'
,
'='
,
'pemilikhomestay.id'
)
->
where
(
'pemilikhomestay.id_akun'
,
'='
,
Auth
::
user
()
->
id
)
->
select
(
'homestay.id'
,
'homestay.nama_homestay'
)
->
get
();
//dd($dataHomestay[0]->nama_homestay);
$dataPesanan
=
DB
::
table
(
'daftar_book'
)
->
where
(
'daftar_book.homestay'
,
'='
,
$dataHomestay
[
0
]
->
id
)
->
whereMonth
(
'daftar_book.tanggal_mulai'
,
'='
,
$request
[
'bulan'
])
->
get
();
$penghasilan
=
0
;
$jumlah_tamu
=
0
;
foreach
(
$dataPesanan
as
$a
){
$penghasilan
+=
$a
->
total_harga
;
$jumlah_tamu
+=
$a
->
jumlah_tamu
;
}
//dd($jumlah_tamu);
$pdf
=
PDF
::
loadView
(
'pdf.reportOwner'
,[
'data'
=>
$dataPesanan
],[
'tamu'
=>
$jumlah_tamu
,
'penghasilan'
=>
$penghasilan
,
'bulan'
=>
$request
[
'bulan'
],
'namaHomestay'
=>
$dataHomestay
[
0
]
->
nama_homestay
]);
return
$pdf
->
stream
(
'reportOwner.pdf'
);
}
public
function
Record
(){
...
...
app/Http/Controllers/PDFController.php
View file @
2cd41842
...
...
@@ -50,4 +50,29 @@ class PDFController extends Controller
$pdf
=
PDF
::
loadView
(
'pdf.rincianHistory'
,[
'data'
=>
$rincianHistory
[
0
]]);
return
$pdf
->
stream
(
'rincianHistory'
);
}
public
function
printReportOwner
(
$id
){
$dataHomestay
=
DB
::
table
(
'homestay'
)
->
join
(
'pemilikhomestay'
,
'homestay.id_pemilik'
,
'='
,
'pemilikhomestay.id'
)
->
where
(
'pemilikhomestay.id_akun'
,
'='
,
Auth
::
user
()
->
id
)
->
select
(
'homestay.id'
)
->
get
();
$dataPesanan
=
DB
::
table
(
'daftar_book'
)
->
where
(
'daftar_book.homestay'
,
'='
,
$dataHomestay
[
0
]
->
id
)
->
whereMonth
(
'daftar_book.tanggal_mulai'
,
'='
,
$request
[
'bulan'
])
->
get
();
$penghasilan
=
0
;
$jumlah_tamu
=
0
;
foreach
(
$dataPesanan
as
$a
){
$penghasilan
+=
$a
->
total_harga
;
$jumlah_tamu
+=
$a
->
jumlah_tamu
;
}
$pdf
=
PDF
::
loadView
(
'pdf.reportOwner'
,[
'data'
=>
$dataPesanan
[
0
]],[
'penghasilan'
=>
$penghasilan
],[
'tamu'
=>
$jumlah_tamu
]);
return
$pdf
->
stream
(
'reportOwner.pdf'
);
}
}
resources/views/pdf/reportOwner.blade.php
0 → 100644
View file @
2cd41842
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<title></title>
</head>
<body>
<p
style=
"float:right;"
><b>
Tanggal :
</b>
<?php
echo
date
(
"Y/m/d"
)
;
?>
</p>
<br><br><br>
<center>
<h1>
Laporan di Bulan {{$bulan}}
</h1></center>
<center>
{{$namaHomestay}}
</center>
@foreach($data as $a)
<table
class=
"table table-user-information"
>
<tr>
<th>
Nama Pemesan
</th>
<td>
:
</td>
<td>
{{$a->nama_pemesan}}
</td>
</tr>
<tr>
<th>
Jumlah Kamar
</th>
<td>
:
</td>
<td>
{{$a->jumlah_kamar}} kamar
</td>
</tr>
<tr>
<th>
Jumlah Tamu
</th>
<td>
:
</td>
<td>
{{$a->jumlah_tamu}} orang
</td>
</tr>
<tr>
<th>
Lama Menginap
</th>
<td>
:
</td>
<td>
{{$a->lama_menginap}} Malam
</td>
</tr>
<tr>
<th>
Extra-bed
</th>
<td>
:
</td>
<td>
{{$a->extrabed}} buah
</td>
</tr>
<tr>
<th>
Tanggal Check-in
</th>
<td>
:
</td>
<td>
{{$a->tanggal_mulai}}
</td>
</tr>
<tr>
<th>
Tanggal Check-out
</th>
<td>
:
</td>
<td>
{{$a->tanggal_berakhir}}
</td>
</tr>
<tr>
<th>
Total Pembayaran
</th>
<td>
:
</td>
<td>
{{$a->total_harga}}
</td>
</tr>
<br><br>
</table>
@endforeach
<h3>
Total Tamu :
</h3>
{{$tamu}}
<h3>
Total Penghasilan :
</h3>
{{$penghasilan}}
</body>
</html>
resources/views/vendor/adminlte/layouts/owner/Report.blade.php
View file @
2cd41842
...
...
@@ -5,18 +5,28 @@
@
endsection
@
section
(
'main-content'
)
<
section
class
="
content
">
<!-- Small boxes (Stat box) -->
<div class="
row
">
<
div
class
="
box
box
-
primary
">
<div class="
box
-
header
with
-
border
">
<h3 class="
box
-
title
"> Laporan </h3>
</div>
<div class="
box
-
body
">
<form action="
{{
url
(
'report'
)}}
">
<label>Bulan</label>
<input type="
number
" min="
1
" max="
12
" name="
bulan
"
>
<input type="
number
" min="
1
" max="
12
" name="
bulan
" required
>
<input type="
submit
" value="
Cari
" class="
btn
-
btn
info
">
</form>
<form action="
{{
url
(
'printReportOwner'
)}}
" enctype="
multipart
/
form
-
data
">
<div class="
form
-
group
" align="
right
">
<label>Bulan</label>
<input type="
number
" min="
1
" max="
12
" name="
bulan
" required >
<input type="
submit
" class="
btn
btn
-
warning
" value="
Print
">
</div>
@if(
$data
==null)<H2>Data Tidak Ada</H2>
</form>
@if(
$data
==null)
<H2>Data Tidak Ada</H2>
@else
<table class="
table
">
<tr>
<td></td>
...
...
@@ -58,7 +68,6 @@
<!-- /.row (main row) -->
</section>
</div>
</div>
@endsection
routes/web.php
View file @
2cd41842
...
...
@@ -95,6 +95,7 @@ Route::group(['middleware' => 'owner'], function () {
Route
::
get
(
'detailpesanan/{id}'
,
'OwnerController@detailpesanan'
);
Route
::
get
(
'pesanan/{id}'
,
'OwnerController@pesanan'
);
Route
::
resource
(
'pdf'
,
'PDFController@showPDF'
);
Route
::
get
(
'printReportOwner'
,
'OwnerController@printReportOwner'
);
});
Route
::
post
(
'booking'
,
'GuestController@booking'
);
...
...
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