Commit 9b0a2abf authored by Wildan Dicky Alnatara's avatar Wildan Dicky Alnatara
parents e92a58b5 40564ff4
This diff is collapsed.
<!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 @@
return '/images/books_picture/default.jpg';
}
} else {
if (fileProcessing::isExistProfileImage($input)) {
return fileProcessing::getImageProfilePathFromRoot($input);
} else {
if ($input == "null" || $input == NULL || !fileProcessing::isExistProfileImage($input)) {
return '/images/profiles_picture/default.jpg';
} else {
return '/uploads/'.$input;
}
}
}
......@@ -118,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('user', $review['username']).'">
<img id="profile_pict" src="'.self::showPicture('user', $review['profile_picture']).'">
</div>
<div id="comment-user">
<div id="reviewer">@'.$review['username'].'</div>
......
......@@ -4,7 +4,7 @@
}
.left2{
flex-basis: 28%;
padding-left: 20px;
/* padding-left: 1.5%; */
padding-top: 2.5%;
}
......@@ -14,16 +14,17 @@ h1 {
.right{
flex-basis: 90%;
width: fit-content;
align-content: left;
padding-left: 5%;
margin-top: 2.5%;
padding-right: 9%;
padding-right: 5%;
}
.right2{
flex-basis: 72%;
align-content: left;
padding-right: 15%;
/* padding-right: 5%; */
padding-top: 30px;
}
......@@ -36,9 +37,10 @@ h1 {
.cols{
display: flex;
width: fit-content;
flex-wrap: wrap;
flex-direction: column;
margin-left: 100px;
padding-left: 50px;
}
.rows1{
display: flex;
......@@ -53,13 +55,13 @@ h1 {
display: flex;
flex-wrap: nowrap;
flex-direction: row;
margin-left: 100px;
padding-left: 150px;
justify-content: space-around;
height:80px;
}
.rows{
margin-left: 100px;
padding-left: 150px;
display: flex;
flex-wrap: nowrap;
flex-direction: row;
......@@ -79,8 +81,13 @@ h1 {
}
.right_button{
flex-basis: 350px;
margin-right: 120px;
margin-right: 20px;
}
#address {
font-family: 'Arial';
}
.upload-btn-wrapper {
position: relative;
margin-left: 10px;
......@@ -95,14 +102,16 @@ h1 {
padding: 8px 10px;
border-radius: 8px;
font-size: 20px;
width: fit-content;
}
.upload-btn-wrapper input[type=file] {
font-size: 50px;
position: absolute;
width: fit-content;
left: 0;
top: 0;
opacity: 0;
opacity: 00;
}
#profpict_dummy{
......@@ -128,8 +137,9 @@ input[type=file]{
color: transparent;
}
.profpict_dummy{
#profpict_dummy{
width: 500px;
margin-left: 0;
}
input[type=text]{
......@@ -138,10 +148,14 @@ input[type=text]{
font-weight: 500;
letter-spacing: 1px;
font-size: 32px;
margin-left: 50px;
padding-left: 10px;
}
textarea{
width: 625px;
margin-left: 50px;
padding-left: 10px;
font-size: 32px;
}
......@@ -175,14 +189,17 @@ textarea{
#warning-1{
visibility: hidden;
width: 625px;
width: 620px;
margin-left: 50px;
}
#warning-2{
visibility: hidden;
width: 625px;
width: 620px;
margin-left: 50px;
}
#warning-3{
visibility: hidden;
width: 625px;
width: 620px;
margin-left: 50px;
}
......@@ -15,6 +15,7 @@
.history-image-item {
height: 200px;
width: 200px;
border: 2px solid black;
}
#label-history {
......
......@@ -70,4 +70,5 @@ input, textarea {
color: orange;
font-weight: bold;
letter-spacing: 2px;
cursor: pointer;
}
\ No newline at end of file
.book-detail {
margin-block-end: 50px;
}
.textarea-comment {
width: 100%;
font-size: 28px;
......@@ -6,12 +10,18 @@
resize: none;
}
.warning-empty-inputs {
position: relative;
.warning-empty-input {
display: none;
position: absolute;
}
#rating-area {
text-align: center;
}
.comment-bar {
margin-block-end: 50px;
width: 100%;
}
.fivestar-rating {
......
......@@ -11,9 +11,10 @@ h1{
}
.title-right{
flex-basis: 250px;
margin-top: 5%;
margin-left: 26%;
margin-top: 6%;
margin-left: 15%;
color: #7A7A7A;
/*margin-left: 26%;*/
}
.title-container{
......@@ -54,6 +55,19 @@ img{
height: 150px;
width: 150px;
}
.pp {
border: 2px solid black;
}
button {
cursor: pointer;
}
.button_row {
font-size: 25px;
}
h3{
color: #F16303;
word-wrap: normal;
......
......@@ -22,11 +22,11 @@
}
// echo $update_name;
$update = setUserProfile($user_id, $update_name, $update_address, $update_phone, $name, $tmp_name);
if ($update == 0){
echo "<script type='text/javascript'>alert 'Update Failed';</script>";
} else{
echo "<script type='text/javascript'>alert 'Update Success';</script>";
}
// if ($update == 0){
// echo "<script type='text/javascript'>alert 'Update Failed';</script>";
// } else{
// echo "<script type='text/javascript'>alert 'Update Success';</script>";
// }
header('Location: ../profile');
exit;
?>
\ No newline at end of file
......@@ -48,7 +48,7 @@
<div class="flex-container">
<input id="profpict_dummy" class="profpict_dummy"type="text" name="profile_picture2" readonly>
<div class="upload-btn-wrapper">
<button class="btn">Browse ...</button>
<button class="btn">Browse...</button>
<input id="profpict" type="file" name="profile_picture" accept="image/png, image/jpg, image/jpeg" onchange="showname()" >
</div>
</div>
......
......@@ -71,6 +71,9 @@ function validateForm(){
// alert(false);
if (isNameEmpty == true){
document.getElementById("warning-1").style.visibility = 'visible';
} else if (isNameTooLong == true){
document.getElementById("warning-1").style.visibility = 'visible';
document.getElementById("warning-1").innerHTML = 'Name must be under 20 characters.';
}
if (isAddressEmpty == true){
document.getElementById("warning-2").style.visibility = 'visible';
......
......@@ -12,6 +12,7 @@ function ratingClick(starValue) {
}
}
document.getElementById("rating-given").value = starValue;
document.getElementById("rating-area").style.display = 'none';
}
function hoverStar(starValue) {
......@@ -31,24 +32,27 @@ function noHoverStar(starValue) {
}
}
function IsEmptyCommentBar() {
function isEmptyCommentBar() {
return document.getElementById('comment').value === "";
}
function isEmptyRating() {
return document.getElementById("rating-given").value == 0;
}
function trySubmitSearch() {
if (IsEmptyCommentBar()) {
document.getElementById("warning-empty-input").style.display = 'table';
var valid = true;
if (isEmptyCommentBar()) {
document.getElementById("comment-area").style.display = 'table';
valid = false;
} else {
document.getElementById('book-review').submit();
document.getElementById("comment-area").style.display = 'none';
}
}
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('comment').addEventListener('keypress', function(event) {
if (event.keyCode == 13) {
event.preventDefault();
trySubmitSearch();
}
});
}, false);
\ No newline at end of file
if (isEmptyRating()) {
document.getElementById("rating-area").style.display = 'table';
valid = false;
} else {
document.getElementById("rating-area").style.display = 'none';
}
return valid;
}
\ No newline at end of file
......@@ -22,7 +22,7 @@
if ($conn !== NULL) {
$sql_query = 'INSERT INTO user (name, username, password, email, address, phone, profile_picture)
VALUES ("'. $name . '", "' . $username . '", "' . $password . '", "'
. $email . '", "' . $address . '", "' . $phonenumber . '", "' . $username . '")';
. $email . '", "' . $address . '", "' . $phonenumber . '", "null")';
$result = $conn->query($sql_query);
$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 @@
private function showReviewForm($order_id, $book_id) {
$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="head-title">Add Rating</div>
<div class="order-select">'.
......@@ -65,8 +65,8 @@
<div class="flex-review-tab">
<div class="comment-bar">
<textarea id="comment" class="textarea-comment" name="comment" cols="180" rows="5"></textarea>
<span id="warning-empty-input" class="red-theme alert-box text-size-20 add-nunito-font c-round">
Input can\'t be empty</span>
<p id="comment-area" class="warning-empty-input red-theme alert-box text-size-20 add-nunito-font c-round">
Input can\'t be empty</p>
</div>
</div>
</div>
......@@ -84,7 +84,9 @@
$str = '
<div class="rating-pict">'.
self::show5Stars().
'</div>';
'<p id="rating-area" class="warning-empty-input red-theme alert-box text-size-20 add-nunito-font c-round">
Rating can\'t be empty</p>
</div>';
return $str;
}
......
......@@ -15,7 +15,7 @@
<div class="rows">
<div class="title-container">
<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>
';
$end = '
......@@ -64,7 +64,7 @@
</div>
</div>
<div class="button_row">
<button type="button" class="text-size-30 add-nunito-font light-blue c-round" onclick="location.href=\'../book_detail?id='.$id.'\';">Detail</button>
<button type="button" class="add-nunito-font light-blue c-round" onclick="location.href=\'../book_detail?id='.$id.'\';">Detail</button>
</div>
';
$i += 1;
......
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