Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
IF3110-2018-K03-Petjah
TugasBesar1_2018
Commits
cd2e8206
Commit
cd2e8206
authored
Oct 24, 2018
by
Ranindya Paramitha
Browse files
Merge branch 'master' of
http://gitlab.informatika.org/IF3110-2018-K03-Petjah/tugasbesar1_2018
parents
ed43e794
8a340399
Changes
28
Hide whitespace changes
Inline
Side-by-side
web/basic/fileProcessing.php
View file @
cd2e8206
...
...
@@ -3,11 +3,11 @@
class
fileProcessing
{
public
const
PROFILE_DEFAULT
=
'default.jpg'
;
public
static
function
isExistBookImage
(
string
$name
):
bool
{
public
static
function
isExistBookImage
(
$name
):
bool
{
return
file_exists
(
'../images/books_picture/'
.
$name
.
'.jpg'
);
}
public
static
function
isExistProfileImage
(
string
$name
):
bool
{
public
static
function
isExistProfileImage
(
$name
):
bool
{
return
file_exists
(
'../uploads/'
.
$name
.
'.jpg'
);
}
...
...
web/basic/header.php
View file @
cd2e8206
...
...
@@ -79,7 +79,11 @@ class Header {
</a>
</div>
<div class="left-right-border orange-background flex-1 ">
<span class="text-size-40">H</span>ISTORY
<a href="'
.
self
::
URL_HISTORY
.
'">
<div>
<span class="text-size-40">H</span>ISTORY
</div>
</a>
</div>
<div class="flex-1 ">
<a href="'
.
self
::
URL_PROFILE
.
'">
...
...
@@ -95,7 +99,11 @@ class Header {
return
'
<div class="flex-container-menu">
<div class="orange-background flex-1 ">
<span class="text-size-40">B</span>ROWSE
<a href="'
.
self
::
URL_BROWSE
.
'">
<div>
<span class="text-size-40">B</span>ROWSE
</div>
</a>
</div>
<div class="left-right-border flex-1 ">
<a href="'
.
self
::
URL_HISTORY
.
'">
...
...
@@ -132,7 +140,11 @@ class Header {
</a>
</div>
<div class="orange-background flex-1 ">
<span class="text-size-40">P</span>ROFILE
<a href="'
.
self
::
URL_PROFILE
.
'">
<div>
<span class="text-size-40">P</span>ROFILE
</div>
</a>
</div>
</div>'
;
}
...
...
web/book_detail/controller.php
View file @
cd2e8206
...
...
@@ -3,14 +3,16 @@
require
(
'view.php'
);
class
bookDetailController
{
private
$username
;
private
$book_id
;
private
$book_detail
;
private
$reviews
;
private
$book_rating
;
private
$fetchsuccess
=
TRUE
;
public
function
__construct
(
$book_id
)
{
public
function
__construct
(
$book_id
,
$username
)
{
$this
->
book_id
=
$book_id
;
$this
->
username
=
$username
;
$this
->
fetchBookDetails
();
$this
->
fetchReviews
();
$this
->
fetchRating
();
...
...
@@ -18,21 +20,13 @@
public
function
showBookDetail
()
{
if
(
$this
->
fetchsuccess
)
{
/*if (isLogin()) {
$user_token = getTokenLogin();
$user = getUserInfo(getUserIDbyToken($user_token));*/
$params
=
[
'username'
=>
'ermaer'
,
//'username' => $user['username'],
'book_detail'
=>
$this
->
book_detail
,
'reviews'
=>
$this
->
reviews
,
'book_rating'
=>
$this
->
book_rating
];
bookDetailViewer
::
viewBookDetail
(
$params
);
/*} else {
$login = '../login';
header('Location: '.$login);
}*/
$params
=
[
'username'
=>
$this
->
username
,
'book_detail'
=>
$this
->
book_detail
,
'reviews'
=>
$this
->
reviews
,
'book_rating'
=>
$this
->
book_rating
];
bookDetailViewer
::
viewBookDetail
(
$params
);
}
else
{
include
(
'../404.html'
);
}
...
...
web/book_detail/index.php
View file @
cd2e8206
<?php
require
(
'controller.php'
);
if
(
isset
(
$_GET
[
'id'
]))
{
$book_id
=
$_GET
[
'id'
];
$bookDetail
=
new
bookDetailController
(
$book_id
);
$bookDetail
->
showBookDetail
();
if
(
isLogin
())
{
$user_token
=
getTokenLogin
();
$user
=
getUserInfo
(
getUserIDbyToken
(
$user_token
));
if
(
isset
(
$_GET
[
'id'
]))
{
$book_id
=
$_GET
[
'id'
];
$bookDetail
=
new
bookDetailController
(
$book_id
,
$user
[
'username'
]);
$bookDetail
->
showBookDetail
();
}
else
{
include
(
'../404.html'
);
}
}
else
{
include
(
'../404.html'
);
}
$login
=
'../login'
;
header
(
'Location: '
.
$login
);
}
?>
\ No newline at end of file
web/css/book_detail.css
View file @
cd2e8206
...
...
@@ -34,15 +34,13 @@
}
.order-button
{
width
:
100px
;
display
:
inline-block
;
padding
:
8px
16px
;
vertical-align
:
middle
;
text-align
:
center
;
cursor
:
pointer
;
white-space
:
nowrap
;
background-color
:
#fff
;
font-size
:
20px
;
float
:
right
;
margin-bottom
:
100px
;
padding
:
5px
30px
;
font-size
:
25px
;
background-color
:
dodgerblue
;
color
:
white
;
border-radius
:
4px
;
}
.order-button
:hover
{
background-color
:
#3e8e41
}
...
...
web/css/review.css
View file @
cd2e8206
...
...
@@ -4,11 +4,12 @@
font-size
:
28px
;
font-family
:
'Nunito'
,
sans-serif
;
margin-block-end
:
40px
;
padding
:
5px
;
}
.fivestar-rating
{
max-width
:
6
0px
;
max-height
:
6
0px
;
max-width
:
9
0px
;
max-height
:
9
0px
;
cursor
:
pointer
;
}
...
...
web/database/accessDB.php
View file @
cd2e8206
...
...
@@ -205,4 +205,20 @@
function
getTokenLogin
()
{
return
$_COOKIE
[
"login"
];
}
function
selectFromWhere
(
$attr
,
$table
,
$wherecondition
)
{
$conn
=
connect_to_mysql
();
$listofattr
=
[];
if
(
$conn
!==
NULL
){
$sql_query
=
"SELECT "
.
$attr
.
" FROM "
.
$table
.
" WHERE "
.
$wherecondition
;
$result
=
$conn
->
query
(
$sql_query
);
if
(
$result
!=
NULL
){
while
(
$row
=
$result
->
fetch_assoc
())
{
$listofattr
[]
=
$row
[
$attr
];
}
}
$conn
->
close
();
}
return
$listofattr
;
}
?>
\ No newline at end of file
web/images/books_picture/1.jpg
→
web/images/books_picture/
20
1.jpg
View file @
cd2e8206
File moved
web/images/books_picture/2.jpg
→
web/images/books_picture/2
02
.jpg
View file @
cd2e8206
File moved
web/images/books_picture/3.jpg
→
web/images/books_picture/
20
3.jpg
View file @
cd2e8206
File moved
web/images/books_picture/4.jpg
→
web/images/books_picture/
20
4.jpg
View file @
cd2e8206
File moved
web/images/books_picture/5.jpg
→
web/images/books_picture/
20
5.jpg
View file @
cd2e8206
File moved
web/images/books_picture/6.jpg
→
web/images/books_picture/
20
6.jpg
View file @
cd2e8206
File moved
web/images/books_picture/7.jpg
→
web/images/books_picture/
20
7.jpg
View file @
cd2e8206
File moved
web/images/books_picture/8.jpg
→
web/images/books_picture/
20
8.jpg
View file @
cd2e8206
File moved
web/images/books_picture/9.jpg
→
web/images/books_picture/
20
9.jpg
View file @
cd2e8206
File moved
web/images/books_picture/10.jpg
→
web/images/books_picture/
2
10.jpg
View file @
cd2e8206
File moved
web/images/books_picture/213.jpg
0 → 100644
View file @
cd2e8206
22.7 KB
web/images/books_picture/214.jpg
0 → 100644
View file @
cd2e8206
35.7 KB
web/javascript/review-book.js
View file @
cd2e8206
...
...
@@ -12,6 +12,7 @@ function ratingClick(starValue) {
}
}
document
.
getElementById
(
"
rating-given
"
).
value
=
starValue
;
document
.
getElementById
(
"
output
"
).
innerHTML
=
document
.
getElementById
(
"
rating-given
"
).
value
;
}
function
hoverStar
(
starValue
)
{
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
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