Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
IF3110-2018-K03-Petjah
TugasBesar1_2018
Commits
89bd9fb8
Commit
89bd9fb8
authored
Oct 26, 2018
by
Erma Safira Nurmasyita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Book Detail picture displays
parent
1af83651
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
web/book_detail/view.php
web/book_detail/view.php
+14
-6
web/review/view.php
web/review/view.php
+9
-2
No files found.
web/book_detail/view.php
View file @
89bd9fb8
...
...
@@ -41,7 +41,7 @@
</div>
<div class="add-flex-direction-column" id="rightbar-pic" align="center">
<div class="flex-1">
<img id="book-pict" src="'
.
self
::
showPicture
(
'book
s
'
,
'../images/books_picture/default.jpg'
)
.
'">
<img id="book-pict" src="'
.
self
::
showPicture
(
'book'
,
$book_detail
[
'ID'
]
)
.
'">
</div>
<div class="rating-pict">'
.
self
::
drawRating
(
$book_rating
)
.
...
...
@@ -67,11 +67,19 @@
return
$str
.
'</div>'
;
}
private
function
showPicture
(
$obj
,
$picSrc
)
{
if
(
$picSrc
==
NULL
)
{
return
'../images/'
.
$obj
.
'_picture/default.jpg'
;
private
function
showPicture
(
$obj
,
$input
)
{
if
(
$obj
==
"book"
)
{
if
(
fileProcessing
::
isExistBookImage
(
$input
))
{
return
fileProcessing
::
getImageBookPathFromRoot
(
$input
);
}
else
{
return
'/images/books_picture/default.jpg'
;
}
}
else
{
return
$picSrc
;
if
(
fileProcessing
::
isExistProfileImage
(
$input
))
{
return
fileProcessing
::
getImageProfilePathFromRoot
(
$input
);
}
else
{
return
'/images/profiles_picture/default.jpg'
;
}
}
}
...
...
@@ -110,7 +118,7 @@
<div class="flex-container align-items-flex-start">
<div class="flex-1 flex-review-tab">
<div class="reviewer-profile">
<img id="profile_pict" src="'
.
self
::
showPicture
(
'
profiles
'
,
$review
[
'
profile_pictur
e'
])
.
'">
<img id="profile_pict" src="'
.
self
::
showPicture
(
'
user
'
,
$review
[
'
usernam
e'
])
.
'">
</div>
<div id="comment-user">
<div id="reviewer">@'
.
$review
[
'username'
]
.
'</div>
...
...
web/review/view.php
View file @
89bd9fb8
<?php
class
reviewFormViewer
{
public
static
function
viewReviewForm
(
$params
)
{
$ordered_book
=
$params
[
'ordered_book'
];
...
...
@@ -36,12 +35,20 @@
</div>
<div class="add-flex-direction-column" id="rightbar-pic" align="center">
<div class="flex-1">
<img id="book-pict" src="
../images/books_picture/default.jpg
">
<img id="book-pict" src="
'
.
self
::
showPicture
(
$ordered_book
[
'book_id'
])
.
'
">
</div>
</div>
</div>'
;
return
$str
;
}
private
function
showPicture
(
$input
)
{
if
(
fileProcessing
::
isExistBookImage
(
$input
))
{
return
fileProcessing
::
getImageBookPathFromRoot
(
$input
);
}
else
{
return
'/images/books_picture/default.jpg'
;
}
}
private
function
showReviewForm
(
$order_id
,
$book_id
)
{
$str
=
'
...
...
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