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
8cd8ed9e
Commit
8cd8ed9e
authored
Jun 15, 2017
by
Palti Sinaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
report
parent
fd8ebaf0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
165 additions
and
52 deletions
+165
-52
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
+52
-0
Report.blade.php
...rces/views/vendor/adminlte/layouts/owner/Report.blade.php
+60
-51
web.php
routes/web.php
+1
-0
No files found.
app/Http/Controllers/OwnerController.php
View file @
8cd8ed9e
...
...
@@ -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'
)
->
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
;
}
//dd($jumlah_tamu);
$pdf
=
PDF
::
loadView
(
'pdf.reportOwner'
,[
'data'
=>
$dataPesanan
],[
'tamu'
=>
$jumlah_tamu
,
'penghasilan'
=>
$penghasilan
]);
return
$pdf
->
stream
(
'reportOwner.pdf'
);
}
public
function
Record
(){
...
...
app/Http/Controllers/PDFController.php
View file @
8cd8ed9e
...
...
@@ -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 @
8cd8ed9e
<!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>
<table
class=
"table"
>
<tr>
<td></td>
<td>
Nama Pemesan
</td>
<td>
Jumlah Kamar
</td>
<td>
Jumlah Tamu
</td>
<td>
Lama Menginap
</td>
<td>
Extrabed
</td>
<td>
Tanggal Mulai
</td>
<td>
Tanggal Berakhir
</td>
<td>
Total Harga
</td>
</tr>
@foreach($data as $a)
<tr>
<td></td>
<td>
{{$a->nama_pemesan}}
</td>
<td>
{{$a->jumlah_kamar}}
</td>
<td>
{{$a->jumlah_tamu}}
</td>
<td>
{{$a->lama_menginap}}
</td>
<td>
{{$a->extrabed}}
</td>
<td>
{{$a->tanggal_mulai}}
</td>
<td>
{{$a->tanggal_berakhir}}
</td>
<td>
{{$a->total_harga}}
</td>
</tr>
@endforeach
<tr>
<td>
Total
</td>
<td></td>
<td></td>
<td>
{{$tamu}}
</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
{{$penghasilan}}
</td>
</tr>
</table>
</body>
</html>
resources/views/vendor/adminlte/layouts/owner/Report.blade.php
View file @
8cd8ed9e
...
...
@@ -5,60 +5,69 @@
@
endsection
@
section
(
'main-content'
)
<
section
class
="
content
">
<!-- Small boxes (Stat box) -->
<div class="
row
">
<form action="
{{
url
(
'report'
)}}
">
<label>Bulan</label>
<input type="
number
" min="
1
" max="
12
" name="
bulan
" >
<input type="
submit
" value="
Cari
" class="
btn
-
btn
info
">
</form>
</div>
<
div
class
="
box
box
-
primary
">
<div class="
box
-
header
with
-
border
">
<h3 class="
box
-
title
"> Laporan </h3>
</div>
@if(
$data
==null)<H2>Data Tidak Ada</H2>
@else
<table class="
table
">
<tr>
<td></td>
<td>Nama Pemesan</td>
<td>Jumlah Kamar</td>
<td>Jumlah Tamu</td>
<td>Lama Menginap</td>
<td>Extrabed</td>
<td>Tanggal Mulai</td>
<td>Tanggal Berakhir</td>
<td>Total Harga</td>
</tr>
@foreach(
$data
as
$a
)
<tr>
<td></td>
<td>
{
{$a->nama_pemesan}
}
</td>
<td>
{
{$a->jumlah_kamar}
}
</td>
<td>
{
{$a->jumlah_tamu}
}
</td>
<td>
{
{$a->lama_menginap}
}
</td>
<td>
{
{$a->extrabed}
}
</td>
<td>
{
{$a->tanggal_mulai}
}
</td>
<td>
{
{$a->tanggal_berakhir}
}
</td>
<td>
{
{$a->total_harga}
}
</td>
</tr>
@endforeach
<tr>
<td>Total</td>
<td></td>
<td></td>
<td>
{
{$jumlahTamu}
}
</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
{
{$penghasilan}
}
</td>
</tr>
</table>
@endif
<div class="
box
-
body
">
<form action="
{{
url
(
'report'
)}}
">
<label>Bulan</label>
<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>
</form>
@if(
$data
==null)
<H2>Data Tidak Ada</H2>
@else
<table class="
table
">
<tr>
<td></td>
<td>Nama Pemesan</td>
<td>Jumlah Kamar</td>
<td>Jumlah Tamu</td>
<td>Lama Menginap</td>
<td>Extrabed</td>
<td>Tanggal Mulai</td>
<td>Tanggal Berakhir</td>
<td>Total Harga</td>
</tr>
@foreach(
$data
as
$a
)
<tr>
<td></td>
<td>
{
{$a->nama_pemesan}
}
</td>
<td>
{
{$a->jumlah_kamar}
}
</td>
<td>
{
{$a->jumlah_tamu}
}
</td>
<td>
{
{$a->lama_menginap}
}
</td>
<td>
{
{$a->extrabed}
}
</td>
<td>
{
{$a->tanggal_mulai}
}
</td>
<td>
{
{$a->tanggal_berakhir}
}
</td>
<td>
{
{$a->total_harga}
}
</td>
</tr>
@endforeach
<tr>
<td>Total</td>
<td></td>
<td></td>
<td>
{
{$jumlahTamu}
}
</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
{
{$penghasilan}
}
</td>
</tr>
</table>
@endif
<!-- /.row (main row) -->
</section>
</div>
</div>
@endsection
routes/web.php
View file @
8cd8ed9e
...
...
@@ -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