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
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
83 additions
and
56 deletions
+83
-56
AdminController.php
app/Http/Controllers/AdminController.php
+2
-3
GuestController.php
app/Http/Controllers/GuestController.php
+15
-3
OwnerController.php
app/Http/Controllers/OwnerController.php
+36
-3
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
...
@@ -63,9 +63,6 @@ class AdminController extends Controller
return
view
(
'adminlte::layouts.admin.listhomestay'
)
->
with
(
'data'
,
$data
);
return
view
(
'adminlte::layouts.admin.listhomestay'
)
->
with
(
'data'
,
$data
);
}
}
public
function
cariPesanan
(
Request
$request
){
public
function
cariPesanan
(
Request
$request
){
$dataHomestay
=
Homestay
::
where
(
'nama_homestay'
,
$request
[
'nama_homestay'
])
->
get
();
$dataHomestay
=
Homestay
::
where
(
'nama_homestay'
,
$request
[
'nama_homestay'
])
->
get
();
...
@@ -493,6 +490,8 @@ class AdminController extends Controller
...
@@ -493,6 +490,8 @@ class AdminController extends Controller
$req
->
status
=
2
;
$req
->
status
=
2
;
$req
->
notif
=
1
;
$req
->
notif
=
1
;
$req
->
pesan
=
$request
->
pesan
;
$req
->
pesan
=
$request
->
pesan
;
$req
->
update
();
$req
->
update
();
}
}
}
}
app/Http/Controllers/GuestController.php
View file @
c635121d
...
@@ -344,16 +344,16 @@ class GuestController extends Controller
...
@@ -344,16 +344,16 @@ class GuestController extends Controller
//dd($dataHomestay,$dataCurrent,$currentKamar);
//dd($dataHomestay,$dataCurrent,$currentKamar);
}
else
{
}
else
{
return
redirect
(
''
)
->
with
(
'message'
,
'Jumlah Kamar yang
Avilable
tidak mencukupi'
);
return
redirect
(
''
)
->
with
(
'message'
,
'Jumlah Kamar yang
sesuai
tidak mencukupi'
);
}
}
if
(
$dataHomestay
==
null
){
if
(
$dataHomestay
==
null
){
dd
(
'salah'
);
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
){
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'
);
dd
(
'salah'
);
}
}
...
@@ -412,8 +412,20 @@ class GuestController extends Controller
...
@@ -412,8 +412,20 @@ class GuestController extends Controller
$cus
->
save
();
$cus
->
save
();
$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'
);
return
redirect
(
'login'
);
}
}
}
}
}
public
function
register
(){
public
function
register
(){
...
...
app/Http/Controllers/OwnerController.php
View file @
c635121d
...
@@ -27,10 +27,22 @@ class OwnerController extends Controller
...
@@ -27,10 +27,22 @@ class OwnerController extends Controller
public
function
Report
(
Request
$request
){
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'
)
$dataHomestay
=
DB
::
table
(
'homestay'
)
->
join
(
'pemilikhomestay'
,
'homestay.id_pemilik'
,
'='
,
'pemilikhomestay.id'
)
->
join
(
'pemilikhomestay'
,
'homestay.id_pemilik'
,
'='
,
'pemilikhomestay.id'
)
->
where
(
'pemilikhomestay.id_akun'
,
'='
,
Auth
::
user
()
->
id
)
->
where
(
'pemilikhomestay.id_akun'
,
'='
,
Auth
::
user
()
->
id
)
->
select
(
'homestay.id
'
)
->
select
(
'homestay.id'
,
'homestay.nama_homestay
'
)
->
get
();
->
get
();
$dataPesanan
=
DB
::
table
(
'daftar_book'
)
$dataPesanan
=
DB
::
table
(
'daftar_book'
)
...
@@ -45,12 +57,33 @@ class OwnerController extends Controller
...
@@ -45,12 +57,33 @@ class OwnerController extends Controller
$jumlah_tamu
+=
$a
->
jumlah_tamu
;
$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
){
public
function
printReportOwner
(
Request
$request
){
...
...
resources/views/pdf/reportOwner.blade.php
View file @
c635121d
...
@@ -64,28 +64,9 @@
...
@@ -64,28 +64,9 @@
<table
class=
"table table-user-information"
>
<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"
>
<table
class=
"table-style-one"
>
<body>
<body>
<tr>
<tr>
<th>
Nama Pemesan
</th>
<th>
Nama Pemesan
</th>
<th>
Jumlah Kamar
</th>
<th>
Jumlah Kamar
</th>
<th>
Jumlah Tamu
</th>
<th>
Jumlah Tamu
</th>
...
@@ -107,31 +88,15 @@
...
@@ -107,31 +88,15 @@
<td>
Rp. {{$a->total_harga}}
</td>
<td>
Rp. {{$a->total_harga}}
</td>
</tr>
</tr>
@endforeach
@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>
<tr>
<td
colspan=
"2"
>
Total
</td>
<td
colspan=
"2"
>
Total
</td>
<td>
{{$tamu}} Orang
</td>
<td>
{{$tamu}} Orang
</td>
<td
colspan=
"4"
></td>
<td
colspan=
"4"
></td>
<td>
Rp. {{$penghasilan}}
</td>
<td>
Rp. {{$penghasilan}}
</td>
</tr>
</tr>
</body>
</table>
</table>
</table>
</body>
</body>
</html>
</html>
resources/views/vendor/adminlte/layouts/customers/rincianHistory.blade.php
View file @
c635121d
...
@@ -7,14 +7,14 @@
...
@@ -7,14 +7,14 @@
<
h3
>
Rincian
Pemesanan
Homestay
</
h3
>
<
h3
>
Rincian
Pemesanan
Homestay
</
h3
>
<
table
class
="
table
-
condensed
" style="
font
-
size
:
16
px
;
margin
-
left
:
-
3
px
;
color
:
#777; margin-top:5px;">
<
table
class
="
table
-
condensed
" style="
font
-
size
:
16
px
;
margin
-
left
:
-
3
px
;
color
:
#777; margin-top:5px;">
<
tr
>
<
tr
>
<
td
>
Nama
Pemilik
Homestay
</
td
>
<
td
>
Nama
</
td
>
<
td
>:</
td
>
<
td
>:</
td
>
<
td
>
{{
$data
->
nama
}}
Malam
</
td
>
<
td
>
{{
$data
->
nama
}}
Malam
</
td
>
</
tr
>
</
tr
>
<
tr
>
<
tr
>
<
td
>
Nama
Homestay
</
td
>
<
td
>
Nama
Homestay
</
td
>
<
td
>:</
td
>
<
td
>:</
td
>
<
td
>
{{
$data
->
nama_homestay
}}
Malam
</
td
>
<
td
>
{{
$data
->
nama_homestay
}}
</
td
>
</
tr
>
</
tr
>
<
tr
>
<
tr
>
<
td
>
Tanggal
Check
-
in
</
td
>
<
td
>
Tanggal
Check
-
in
</
td
>
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
<
tr
>
<
tr
>
<
td
>
Total
Pembayaran
</
td
>
<
td
>
Total
Pembayaran
</
td
>
<
td
>:</
td
>
<
td
>:</
td
>
<
td
>
{{
$data
->
total_pembayaran
}}
</
td
>
<
td
>
Rp
{{
number_format
(
$data
->
total_pembayaran
)
}}
</
td
>
</
tr
>
</
tr
>
<
tr
>
<
tr
>
<
td
>
<
a
href
=
"
{
{url('rincianHistoryPrint/'.$data->id)}
}
"
class
="
btn
btn
-
warning
"><i class="
glyphicon
glyphicon
-
print
"></i> print </a></td>
<
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 @@
...
@@ -16,9 +16,12 @@
<input type="
number
" min="
1
" onchange="
updateVal
(
this
)
" max="
12
" name="
bulan
" required >
<input type="
number
" min="
1
" onchange="
updateVal
(
this
)
" max="
12
" name="
bulan
" required >
<input type="
submit
" value="
Cari
" class="
btn
-
btn
info
">
<input type="
submit
" value="
Cari
" class="
btn
-
btn
info
">
</form>
</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
;
">
<form action="
{{
url
(
'printReportOwner'
)}}
" enctype="
multipart
/
form
-
data
" style="
float
:
right
;
">
<div class="
form
-
group
" align="
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
">
<input type="
submit
" class="
btn
btn
-
warning
" value="
Print
">
</div>
</div>
</form>
</form>
...
@@ -70,12 +73,27 @@
...
@@ -70,12 +73,27 @@
</div>
</div>
</div>
</div>
<script>
{
{--<script>--}
}
function updateVal(object) {
{{--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>
</script>
@endsection
@endsection
routes/web.php
View file @
c635121d
...
@@ -64,9 +64,11 @@ Route::get('DataPemesanan', function(){
...
@@ -64,9 +64,11 @@ Route::get('DataPemesanan', function(){
});
});
Route
::
group
([
'middleware'
=>
'owner'
],
function
()
{
Route
::
group
([
'middleware'
=>
'owner'
],
function
()
{
Route
::
post
(
'printreport'
,
'OwnerController@printReport'
);
Route
::
put
(
'asread/{id}'
,
'OwnerController@Asread'
);
Route
::
put
(
'asread/{id}'
,
'OwnerController@Asread'
);
Route
::
get
(
'record'
,
'OwnerController@Record'
);
Route
::
get
(
'record'
,
'OwnerController@Record'
);
Route
::
get
(
'report'
,
'OwnerController@Report'
);
Route
::
get
(
'report'
,
'OwnerController@Report'
);
Route
::
get
(
'report/{id}'
,
'OwnerController@findReport'
);
Route
::
put
(
'check/{id}'
,
'OwnerController@Check'
);
Route
::
put
(
'check/{id}'
,
'OwnerController@Check'
);
Route
::
put
(
'editRoom/{id}'
,
'OwnerController@updateRoom'
);
Route
::
put
(
'editRoom/{id}'
,
'OwnerController@updateRoom'
);
Route
::
post
(
'addManual'
,
'OwnerController@addBookManual'
);
Route
::
post
(
'addManual'
,
'OwnerController@addBookManual'
);
...
@@ -147,6 +149,4 @@ Route::group(['middleware' => 'dinaspariwisata'], function () {
...
@@ -147,6 +149,4 @@ Route::group(['middleware' => 'dinaspariwisata'], function () {
Route
::
get
(
'printFasilitas/{id}'
,
'AdminController@printFasilitas'
);
Route
::
get
(
'printFasilitas/{id}'
,
'AdminController@printFasilitas'
);
Route
::
post
(
'/cancelrequest'
,
'AdminController@cancelrequest'
);
Route
::
post
(
'/cancelrequest'
,
'AdminController@cancelrequest'
);
Route
::
get
(
'admin/create'
,
'AdminController@create'
);
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