Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Bojan Borovcanin
/
WBT1920_team30
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
608f9301
authored
May 11, 2020
by
Bojan Borovcanin
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
home page changed
parent
b7b9b940
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
95 deletions
test/views/pages/home.php
test/views/pages/home.php
View file @
608f9301
...
...
@@ -143,32 +143,106 @@
</div>
</div>
<div
id=
"RoomsSection"
class=
"container-fluid text-center bg-grey"
>
<h2>
Rooms
</h2>
<h4>
What we have
</h4>
<div
class=
"row text-center"
>
<div
class=
"col-sm-4"
>
<div
class=
"thumbnail"
>
<img
src=
"
<?php
echo
base_url
();
?>
assets/images/soba1.jpg"
alt=
"Paris"
>
<p><strong>
Paris
</strong></p>
<p>
Yes, we built Paris
</p>
</div>
</div>
<div
class=
"col-sm-4"
>
<div
class=
"thumbnail"
>
<img
src=
"
<?php
echo
base_url
();
?>
assets/images/soba2.jpg"
alt=
"New York"
>
<p><strong>
New York
</strong></p>
<p>
We built New York
</p>
</div>
</div>
<div
class=
"col-sm-4"
>
<div
class=
"thumbnail"
>
<img
src=
"
<?php
echo
base_url
();
?>
assets/images/soba3.jpg"
alt=
"San Francisco"
>
<p><strong>
San Francisco
</strong></p>
<p>
Yes, San Fran is ours
</p>
<!-- Rooms: no user -->
<div
id=
"RoomsSection"
class=
"container-fluid text-center bg-grey"
>
<h2>
Rooms
</h2>
<h4>
What we have
</h4>
<?php
if
(
!
isset
(
$_SESSION
[
'logged_in'
]))
{
?>
<div
class=
"row text-center"
>
<div
class=
"col-sm-4"
>
<div
class=
"thumbnail"
>
<?php
foreach
(
$apartments
as
$apartment
)
{
?>
<?php
echo
'<img src="data:image/jpeg;base64,'
.
base64_encode
(
$apartment
[
'image'
])
.
'" alt = "image"> '
;
echo
"<p><strong> "
.
$apartment
[
'title'
]
.
" </strong></p>"
;
echo
"<p>"
.
$apartment
[
'description'
]
.
"</p>"
;
?>
<?php
}
?>
<?php
}
?>
</div>
</div>
</div>
</div>
<!-- Rooms: worker logged in -->
<?php
if
(
isset
(
$_SESSION
[
'logged_in'
]))
{
if
(
$_SESSION
[
'logged_in'
][
'acl'
]
==
1
)
{
?>
<div
class=
"row text-center"
>
<div
class=
"col-sm-4"
>
<div
class=
"thumbnail"
>
<form
action=
"
<?php
echo
base_url
();
?>
pages/deleteApartment?>"
method=
"post"
>
<?php
foreach
(
$apartments
as
$apartment
)
{
?>
<?php
echo
'<img src="data:image/jpeg;base64,'
.
base64_encode
(
$apartment
[
'image'
])
.
'" alt = "image"> '
;
echo
"<p><strong> "
.
$apartment
[
'title'
]
.
" </strong></p>"
;
echo
"<p>"
.
$apartment
[
'description'
]
.
" <br> for "
.
$apartment
[
'number_of_beds'
]
.
" persons </p>"
;
echo
"<input type='hidden' name='id' value="
.
$apartment
[
'id_apatment'
]
.
">"
;
echo
"<input type='submit' name='delete_apartment' value='Delete'></br>"
;
?>
<?php
}
?>
</form>
<?php
}
?>
<?php
}
?>
</div>
</div>
</div>
</div>
<!-- Rooms: user logged in -->
<?php
if
(
isset
(
$_SESSION
[
'logged_in'
]))
{
if
(
$_SESSION
[
'logged_in'
][
'acl'
]
==
2
)
{
?>
<div
class=
"row text-center"
>
<div
class=
"col-sm-4"
>
<div
class=
"thumbnail"
>
<form
action=
"
<?php
echo
base_url
();
?>
/pages/moreAboutApartment"
method=
"post"
>
<?php
foreach
(
$apartments
as
$apartment
)
{
?>
<?php
echo
'<img src="data:image/jpeg;base64,'
.
base64_encode
(
$apartment
[
'image'
])
.
'" alt = "image"> '
;
echo
"<p><strong> "
.
$apartment
[
'title'
]
.
" </strong></p>"
;
echo
"<p>"
.
$apartment
[
'description'
]
.
" <br> for "
.
$apartment
[
'number_of_beds'
]
.
" persons </p>"
;
echo
"<input type='hidden' name='id' value="
.
$apartment
[
'id_apatment'
]
.
">"
;
echo
"<input type='submit' name='more_about_apartment' value='More'></br>"
;
?>
<?php
}
?>
</form>
<?php
}
?>
<?php
}
?>
</div>
</div>
</div>
</div>
<h2>
What our guests say
</h2>
<div
id=
"myCarousel1"
class=
"carousel slide text-center"
data-ride=
"carousel"
>
...
...
@@ -231,78 +305,6 @@
</div>
</div>
<!--Home page when no one is logged in -->
<?php
if
(
!
isset
(
$_SESSION
[
'logged_in'
]))
{
?>
Log in to learn more
<div>
<?php
foreach
(
$apartments
as
$apartment
)
{
echo
"<div>Title:"
.
$apartment
[
'title'
]
.
" </div><br>"
;
echo
"<div>Description:"
.
$apartment
[
'description'
]
.
" </div><br>"
;
echo
"<div>Room with :"
.
$apartment
[
'number_of_beds'
]
.
" beds </div><br>"
;
}
?>
<?php
}
?>
<!--Home page when user is logged in -->
<?php
if
(
isset
(
$_SESSION
[
'logged_in'
]))
{
if
(
$_SESSION
[
'logged_in'
][
'acl'
]
==
2
)
{
?>
<form
action=
"
<?php
echo
base_url
();
?>
/pages/moreAboutApartment"
method=
"post"
>
<div>
<?php
foreach
(
$apartments
as
$apartment
)
{
echo
"<div>"
;
echo
"<div>Title:"
.
$apartment
[
'title'
]
.
" </div><br>"
;
echo
"<div>Description:"
.
$apartment
[
'description'
]
.
" </div><br>"
;
echo
"<div>Room with :"
.
$apartment
[
'number_of_beds'
]
.
" beds </div><br>"
;
echo
"<input type='hidden' name='id' value="
.
$apartment
[
'id_apatment'
]
.
">"
;
echo
"<input type='submit' name='more_about_apartment' value='More'></br>"
;
echo
"</div>"
;
}
?>
</div>
</form>
<?php
}
}
?>
<!--Home page when worker is logged in -->
<?php
if
(
isset
(
$_SESSION
[
'logged_in'
]))
{
if
(
$_SESSION
[
'logged_in'
][
'acl'
]
==
1
)
{
?>
<form
action=
"
<?php
echo
base_url
();
?>
pages/deleteApartment?>"
method=
"post"
>
<div>
<?php
foreach
(
$apartments
as
$apartment
)
{
echo
"<div>Title:"
.
$apartment
[
'title'
]
.
" </div><br>"
;
echo
"<div>Description:"
.
$apartment
[
'description'
]
.
" </div><br>"
;
echo
"<div>Room with :"
.
$apartment
[
'number_of_beds'
]
.
" beds </div><br>"
;
echo
"<input type='hidden' name='id' value="
.
$apartment
[
'id_apatment'
]
.
">"
;
echo
"<input type='submit' name='delete_apartment' value='Delete'></br>"
;
}
?>
</div>
</form>
<form
action=
"
<?php
echo
base_url
();
?>
pages/addNewApartment"
method=
"post"
>
<input
type=
"submit"
name=
"addNewApartment"
value=
"Add new apartment"
>
</form>
<?php
}
}
?>
</body>
</html>
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