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
c635121d
Commit
c635121d
authored
Jun 18, 2017
by
Juliper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
a7ea1fd8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
90 additions
and
63 deletions
+90
-63
AdminController.php
app/Http/Controllers/AdminController.php
+2
-3
GuestController.php
app/Http/Controllers/GuestController.php
+16
-4
OwnerController.php
app/Http/Controllers/OwnerController.php
+42
-9
reportOwner.blade.php
resources/views/pdf/reportOwner.blade.php
+2
-37
rincianHistory.blade.php
...endor/adminlte/layouts/customers/rincianHistory.blade.php
+3
-3
Report.blade.php
...rces/views/vendor/adminlte/layouts/owner/Report.blade.php
+23
-5
web.php
routes/web.php
+2
-2
No files found.
app/Http/Controllers/AdminController.php
View file @
c635121d
...
...
@@ -63,9 +63,6 @@ class AdminController extends Controller
return
view
(
'adminlte::layouts.admin.listhomestay'
)
->
with
(
'data'
,
$data
);
}
public
function
cariPesanan
(
Request
$request
){
$dataHomestay
=
Homestay
::
where
(
'nama_homestay'
,
$request
[
'nama_homestay'
])
->
get
();
...
...
@@ -493,6 +490,8 @@ class AdminController extends Controller
$req
->
status
=
2
;
$req
->
notif
=
1
;
$req
->
pesan
=
$request
->
pesan
;
$req
->
update
();
}
}
app/Http/Controllers/GuestController.php
View file @
c635121d
...
...
@@ -344,16 +344,16 @@ class GuestController extends Controller
//dd($dataHomestay,$dataCurrent,$currentKamar);
}
else
{
return
redirect
(
''
)
->
with
(
'message'
,
'Jumlah Kamar yang
Avilable
tidak mencukupi'
);
return
redirect
(
''
)
->
with
(
'message'
,
'Jumlah Kamar yang
sesuai
tidak mencukupi'
);
}
if
(
$dataHomestay
==
null
){
dd
(
'salah'
);
return
redirect
(
''
)
->
with
(
'message'
,
'Jumlah Kamar yang
Avilable
tidak mencukupi'
);
return
redirect
(
''
)
->
with
(
'message'
,
'Jumlah Kamar yang
sesuai
tidak mencukupi'
);
}
if
(
$dataHomestay
[
0
]
==
null
){
return
redirect
(
''
)
->
with
(
'message'
,
'Jumlah Kamar yang
Avilable
tidak mencukupi'
);
return
redirect
(
''
)
->
with
(
'message'
,
'Jumlah Kamar yang
sesuai
tidak mencukupi'
);
dd
(
'salah'
);
}
...
...
@@ -412,7 +412,19 @@ class GuestController extends Controller
$cus
->
save
();
return
redirect
(
'login'
);
$dataUser
=
DB
::
table
(
'users'
)
->
where
(
'users.username'
,
'='
,
$data
[
'username'
])
->
where
(
'users.email'
,
'='
,
$data
[
'email'
])
->
get
();
//dd($dataUser[0]);
if
(
Auth
::
attempt
([
'username'
=>
$dataUser
[
0
]
->
username
,
'password'
=>
$dataUser
[
0
]
->
password
]))
{
return
redirect
(
'/'
);
}
else
{
return
redirect
(
'login'
);
}
}
}
...
...
app/Http/Controllers/OwnerController.php
View file @
c635121d
...
...
@@ -27,16 +27,28 @@ class OwnerController extends Controller
public
function
Report
(
Request
$request
){
//dd('masuk');
return
redirect
()
->
action
(
'OwnerController@findReport'
,
[
'id'
=>
$request
[
'bulan'
]]);
//return redirect('report/{id}',$request['bulan']);
//dd($dataHomestay,$request['bulan'],$dataPesanan,$penghasilan);
}
public
function
printReport
(
Request
$request
){
//dd('masuk',$request['bulan']);
$dataHomestay
=
DB
::
table
(
'homestay'
)
->
join
(
'pemilikhomestay'
,
'homestay.id_pemilik'
,
'='
,
'pemilikhomestay.id'
)
->
where
(
'pemilikhomestay.id_akun'
,
'='
,
Auth
::
user
()
->
id
)
->
select
(
'homestay.id
'
)
->
get
();
->
join
(
'pemilikhomestay'
,
'homestay.id_pemilik'
,
'='
,
'pemilikhomestay.id'
)
->
where
(
'pemilikhomestay.id_akun'
,
'='
,
Auth
::
user
()
->
id
)
->
select
(
'homestay.id'
,
'homestay.nama_homestay
'
)
->
get
();
$dataPesanan
=
DB
::
table
(
'daftar_book'
)
->
where
(
'daftar_book.homestay'
,
'='
,
$dataHomestay
[
0
]
->
id
)
->
whereMonth
(
'daftar_book.tanggal_mulai'
,
'='
,
$request
[
'bulan'
])
->
get
();
->
where
(
'daftar_book.homestay'
,
'='
,
$dataHomestay
[
0
]
->
id
)
->
whereMonth
(
'daftar_book.tanggal_mulai'
,
'='
,
$request
[
'bulan'
])
->
get
();
$penghasilan
=
0
;
$jumlah_tamu
=
0
;
...
...
@@ -45,12 +57,33 @@ class OwnerController extends Controller
$jumlah_tamu
+=
$a
->
jumlah_tamu
;
}
return
view
(
'adminlte::layouts.owner.Report'
)
->
with
(
'data'
,
$dataPesanan
)
->
with
(
'penghasilan'
,
$penghasilan
)
->
with
(
'jumlahTamu'
,
$jumlah_tamu
);
//dd($dataHomestay,$request['bulan'],$dataPesanan,$penghasilan);
$pdf
=
PDF
::
loadView
(
'pdf.reportOwner'
,[
'data'
=>
$dataPesanan
],[
'tamu'
=>
$jumlah_tamu
,
'penghasilan'
=>
$penghasilan
,
'bulan'
=>
$request
[
'bulan'
],
'namaHomestay'
=>
$dataHomestay
[
0
]
->
nama_homestay
]);
$pdf
->
stream
(
'reportOwner.pdf'
);
}
public
function
findReport
(
$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'
,
'='
,
$id
)
->
get
();
$penghasilan
=
0
;
$jumlah_tamu
=
0
;
foreach
(
$dataPesanan
as
$a
){
$penghasilan
+=
$a
->
total_harga
;
$jumlah_tamu
+=
$a
->
jumlah_tamu
;
}
return
view
(
'adminlte::layouts.owner.Report'
)
->
with
(
'data'
,
$dataPesanan
)
->
with
(
'penghasilan'
,
$penghasilan
)
->
with
(
'jumlahTamu'
,
$jumlah_tamu
);
}
public
function
printReportOwner
(
Request
$request
){
...
...
resources/views/pdf/reportOwner.blade.php
View file @
c635121d
...
...
@@ -64,28 +64,9 @@
<table
class=
"table table-user-information"
>
<tr>
<th></th>
<th>
Nama Pemesan
</th>
<th>
Jumlah Kamar
</th>
<th>
Jumlah Tamu
</th>
<th>
Lama Menginap
</th>
<th>
Extra-bed
</th>
<th>
Tanggal Check-in
</th>
<th>
Tanggal Check-out
</th>
<th>
Total Pembayaran
</th>
</tr>
@foreach($data as $a)
<tr>
<td></td>
<td>
{{$a->nama_pemesan}}
</td>
<td>
{{$a->jumlah_kamar}} kamar
</td>
<td>
{{$a->jumlah_tamu}} orang
</td>
<td>
{{$a->lama_menginap}} Malam
</td>
<table
class=
"table-style-one"
>
<body>
<tr>
<th>
Nama Pemesan
</th>
<th>
Jumlah Kamar
</th>
<th>
Jumlah Tamu
</th>
...
...
@@ -107,31 +88,15 @@
<td>
Rp. {{$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>
</tr>
@endforeach
<tr>
<td
colspan=
"2"
>
Total
</td>
<td>
{{$tamu}} Orang
</td>
<td
colspan=
"4"
></td>
<td>
Rp. {{$penghasilan}}
</td>
</tr>
</body>
</table>
</table>
</body>
</html>
resources/views/vendor/adminlte/layouts/customers/rincianHistory.blade.php
View file @
c635121d
...
...
@@ -7,14 +7,14 @@
<
h3
>
Rincian
Pemesanan
Homestay
</
h3
>
<
table
class
="
table
-
condensed
" style="
font
-
size
:
16
px
;
margin
-
left
:
-
3
px
;
color
:
#777; margin-top:5px;">
<
tr
>
<
td
>
Nama
Pemilik
Homestay
</
td
>
<
td
>
Nama
</
td
>
<
td
>:</
td
>
<
td
>
{{
$data
->
nama
}}
Malam
</
td
>
</
tr
>
<
tr
>
<
td
>
Nama
Homestay
</
td
>
<
td
>:</
td
>
<
td
>
{{
$data
->
nama_homestay
}}
Malam
</
td
>
<
td
>
{{
$data
->
nama_homestay
}}
</
td
>
</
tr
>
<
tr
>
<
td
>
Tanggal
Check
-
in
</
td
>
...
...
@@ -34,7 +34,7 @@
<
tr
>
<
td
>
Total
Pembayaran
</
td
>
<
td
>:</
td
>
<
td
>
{{
$data
->
total_pembayaran
}}
</
td
>
<
td
>
Rp
{{
number_format
(
$data
->
total_pembayaran
)
}}
</
td
>
</
tr
>
<
tr
>
<
td
>
<
a
href
=
"
{
{url('rincianHistoryPrint/'.$data->id)}
}
"
class
="
btn
btn
-
warning
"><i class="
glyphicon
glyphicon
-
print
"></i> print </a></td>
...
...
resources/views/vendor/adminlte/layouts/owner/Report.blade.php
View file @
c635121d
...
...
@@ -16,9 +16,12 @@
<input type="
number
" min="
1
" onchange="
updateVal
(
this
)
" max="
12
" name="
bulan
" required >
<input type="
submit
" value="
Cari
" class="
btn
-
btn
info
">
</form>
{{--<a class="
btn
btn
-
warning
" onclick="
cancelRequest
()
"> <i class="
fa
fa
-
print
"></i> Print </a>--}}
<form action="
{{
url
(
'printReportOwner'
)}}
" enctype="
multipart
/
form
-
data
" style="
float
:
right
;
">
<div class="
form
-
group
" align="
right
">
<input type="
number
" hidden
id="
print
" min="
1
" max="
12
" name="
bulan
" display="
none
" required >
<input type="
number
" hidden
value="
{{
Request
::
segment
(
2
)}}
" min="
1
" max="
12
" name="
bulan
" display="
none
" required >
<input type="
submit
" class="
btn
btn
-
warning
" value="
Print
">
</div>
</form>
...
...
@@ -70,12 +73,27 @@
</div>
</div>
<script>
function updateVal(object) {
{
{--<script>--}
}
{{--function updateVal(object)
{
--}
}
{{--var field = document.getElementById('print');--}}
{{--field.value = parseInt(object.value);--}}
var field = document.getElementById('print');
field.value = parseInt(object.value);
{
{--}--}
}
{
{--</script>--}
}
<script>
function cancelRequest() {
$.ajax({
data: {
bulan: '{{ Request::segment(2) }}',
_token: '{{ csrf_token() }}',
},
url: '{{ url('printreport') }}',
type: 'POST',
});
}
</script>
@endsection
routes/web.php
View file @
c635121d
...
...
@@ -64,9 +64,11 @@ Route::get('DataPemesanan', function(){
});
Route
::
group
([
'middleware'
=>
'owner'
],
function
()
{
Route
::
post
(
'printreport'
,
'OwnerController@printReport'
);
Route
::
put
(
'asread/{id}'
,
'OwnerController@Asread'
);
Route
::
get
(
'record'
,
'OwnerController@Record'
);
Route
::
get
(
'report'
,
'OwnerController@Report'
);
Route
::
get
(
'report/{id}'
,
'OwnerController@findReport'
);
Route
::
put
(
'check/{id}'
,
'OwnerController@Check'
);
Route
::
put
(
'editRoom/{id}'
,
'OwnerController@updateRoom'
);
Route
::
post
(
'addManual'
,
'OwnerController@addBookManual'
);
...
...
@@ -147,6 +149,4 @@ Route::group(['middleware' => 'dinaspariwisata'], function () {
Route
::
get
(
'printFasilitas/{id}'
,
'AdminController@printFasilitas'
);
Route
::
post
(
'/cancelrequest'
,
'AdminController@cancelrequest'
);
Route
::
get
(
'admin/create'
,
'AdminController@create'
);
});
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