Commit d9028e07 authored by Ranindya Paramitha's avatar Ranindya Paramitha
Browse files

[FIXING] commit stage

parents 82ff275c a5e11433
......@@ -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('books','../images/books_picture/4.jpg').'">
<img id="book-pict" src="'.self::showPicture('books','../images/books_picture/default.jpg').'">
</div>
<div class="rating-pict">'.
self::drawRating($book_rating).
......@@ -81,13 +81,9 @@
<div class="head-title">Order</div>
<div class="order-select">
<label>Jumlah: </label>
<select id="dropdown-order">
<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>
<select id="dropdown-order">'.
self::generateDropdown().
'</select>
</div>
<div align="right">
<button class="order-button c-button light-blue" type="button" onclick="orderBook(1)">Order</button>
......@@ -111,13 +107,15 @@
$str = '';
foreach ($reviews as $review) {
$str_review = '
<div class="flex-review-tab">
<div>
<img id="profile_pict" src="'.self::showPicture('profiles',$review['profile_picture']).'">
</div>
<div id="comment-user">
<div id="reviewer">@'.$review['username'].'</div>
<div id="detail-paragraph">'.$review['komentar'].'</div>
<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_picture']).'">
</div>
<div id="comment-user">
<div id="reviewer">@'.$review['username'].'</div>
<div id="detail-paragraph">'.$review['komentar'].'</div>
</div>
</div>
<div class="add-flex-direction-column">
<div> <img id="star-icon" src="../svgIcon/'.self::STAR_FULL_IMG.'">
......@@ -137,5 +135,13 @@
private function showModal() {
return '<div id="modal-container"></div>';
}
private function generateDropdown() {
$str = "";
for ($i=1; $i<=50; $i++) {
$str .= '<option value="'.$i.'">'.$i.'</option>';
}
return $str;
}
}
?>
\ No newline at end of file
......@@ -3,17 +3,16 @@
require ('view_modal.php');
//check login state
//if (isLogin()) {
// $user_token = getTokenLogin();
// $user_id = getUserInfo(getUserIDbyToken($user_token))
$user_id = 1;
if (isLogin()) {
$user_token = getTokenLogin();
$user = getUserInfo(getUserIDbyToken($user_token));
$book_id = $_GET['book_id'];
$quantity = $_GET['qty'];
//$orderstatus = createNewOrder($book_id, $user_id, $quantity);
$order_id = 100;
$order_id = createNewOrder($book_id, $user['ID'], $quantity);
//$order_id = 100; //dummy
showOrderModal($order_id);
///}
}
function createNewOrder($book_id, $user_id, $quantity) {
$conn = connect_to_mysql();
......@@ -24,12 +23,13 @@
. $book_id . '", "' . $user_id . '")';
$result = $conn->query($sql_query);
$sql_query = 'SELECT * FROM files WHERE id = SCOPE_IDENTITY()';
$result = $conn->query($sql_query);
$order_id = $result->fetch_assoc();
if ($result != NULL) {
$order_id = mysqli_insert_id($conn);
} else {
$order_id = NULL;
}
$conn->close();
return $order_id['Nomor_Order'];
return $order_id;
} else {
return NULL;
}
......
......@@ -23,7 +23,7 @@
}
return '
<div class="flex-container">
<div class="modal-message">
<div><img id="mark-icon" src="../svgIcon/black-'.$mark.'.png"></div>
<div>
<div id="check-description"><b>'.$mesg.'</b></div>
......
......@@ -166,6 +166,9 @@ a {
margin-bottom: 1px;
}
#warning-empty-input {
display: none;
}
/*Book Detail*/
.head-title {
......@@ -192,6 +195,7 @@ a {
.title-author {
font-family: 'Nunito Bold', sans-serif;
margin-block-end: 35px;
}
.book-desc {
......@@ -200,7 +204,6 @@ a {
.book-desc > div {
width: 100%;
margin-block-end: 35px;
}
.book-author {
......@@ -213,7 +216,7 @@ a {
max-height: 170px;
border: black;
border-style: solid;
border-width: 1px;
border-width: 2px;
}
#rightbar-pic {
......
.flex-container > div {
margin-block-end: 30px;
}
#detail-paragraph {
font-size: 23;
opacity: 0.8;
......@@ -5,23 +9,23 @@
#comment-user > div{
margin-block-end: 5px;
width: 100%;
}
#profile_pict {
max-width: 100px;
max-height: 100px;
width: 100px;
height: 100px;
border: black;
border-style: solid;
border-width: 2px;
}
.flex-review-tab {
width: 100%;
display: flex;
}
.flex-review-tab > div {
margin-right: 20px;
margin-right: 30px;
}
.rating {
......@@ -34,8 +38,7 @@
}
.order-button {
float: right;
margin-bottom: 100px;
margin-top: 20px;
padding: 5px 30px;
font-size: 25px;
background-color: dodgerblue;
......@@ -43,13 +46,6 @@
border-radius: 4px;
}
.order-button:hover {background-color: #3e8e41}
.order-button:active {
box-shadow: 0 5px #666;
transform: translateY(4px);
}
.order_select {
font-size: 20px;
}
......@@ -59,10 +55,17 @@ label {
}
#dropdown-order {
position: relative;
width: 70px;
height: 30px;
margin-left: 10px;
font-size: 20px;
font-weight: bold;
border: 2px solid #484848;
border-radius: 5px;
margin: 5px 10px;
padding: 0px 15px;
}
#mark-icon {
......@@ -81,6 +84,11 @@ label {
margin-block-end: 20px;
}
.reviewer-profile {
height: 100px;
width: 100;
}
/* Notification Modal */
/* The Modal (background) */
.modal {
......@@ -102,12 +110,18 @@ label {
.modal-content {
background-color: #fefefe;
margin: auto;
padding: 30px;
border: 1px solid #888;
width: 30%;
width: 40%;
font-size: 20px;
padding-top: 40px;
padding-bottom: 40px;
}
.modal-message {
display: flex;
height: 15%;
margin-top: 40px;
margin-bottom: 40px;
margin-left: 40px;
margin-right: 40px;
}
/* The Close Button */
......@@ -116,6 +130,7 @@ label {
float: right;
font-size: 30px;
font-weight: bold;
margin-right: 10px;
}
.close:hover,
......
......@@ -23,8 +23,4 @@
#submit-button {
padding: 4px 48px !important;
}
#warning-empty-input {
display: none;
}
\ No newline at end of file
......@@ -3,7 +3,6 @@
resize: none;
font-size: 28px;
font-family: 'Nunito', sans-serif;
margin-block-end: 40px;
padding: 5px;
}
......
<<<<<<< HEAD
<?php
require_once ("../autoload.php");
require_once("controller.php");
......@@ -29,4 +30,37 @@
}
header('Location: ../profile');
exit;
=======
<?php
require_once ("../autoload.php");
require_once("controller.php");
$user_token = $_COOKIE["login"];
$user_id = getUserIDbyToken($user_token);
echo "MASUK";
$update_name = $_POST["name"];
$update_address = $_POST["address"];
$update_phone = $_POST["phone"];
if (isset($_POST['submit'])){
// echo "MASUK SINI";
if(isset($_FILES["profile_picture"])){
$name = $_FILES["profile_picture"]["name"];
$tmp_name = $_FILES["profile_picture"]["tmp_name"];
} else{
$name = NULL;
$tmp_name = NULL;
}
} else{
$name = NULL;
$tmp_name = NULL;
}
// 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>";
// }
header('Location: ../profile');
exit;
>>>>>>> a5e114334a5152889bf7f3a02a656fb764097ebc
?>
\ No newline at end of file
......@@ -12,7 +12,6 @@ function ratingClick(starValue) {
}
}
document.getElementById("rating-given").value = starValue;
document.getElementById("output").innerHTML = document.getElementById("rating-given").value;
}
function hoverStar(starValue) {
......
......@@ -20,9 +20,9 @@
function insertNewUser($name, $username, $password, $email, $address, $phonenumber) {
$conn = connect_to_mysql();
if ($conn !== NULL) {
$sql_query = 'INSERT INTO user (name, username, password, email, address, phone)
$sql_query = 'INSERT INTO user (name, username, password, email, address, phone, profile_picture)
VALUES ("'. $name . '", "' . $username . '", "' . $password . '", "'
. $email . '", "' . $address . '", "' . $phonenumber . '")';
. $email . '", "' . $address . '", "' . $phonenumber . '", "' . $username . '")';
$result = $conn->query($sql_query);
$conn->close();
......
......@@ -10,5 +10,5 @@
$phonenumber= $_POST["phonenumber"];
insertNewUser($name, $username, $password, $email, $address, $phonenumber);
login();
login($username);
?>
\ No newline at end of file
......@@ -6,18 +6,18 @@
$user_token = getTokenLogin();
$user = getUserInfo(getUserIDbyToken($user_token));
//if (isset($_GET['id'])) {
//$order_id = $_GET['id'];
$order_id = 301; //dummy
if (isset($_GET['id'])) {
$order_id = $_GET['id'];
//$order_id = 301; //dummy
if (reviewController::validateOrderHistory($order_id, $user['ID'])) {
$review = new reviewController($order_id, $user['username']);
$review->showReviewForm();
} else {
include ('../404.html');
}
//} else {
// include ('../404.html');
//}
} else {
include ('../404.html');
}
} else {
$login = '../login';
header('Location: '.$login);
......
......@@ -7,7 +7,7 @@
$order_id = $_POST['order-id'];
$insertsuccess = insertReview($order_id, $rating, $comment);
include('../history');
header("Location: ../history");
function insertReview($order_id, $rating, $comment) {
$conn = connect_to_mysql();
......
......@@ -36,8 +36,7 @@
</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">
<p id="output"></p>
<img id="book-pict" src="../images/books_picture/default.jpg">
</div>
</div>
</div>';
......@@ -59,6 +58,7 @@
<div class="flex-review-tab">
<div class="comment-bar">
<textarea id="textarea-comment" name="comment" cols="180" rows="5"></textarea>
<p id="warning-empty-input" class="red-theme alert-box text-size-20 add-nunito-font c-round">Input can\'t be empty</p>
</div>
</div>
</div>
......
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<svg viewBox="0 0 17 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="si-glyph si-glyph-mail">
<!-- Generator: Sketch 3.0.3 (7891) - http://www.bohemiancoding.com/sketch -->
<title>1001</title>
<defs></defs>
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M16.304,3.059 L1.701,3.059 C1.344,3.059 1.053,3.35 1.053,3.707 L1.053,12.324 C1.053,12.681 1.344,12.972 1.701,12.972 L16.304,12.972 C16.662,12.972 16.953,12.681 16.953,12.324 L16.953,3.707 C16.953,3.35 16.662,3.059 16.304,3.059 L16.304,3.059 Z M14.906,12.046 L12.022,8.643 L9.013,11.188 L5.955,8.57 L3.093,12.047 L1.847,12.047 L5.036,7.694 L1.966,5.094 L1.937,3.813 L9.013,9.344 L16.062,3.724 L16.062,5.094 L13.045,7.694 L16.169,12.032 L14.906,12.046 L14.906,12.046 Z" fill="#000000" class="si-glyph-fill"></path>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 48 48" enable-background="new 0 0 48 48" xml:space="preserve">
<path fill="#FFCA28" d="M24,13l2.9,5.9l0.9,1.9l2.1,0.3l6.5,0.9l-4.7,4.6l-1.5,1.5l0.4,2.1l1.1,6.5l-5.8-3.1l-1.9-1l-1.9,1l-5.8,3.1
l1.1-6.5l0.4-2.1l-1.5-1.5l-4.7-4.6l6.5-0.9l2.1-0.3l0.9-1.9L24,13 M24,4l-6.5,13.2L3,19.3l10.5,10.2L11,44l13-6.8L37,44l-2.5-14.5
L45,19.3l-14.5-2.1L24,4L24,4z"/>
</svg>
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