[FIX] Profile picture problem display

parent b70fe0c3
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Book Detail</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="../css/header.css">
<link rel="stylesheet" type="text/css" href="../css/color-lib.css">
<link rel="stylesheet" type="text/css" href="../css/basic.css">
<link rel="stylesheet" type="text/css" media="screen" href="../css/book_detail.css" />
<script type="text/javascript" src="../js/order-book.js"></script>
</head>
<body>
<div class="detail-container">
<div class="flex-container book-detail">
<div class="flex-1 book-desc">
<div class="orange-text text-size-50" >Judul Buku</div>
<div id="lucu" class="book-author">Pengarang</div>
<div class="text-size-20">Buku ini adalah dsajdjdsfjdsbvfbdhvbfd lorem ipsum dolor sit a</div>
</div>
<div class="add-flex-direction-column book-desc" align="center">
<div class="flex-1">
<img id="book-pict" src="../images/books_picture/4.jpg">
</div>
<div class="rating-pict">
<img class="rating" src="../svgIcon/star-filled.svg">
<img class="rating" src="../svgIcon/star-filled.svg">
<img class="rating" src="../svgIcon/star-filled.svg">
<img class="rating" src="../svgIcon/star-filled.svg">
<img class="rating" src="../svgIcon/star.svg">
</div>
<div class="text-size-20">5.0/5.0</div>
</div>
</div>
<div class="book-detail">
<div class="text-size-30">Order</div>
<div class="order-select">
<label>Jumlah: </label>
<select id="order-qty">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</div>
<div align="right">
<button class="order-button light-blue" onclick="orderBook(1)">Order</button>
</div>
</div>
<div class="book-detail">
<div class="text-size-30">Reviews</div>
<div class="flex-review-tab">
<div>
<img id="profile_pict" src="../images/profiles_picture/baron44.jpg">
</div>
<div class="review-desc">
<div class="text-size-20">@heitayo</div>
<div class="text-size-20">Waw keren juga ya asique. lalal yeye llalala yayayay yeyeyeye. lalal yeye llalala yayayay yeyeyeye. lalal yeye llalala yayayay yeyeyeye</div>
</div>
<div class="add-flex-direction-column">
<img id="star-icon" src="../svgIcon/star-filled.svg">
<div class="text-size-20" align="center">5.0/5.0</div>
</div>
</div>
<div class="flex-review-tab">
<div class="picture">
<img id="profile_pict" src="../images/profiles_picture/baron44.jpg">
</div>
<div class="flex-1 book-desc">
<div class="text-size-20">@heitayo</div>
<div class="text-size-20">Waw keren juga ya asique. lalal</div>
</div>
<div class="add-flex-direction-column">
<img id="star-icon" src="../svgIcon/star-filled.svg">
<div class="rating-numeric text-size-20" align="center">5.0/5.0</div>
</div>
</div>
</div>
</div>
<div id="modal-container"></div>
</body>
</html>
\ No newline at end of file
...@@ -75,10 +75,10 @@ ...@@ -75,10 +75,10 @@
return '/images/books_picture/default.jpg'; return '/images/books_picture/default.jpg';
} }
} else { } else {
if (fileProcessing::isExistProfileImage($input)) { if ($input == "null") {
return fileProcessing::getImageProfilePathFromRoot($input);
} else {
return '/images/profiles_picture/default.jpg'; return '/images/profiles_picture/default.jpg';
} else {
return '/uploads/'.$input;
} }
} }
} }
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<div class="flex-container align-items-flex-start"> <div class="flex-container align-items-flex-start">
<div class="flex-1 flex-review-tab"> <div class="flex-1 flex-review-tab">
<div class="reviewer-profile"> <div class="reviewer-profile">
<img id="profile_pict" src="'.self::showPicture('user', $review['username']).'"> <img id="profile_pict" src="'.self::showPicture('user', $review['profile_picture']).'">
</div> </div>
<div id="comment-user"> <div id="comment-user">
<div id="reviewer">@'.$review['username'].'</div> <div id="reviewer">@'.$review['username'].'</div>
......
...@@ -11,9 +11,10 @@ h1{ ...@@ -11,9 +11,10 @@ h1{
} }
.title-right{ .title-right{
flex-basis: 250px; margin-top: 6%;
margin-top: 5%; margin-left: 15%;
margin-left: 26%; color: #7A7A7A;
/*margin-left: 26%;*/
} }
.title-container{ .title-container{
......
...@@ -41,19 +41,18 @@ function isEmptyRating() { ...@@ -41,19 +41,18 @@ function isEmptyRating() {
} }
function trySubmitSearch() { function trySubmitSearch() {
var valid = true;
if (isEmptyCommentBar()) { if (isEmptyCommentBar()) {
document.getElementById("comment-area").style.display = 'table'; document.getElementById("comment-area").style.display = 'table';
valid = false;
} else {
document.getElementById("comment-area").style.display = 'none';
} }
if (isEmptyRating()) { if (isEmptyRating()) {
document.getElementById("rating-area").style.display = 'table'; document.getElementById("rating-area").style.display = 'table';
valid = false;
} else {
document.getElementById("rating-area").style.display = 'none';
} }
} return valid;
}
document.addEventListener('DOMContentLoaded', function() { \ No newline at end of file
document.getElementById('comment').addEventListener('keypress', function(event) {
if (event.keyCode == 13) {
event.preventDefault();
trySubmitSearch();
}
});
}, false);
\ No newline at end of file
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
if ($conn !== NULL) { if ($conn !== NULL) {
$sql_query = 'INSERT INTO user (name, username, password, email, address, phone, profile_picture) $sql_query = 'INSERT INTO user (name, username, password, email, address, phone, profile_picture)
VALUES ("'. $name . '", "' . $username . '", "' . $password . '", "' VALUES ("'. $name . '", "' . $username . '", "' . $password . '", "'
. $email . '", "' . $address . '", "' . $phonenumber . '", "' . $username . '")'; . $email . '", "' . $address . '", "' . $phonenumber . '", "null")';
$result = $conn->query($sql_query); $result = $conn->query($sql_query);
$conn->close(); $conn->close();
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Book Review</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="../css/header.css">
<link rel="stylesheet" type="text/css" href="../css/color-lib.css">
<link rel="stylesheet" type="text/css" href="../css/basic.css">
<link rel="stylesheet" type="text/css" media="screen" href="../css/review.css" />
<script type="text/javascript" src="../javascript/review-book.js"></script>
</head>
<body>
<div class="detail-container add-nunito-font">
<div class="flex-container book-detail">
<div class="flex-1">
<div class="book-title orange-text"><b>Judul Buku</b></div>
<div class="book-author"><b>Pengarang</b></div>
</div>
<div class="add-flex-direction-column" id="rightbar-pic" align="center">
<div class="flex-1">
<img id="book-pict" src="../images/books_picture/4.jpg">
</div>
</div>
</div>
<form action="submit_review.php" method="POST">
<div class="book-detail">
<div class="head-title">Add Rating</div>
<div class="order-select">
<div class="rating-pict">
<input type="image" id="star1" class="fivestar-rating" onclick="ratingClick(this.value); return false;"
src="../svgIcon/star.png" value="1"
onmouseout="noHoverStar(this.value)" onmouseover="hoverStar(this.value)">
<input type="image" id="star2" class="fivestar-rating" onclick="ratingClick(this.value); return false;"
src="../svgIcon/star.png" value="2"
onmouseout="noHoverStar(this.value)" onmouseover="hoverStar(this.value)">
<input type="image" id="star3" class="fivestar-rating" onclick="ratingClick(this.value); return false;"
src="../svgIcon/star.png" value="3"
onmouseout="noHoverStar(this.value)" onmouseover="hoverStar(this.value)">
<input type="image" id="star4" class="fivestar-rating" onclick="ratingClick(this.value); return false;"
src="../svgIcon/star.png" value="4"
onmouseout="noHoverStar(this.value)" onmouseover="hoverStar(this.value)">
<input type="image" id="star5" class="fivestar-rating" onclick="ratingClick(this.value); return false;"
src="../svgIcon/star.png" value="5"
onmouseout="noHoverStar(this.value)" onmouseover="hoverStar(this.value)">
<!-- Rating value submitted via POST Method-->
<input name="rating-value" id="rating-given" type="hidden" value="0">
<input name="order-id" type="hidden" value="0">
<input name="book-id" type="hidden" value="0">
</div>
</div>
</div>
<div class="book-detail">
<div class="head-title">Add Comment</div>
<div class="flex-review-tab">
<div class="comment-bar">
<textarea id="textarea-comment" name="comment" cols="180" rows="5"></textarea>
</div>
</div>
</div>
<div class="review-button">
<div>
<button class="back-button c-button" type="button" onClick="window.history.back()">Back</button>
<button class="submit-button c-button light-blue" type="submit">Submit</button>
</div>
</div>
</form>
</div>
</body>
</html>
\ No newline at end of file
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
private function showReviewForm($order_id, $book_id) { private function showReviewForm($order_id, $book_id) {
$str = ' $str = '
<form id="book-review" action="review/submit_review.php" method="POST"> <form id="book-review" action="review/submit_review.php" onsubmit="return trySubmitSearch()" method="POST">
<div class="book-detail"> <div class="book-detail">
<div class="head-title">Add Rating</div> <div class="head-title">Add Rating</div>
<div class="order-select">'. <div class="order-select">'.
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="rows"> <div class="rows">
<div class="title-container"> <div class="title-container">
<div class="title-left"><h1>Search Result</h1></div> <div class="title-left"><h1>Search Result</h1></div>
<div class="title-right"><p class="tRight">Found <u>'.$params["item"]->num_rows.'</u> result(s).</p></div> <div class="title-right"><p class="tRight">Found <u>'.$params["item"]->num_rows.'</u> result(s)</p></div>
</div> </div>
'; ';
$end = ' $end = '
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment