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
ffc69484
Commit
ffc69484
authored
7 years ago
by
Juliper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
4789f46f
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
48 deletions
+101
-48
GuestController.php
app/Http/Controllers/GuestController.php
+57
-0
Room.php
app/Room.php
+1
-1
Home.blade.php
resources/views/vendor/adminlte/layouts/pages/Home.blade.php
+34
-13
Homestay.blade.php
...es/views/vendor/adminlte/layouts/pages/Homestay.blade.php
+0
-30
searchhomestay.blade.php
...ws/vendor/adminlte/layouts/pages/searchhomestay.blade.php
+3
-3
web.php
routes/web.php
+6
-1
No files found.
app/Http/Controllers/GuestController.php
View file @
ffc69484
...
...
@@ -35,6 +35,63 @@ class GuestController extends Controller
return
view
(
'welcome'
);
}
public
function
cari
(
Request
$request
){
$data
=
Homestay
::
all
();
//$a = null;
//$book_start[] = null;
$i
=
0
;
foreach
(
$data
as
$a
){
$book_start
=
DB
::
table
(
'daftar_book'
)
->
select
(
'daftar_book.*'
)
->
where
(
'daftar_book.tanggal_mulai'
,
'='
,
$request
[
'tanggal_mulai'
])
->
get
();
$book_finish
=
DB
::
table
(
'daftar_book'
)
->
select
(
'daftar_book.*'
)
->
where
(
'daftar_book.tanggal_berakhir'
,
'='
,
$request
[
'tanggal_selesai'
])
->
get
();
if
(
$book_start
->
count
()
>
0
){
dd
(
$book_start
);
//dd($book_start[0]->jumlah_kamar);
}
else
{
if
(
$book_finish
->
count
()
>
0
){
}
else
{
if
(
$request
[
'jumlah_Tamu'
]
>
$request
[
'jumlah_kamar'
]
*
2
){
dd
(
'ngak bisa'
);
}
else
{
$dataHomestay
[
$i
]
=
DB
::
table
(
'homestay'
)
->
where
(
'homestay.id'
,
'='
,
$a
->
id
)
->
get
();
}
}
}
$i
++
;
}
// $j=0;
// //dd($dataHomestay[1][0]->nama_homestay);//,$dataHomestay[1]->nama_homestay,$dataHomestay[2]->nama_homestay);
// foreach ($dataHomestay as $b){
// echo $b[0]->nama_homestay;
// //echo $j;
//// if($j==1){
//// dd($b[0]);
//// }
// echo '<br>';
// $j++;
// }
return
view
(
'searchhomestay'
)
->
with
(
'data'
,
$dataHomestay
);
//dd($i,$book_start[0],$book_start[1],$book_start[2],$book_finish[0],$book_finish[1],$book_finish[2]);
//dd($request['tanggal_mulai'],$request['jumlah_hari'],$request['tanggal_selesai'],$request['jumlah_Tamu'],$request['jumlah_kamar']);
}
//Menyimpan data Pelanggan disaat melakukan Pendaftaran
public
function
registerStore
(
Request
$data
){
...
...
This diff is collapsed.
Click to expand it.
app/Room.php
View file @
ffc69484
...
...
@@ -9,7 +9,7 @@ class Room extends Model
protected
$table
=
"kamar"
;
protected
$fillable
=
[
'idHomestay'
,
'jumlah_bed'
,
'fasilitas'
,
'nomor_kamar'
,
'id_transaksi'
'idHomestay'
,
'jumlah_bed'
,
'fasilitas'
,
'nomor_kamar'
,
'id_transaksi'
,
'tamu_per_kamar'
,
];
public
$timestamps
=
false
;
...
...
This diff is collapsed.
Click to expand it.
resources/views/vendor/adminlte/layouts/pages/Home.blade.php
View file @
ffc69484
...
...
@@ -26,37 +26,34 @@
<div class="
col
-
md
-
12
col
-
sm
-
12
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
" style="
background
-
color
:
#f3f3f3;
padding
-
top
:
28
px
;
padding
-
bottom
:
28
px
;
">
<form action="
{{
url
(
'book'
)}}
" method="
post
">
<input type="
hidden
" name="
_token
" value="
{{
csrf_token
()
}}
">
<form action="
{{
url
(
'cari'
)}}
">
<div class="
col
-
md
-
2
col
-
sm
-
2
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
"></div>
<div class="
col
-
md
-
2
col
-
sm
-
2
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
">
<label>Tanggal Check-in:</label>
<input class="
date
agileits
w3layouts
" id="
datepicker1
" name="
tanggal
" type="
text
"
value="
Tanggal
Check
in
" onfocus="
this
.
value
=
''
;
" onblur="
if
(
this
.
value
==
''
)
{
this
.
value
=
''
;}
">
<input class="
date
agileits
w3layouts
" id="
datepicker1
" name="
tanggal
_mulai
" type="
text
" required
value="
Tanggal
Check
in
" onfocus="
this
.
value
=
''
;
" onblur="
if
(
this
.
value
==
''
)
{
this
.
value
=
''
;}
">
</div>
<div class="
col
-
md
-
2
col
-
sm
-
2
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
">
<label>Durasi</label>
<input type="
text
" class="
text
wow
agileits
w3layouts
" name="
jumlah_hari
" placeholder="
Lama
Menginap
" style="
background
-
color
:
white
;
color
:
black
">
<input type="
number
" min="
1
" class="
text
wow
agileits
w3layouts
" name="
jumlah_hari
" required onchange="
updateDate
(
this
)
" placeholder="
Lama
Menginap
" style="
background
-
color
:
white
;
color
:
black
">
</div>
<div class="
col
-
md
-
2
col
-
sm
-
2
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
">
<label>Tanggal Check-out:</label>
<input class="
date
agileits
w3layouts
" id="
datepicker
1
" name="
tanggal
" type="
text
" value="
Tanggal
Check
Out
" onfocus="
this
.
value
=
''
;
" onblur="
if
(
this
.
value
==
''
)
{
this
.
value
=
''
;}
">
<input class="
date
agileits
w3layouts
" id="
datepicker
2
" name="
tanggal_selesai
" type="
text
" value="
Tanggal
Check
Out
" onfocus="
this
.
value
=
''
;
" onblur="
if
(
this
.
value
==
''
)
{
this
.
value
=
''
;}
">
</div>
<div class="
col
-
md
-
1
col
-
sm
-
2
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
">
<label>Tamu :</label>
<input type="
number
" min="
0
" class="
text
wow
agileits
w3layouts
"
name="
jumlah_Tamu
" placeholder="" style="
background
-
color
:
white
;
color
:
black
">
<input type="
number
" min="
1
" class="
text
wow
agileits
w3layouts
" required
name="
jumlah_Tamu
" placeholder="" style="
background
-
color
:
white
;
color
:
black
">
</div>
<div class="
col
-
md
-
1
col
-
sm
-
2
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
">
<label>Kamar : </label>
<input type="
number
" min="
0
" class="
text
wow
agileits
w3layouts
" name="
jumlah_kamar
" placeholder="" style="
background
-
color
:
white
;
color
:
black
">
</div><br>
<div class="
col
-
md
-
3
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
">
<div class="
book
" >
<a href="
/
searchhomestay
" class="
cari
"> Cari </a>
</div>
<input type="
number
" min="
1
" class="
text
wow
agileits
w3layouts
" required name="
jumlah_kamar
" placeholder="" style="
background
-
color
:
white
;
color
:
black
">
</div>
<div class="
book
">
<input type="
submit
" class="
more_btn
wow
agileits
w3layouts
" value="
Cari
">
</div>
</form>
</div>
<br>
...
...
@@ -185,4 +182,28 @@
</div>
</div>
<!-- //Lokasi -->
<script>
function updateDate(object) {
//$('#tanggal_selesai').datepicker({
// dateFormat: "
yy
-
mm
-
dd
",
//});
//alert(object.value);
//var tanggal_mulai = $('#datepicker1').datepicker('getDate');
//tanggal_mulai.setDate(tanggal_mulai.getDate()+parseInt(object.value));
//$('#tanggal_selesai').datepicker('setDate',tanggal_mulai);
//alert(tanggal_mulai);
var date1 = $('#datepicker1').datepicker('getDate');
var date = new Date( Date.parse( date1 ) );
date.setDate( date.getDate() + parseInt(object.value) );
var newDate = date.toDateString();
newDate = new Date( Date.parse( newDate ) );
$('#datepicker2').datepicker("
setDate
",newDate);
}
</script>
@endsection
This diff is collapsed.
Click to expand it.
resources/views/vendor/adminlte/layouts/pages/Homestay.blade.php
View file @
ffc69484
...
...
@@ -32,31 +32,6 @@
</div>
@endif
</div>
<br><br>
<div class="
col
-
md
-
12
col
-
sm
-
12
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
">
<form action="
{{
url
(
'book'
)}}
" method="
post
">
<input type="
hidden
" name="
_token
" value="
{{
csrf_token
()
}}
">
<input type="
hidden
" name="
id
" value="
{{
$data
->
id
}}
">
<div class="
col
-
md
-
2
col
-
sm
-
2
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
"></div>
<div class="
col
-
md
-
3
col
-
sm
-
3
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
">
<input class="
date
agileits
w3layouts
" id="
datepicker1
" name="
tanggal
" type="
text
" value="
Tanggal
Check
in
" onfocus="
this
.
value
=
''
;
" onblur="
if
(
this
.
value
==
''
)
{
this
.
value
=
''
;}
">
</div>
<div class="
col
-
md
-
2
col
-
sm
-
2
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
">
<input type="
number
" min="
1
" class="
text
wow
agileits
w3layouts
" name="
jumlah_hari
" placeholder="
Lama
Menginap
" onchange="
updateDate
(
this
)
" style="
background
-
color
:
white
;
color
:
black
">
</div>
<div class="
col
-
md
-
2
col
-
sm
-
2
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
">
<input type="
number
" min="
1
" class="
text
wow
agileits
w3layouts
" name="
jumlah_kamar
" placeholder="
Jumlah
Kamar
" style="
background
-
color
:
white
;
color
:
black
">
</div>
<div class="
col
-
md
-
2
col
-
sm
-
2
agileits
w3layouts
contact
-
grid
contact
-
grid
-
2
">
<input type="
text
" id="
datepicker2
" class="
text
wow
agileits
w3layouts
" name="
tanggal_selesai
" readonly placeholder="
Tanggal
Berakhir
" style="
background
-
color
:
white
;
color
:
black
">
</div>
<div class="
book
">
<input type="
submit
" class="
more_btn
wow
agileits
w3layouts
" value="
Book
Now
">
</div>
</form>
</div>
</div>
<!-- Informations -->
<div class="
cuisines
agileits
w3layouts
">
<div class="
container
">
...
...
@@ -91,11 +66,6 @@
<
td
>
{{
$data
->
no_rekening
}}
</
td
>
</
tr
>
<
tr
>
<
td
>
Avilable
Room
</
td
>
<
td
>:</
td
>
<
td
style
=
"color: #1dc8d9;font-size:30px;"
>
{{
$avilable
}}
</
td
>
</
tr
>
<
tr
>
<
td
>
Harga
</
td
>
<
td
>:</
td
>
<
td
>
Rp
150.000
/
hari
</
td
>
...
...
This diff is collapsed.
Click to expand it.
resources/views/vendor/adminlte/layouts/pages/searchhomestay.blade.php
View file @
ffc69484
...
...
@@ -22,12 +22,12 @@
<div class="
col
-
md
-
4
col
-
sm
-
4
details
-
grid
details
-
grid
-
2
agileits
w3layouts
">
<div class="
details
-
grid2
agileits
w3layouts
">
<div class="
details
-
grid
-
image
agileits
w3layouts
" >
<img src="
/
img
/
{{
$a
->
gambar
}}
" alt="
Agileits
W3layouts
" >
<img src="
/
img
/
{{
$a
[
0
]
->
gambar
}}
" alt="
Agileits
W3layouts
" >
</div>
<div class="
details
-
grid
-
info
agileits
w3layouts
">
<h4>
{
{$a->nama_homestay}
}
</h4>
<h4>
{
{$a
[0]
->nama_homestay}
}
</h4>
</div>
<a href ="
{{
url
(
'detailhomestay/'
.
$a
->
id
)}}
" ><button class="
btn
btn
-
primary
agileits
w3layouts
" data-toggle="
modal
" > LIHAT <span class="
glyphicon
agileits
w3layouts
glyphicon
-
arrow
-
right
" aria-hidden="
true
"></span></button> </a>
<a href ="
{{
url
(
'detailhomestay/'
.
$a
[
0
]
->
id
)}}
" ><button class="
btn
btn
-
primary
agileits
w3layouts
" data-toggle="
modal
" > LIHAT <span class="
glyphicon
agileits
w3layouts
glyphicon
-
arrow
-
right
" aria-hidden="
true
"></span></button> </a>
<div class="
clearfix
"></div>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
routes/web.php
View file @
ffc69484
<?php
use
App\Homestay
;
use
Illuminate\Http\Request
;
/*
|--------------------------------------------------------------------------
| Web Routes
...
...
@@ -16,7 +17,10 @@ Route::get('/', function () {
return
view
(
'index'
)
->
with
(
'data'
,
$data
);
});
Route
::
get
(
'/searchhomestay'
,
function
()
{
Route
::
get
(
'test'
,
function
(
Request
$request
)
{
dd
(
$request
);
$data
=
Homestay
::
all
();
return
view
(
'searchhomestay'
)
->
with
(
'data'
,
$data
);
});
...
...
@@ -88,6 +92,7 @@ Route::group(['middleware' => 'owner'], function () {
});
Route
::
get
(
'cari'
,
'GuestController@cari'
);
Route
::
get
(
'detailhomestay/{id}'
,
'GuestController@detailhomestay'
);
Route
::
get
(
'daftar'
,
'GuestController@register'
);
Route
::
post
(
'daftar'
,
'GuestController@registerStore'
);
...
...
This diff is collapsed.
Click to expand it.
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