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
72fa80b2
Commit
72fa80b2
authored
Jun 15, 2017
by
Juliper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
0c3bf67b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
12 deletions
+75
-12
AdminController.php
app/Http/Controllers/AdminController.php
+18
-4
GuestController.php
app/Http/Controllers/GuestController.php
+4
-5
OwnerController.php
app/Http/Controllers/OwnerController.php
+43
-3
anggiat.jpg
public/img/anggiat.jpg
+0
-0
resultlistpesanan.blade.php
...vendor/adminlte/layouts/admin/resultlistpesanan.blade.php
+10
-0
No files found.
app/Http/Controllers/AdminController.php
View file @
72fa80b2
...
@@ -87,10 +87,23 @@ class AdminController extends Controller
...
@@ -87,10 +87,23 @@ class AdminController extends Controller
->
where
(
'daftar_book.homestay'
,
'='
,
$dataHomestay
[
0
]
->
id
)
->
where
(
'daftar_book.homestay'
,
'='
,
$dataHomestay
[
0
]
->
id
)
->
where
(
'daftar_book.id_transaksi'
,
'='
,
null
)
->
where
(
'daftar_book.id_transaksi'
,
'='
,
null
)
->
select
(
'homestay.nama_homestay'
,
'homestay.owner'
,
'daftar_book.*'
)
->
select
(
'homestay.nama_homestay'
,
'homestay.owner'
,
'daftar_book.*'
)
//->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan'])
->
get
();
->
get
();
//dd($dataHos2);
return
view
(
'adminlte::layouts.admin.resultlistpesanan'
)
->
with
(
'data'
,
$dataHos
)
->
with
(
'data2'
,
$dataHos2
);
$penghasilan
=
0
;
foreach
(
$dataHos
as
$a
){
$penghasilan
+=
$a
->
total_pembayaran
;
//$i++;
}
foreach
(
$dataHos2
as
$b
){
$biaya
=
(
$b
->
jumlah_kamar
*
150000
)
*
$b
->
lama_menginap
;
$penghasilan
+=
$biaya
;
}
return
view
(
'adminlte::layouts.admin.resultlistpesanan'
)
->
with
(
'data'
,
$dataHos
)
->
with
(
'data2'
,
$dataHos2
)
->
with
(
'penghasilan'
,
$penghasilan
);
}
else
{
}
else
{
$data
=
DB
::
table
(
'daftar_book'
)
$data
=
DB
::
table
(
'daftar_book'
)
->
join
(
'transaksi'
,
'daftar_book.id_transaksi'
,
'='
,
'transaksi.id'
)
->
join
(
'transaksi'
,
'daftar_book.id_transaksi'
,
'='
,
'transaksi.id'
)
...
@@ -123,7 +136,8 @@ class AdminController extends Controller
...
@@ -123,7 +136,8 @@ class AdminController extends Controller
//dd($data,$data2,$penghasilan);
//dd($data,$data2,$penghasilan);
//dd($data2);
//dd($data2);
return
view
(
'adminlte::layouts.admin.resultlistpesanan'
)
->
with
(
'data'
,
$data
)
->
with
(
'data2'
,
$data2
);
return
view
(
'adminlte::layouts.admin.resultlistpesanan'
)
->
with
(
'data'
,
$data
)
->
with
(
'data2'
,
$data2
)
->
with
(
'penghasilan'
,
$penghasilan
);
}
}
}
}
...
...
app/Http/Controllers/GuestController.php
View file @
72fa80b2
...
@@ -258,7 +258,7 @@ class GuestController extends Controller
...
@@ -258,7 +258,7 @@ class GuestController extends Controller
//$dataKamarHomestay = ListBook::find(14);
//$dataKamarHomestay = ListBook::find(14);
//dd($dataKamarHomestay);
//dd($dataKamarHomestay);
//dd($dataCurrent);
//dd($dataCurrent
,$counter
);
for
(
$l
=
0
;
$l
<
$counter
;
$l
++
){
for
(
$l
=
0
;
$l
<
$counter
;
$l
++
){
// echo $dataCurrent[$l];
// echo $dataCurrent[$l];
...
@@ -272,12 +272,9 @@ class GuestController extends Controller
...
@@ -272,12 +272,9 @@ class GuestController extends Controller
$currentKamar
=
$a
->
jumlah_kamar
;
$currentKamar
=
$a
->
jumlah_kamar
;
}
}
}
}
//dd($dataKamarHomestay[1][0]->homestay);
//dd($currentKamar);
//dd($dataKamarHomestay);
// echo $currentKamar;
//dd('asd');
if
(
$request
[
'jumlah_kamar'
]
<=
$currentKamar
){
if
(
$request
[
'jumlah_kamar'
]
<=
$currentKamar
){
if
(
$request
[
'jumlah_Tamu'
]
<=
(
$request
[
'jumlah_kamar'
]
*
2
)){
if
(
$request
[
'jumlah_Tamu'
]
<=
(
$request
[
'jumlah_kamar'
]
*
2
)){
$dataHomestay
[
$i
]
=
DB
::
table
(
'homestay'
)
$dataHomestay
[
$i
]
=
DB
::
table
(
'homestay'
)
...
@@ -312,6 +309,8 @@ class GuestController extends Controller
...
@@ -312,6 +309,8 @@ class GuestController extends Controller
$i
++
;
$i
++
;
}
}
//dd($currentKamar);
//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 Avilable tidak mencukupi'
);
...
...
app/Http/Controllers/OwnerController.php
View file @
72fa80b2
...
@@ -395,11 +395,51 @@ class OwnerController extends Controller
...
@@ -395,11 +395,51 @@ class OwnerController extends Controller
$lb
->
lama_menginap
=
$request
[
'lama_menginap'
];
$lb
->
lama_menginap
=
$request
[
'lama_menginap'
];
$lb
->
total_harga
=
$tohar
+
$datam
;
$lb
->
total_harga
=
$tohar
+
$datam
;
//dd($tohar + $datam);
$time
=
explode
(
'-'
,
$request
[
'tanggal_mulai'
]);
$time
=
explode
(
'-'
,
$request
[
'tanggal_mulai'
]);
$time
[
2
]
+=
$request
[
'jumlah_hari'
];
if
(
$time
[
1
]
==
2
){
$time
[
2
]
+=
$request
[
'lama_menginap'
];
if
(
$time
[
2
]
>
28
){
$time
[
2
]
=
0
;
$time
[
2
]
+=
$request
[
'lama_menginap'
];
$time
[
2
]
-=
1
;
$time
[
1
]
+=
1
;
if
(
$time
[
1
]
>
12
){
$time
[
1
]
=
1
;
}
}
}
else
{
if
(
$time
[
1
]
%
2
==
1
){
$time
[
2
]
+=
$request
[
'lama_menginap'
];
if
(
$time
[
2
]
>
31
){
if
(
$request
[
'lama_menginap'
]
!=
1
){
$time
[
2
]
=
0
;
$time
[
2
]
+=
$request
[
'lama_menginap'
];
$time
[
1
]
+=
1
;
}
}
//$time[2] -=1;
}
else
{
$time
[
2
]
+=
$request
[
'lama_menginap'
];
if
(
$time
[
2
]
>
30
){
if
(
$request
[
'lama_menginap'
]
!=
1
){
$time
[
2
]
=
0
;
$time
[
2
]
+=
$request
[
'lama_menginap'
];
$time
[
1
]
+=
1
;
}
}
//$time[2] -=1;
}
}
//$time[2] += $request['lama_menginap'];
$baru
=
join
(
'-'
,
$time
);
$baru
=
join
(
'-'
,
$time
);
// dd($time,$request['tanggal_mulai'],$baru,$request['lama_menginap']);
$lb
->
tanggal_berakhir
=
$baru
;
$lb
->
tanggal_berakhir
=
$baru
;
$lb
->
save
();
$lb
->
save
();
...
...
public/img/anggiat.jpg
0 → 100644
View file @
72fa80b2
107 KB
resources/views/vendor/adminlte/layouts/admin/resultlistpesanan.blade.php
View file @
72fa80b2
...
@@ -59,6 +59,16 @@
...
@@ -59,6 +59,16 @@
</tr>
</tr>
@endforeach
@endforeach
<tr>
<td>Total</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
{
{$penghasilan}
}
</td>
</tr>
</table>
</table>
...
...
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