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
040ca38b
Commit
040ca38b
authored
May 18, 2017
by
Palti Sinaga
Browse files
Options
Browse Files
Download
Plain Diff
no message
parents
964b6449
b5959e5b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
3 deletions
+34
-3
CustomerController.php
app/Http/Controllers/CustomerController.php
+15
-3
OwnerController.php
app/Http/Controllers/OwnerController.php
+19
-0
No files found.
app/Http/Controllers/CustomerController.php
View file @
040ca38b
...
@@ -169,6 +169,10 @@ class CustomerController extends Controller
...
@@ -169,6 +169,10 @@ class CustomerController extends Controller
}
}
public
function
booking
(
Request
$request
){
public
function
booking
(
Request
$request
){
if
(
Auth
::
guest
()){
dd
(
"you must have account"
);
}
$lb
=
new
ListBook
();
$lb
=
new
ListBook
();
$dataHomestay
=
DB
::
table
(
'homestay'
)
$dataHomestay
=
DB
::
table
(
'homestay'
)
...
@@ -185,7 +189,7 @@ class CustomerController extends Controller
...
@@ -185,7 +189,7 @@ class CustomerController extends Controller
->
get
();
->
get
();
$dataBookingBerakhir
=
DB
::
table
(
'daftar_book'
)
$dataBookingBerakhir
=
DB
::
table
(
'daftar_book'
)
->
select
(
'daftar_book.*'
)
->
select
(
'daftar_book.*'
)
->
where
(
'daftar_book.tanggal_
mulai
'
,
'='
,
$request
[
'tanggal'
])
->
where
(
'daftar_book.tanggal_
berakhir
'
,
'='
,
$request
[
'tanggal'
])
->
get
();
->
get
();
if
(
$dataBookingMulai
->
count
()
>
0
){
if
(
$dataBookingMulai
->
count
()
>
0
){
...
@@ -199,7 +203,16 @@ class CustomerController extends Controller
...
@@ -199,7 +203,16 @@ class CustomerController extends Controller
}
}
}
else
{
}
else
{
echo
(
'langsung aja'
);
if
(
$dataBookingBerakhir
->
count
()
>
0
){
$currentJumlahKamar2
=
$homestayJumlahKamar
[
0
]
->
jumlahKamar
-
$dataBookingBerakhir
[
0
]
->
jumlah_kamar
;
if
(
$currentJumlahKamar2
>=
$request
[
'jumlah_kamar'
]){
dd
(
'boleh aja agan'
);
}
else
{
dd
(
'nggak boleh'
);
}
}
else
{
dd
(
'masuk aja gan'
);
}
}
}
...
@@ -213,7 +226,6 @@ class CustomerController extends Controller
...
@@ -213,7 +226,6 @@ class CustomerController extends Controller
->
get
();
->
get
();
//dd($dataHomestay,$dataPelanggan);
//dd($dataHomestay,$dataPelanggan);
$time
=
explode
(
'-'
,
$request
[
'tanggal'
]);
$time
=
explode
(
'-'
,
$request
[
'tanggal'
]);
$time
[
2
]
+=
$request
[
'jumlah_hari'
];
$time
[
2
]
+=
$request
[
'jumlah_hari'
];
...
...
app/Http/Controllers/OwnerController.php
View file @
040ca38b
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
App\ListBook
;
use
App\RequestFasilitas
;
use
App\RequestFasilitas
;
use
App\RequestHomestay
;
use
App\RequestHomestay
;
use
App\Room
;
use
App\Room
;
...
@@ -20,6 +21,24 @@ class OwnerController extends Controller
...
@@ -20,6 +21,24 @@ class OwnerController extends Controller
}
}
public
function
addBook
(
Request
$request
){
$lb
=
new
ListBook
();
$dataPemilik
=
DB
::
table
(
'pemilikhomestay'
)
->
select
(
'pemilikhomestay.id'
)
->
where
(
'pemilikhomestay.id_Akun'
,
'='
,
Auth
::
user
()
->
id
)
->
get
();
$dataHomestay
=
DB
::
table
(
'homestay'
)
->
join
(
'pemilikhomestay'
,
'homestay.idPemilik'
,
'pemilikhomestay.id'
)
->
select
(
'homestay.id'
)
->
where
(
'homestay.id_Akun'
,
'='
,
$dataPemilik
[
0
]
->
id
)
->
get
();
}
public
function
updateRoom
(
Request
$request
,
$id
){
public
function
updateRoom
(
Request
$request
,
$id
){
$dataKamar
=
Room
::
find
(
$id
);
$dataKamar
=
Room
::
find
(
$id
);
...
...
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