-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbodyparts.php
53 lines (45 loc) · 1.76 KB
/
bodyparts.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
session_start();
require_once "brainz/dbconnect.php";
require_once "brainz/sessionhandler.php";
if($_SESSION['is_login'] !== true){
header("Location: login.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Page</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/navbar.css">
</head>
<body>
<div class="topnav"> <!--navbar kita ini-->
<a class="active" href="home.php">SignOut</a>
<a href="bodyparts.php">BodyParts</a>
<a href="offer.php">Auction Register</a>
<a href="offerAudit.php">Auction Audit</a>
</div>
<div>
<?php
$quer = "SELECT u.username, b.title, b.description, b.price, b.attachment
FROM bodyparts b
JOIN users u ON b.userID = u.userID
WHERE b.userID = u.userID";
$result = $conn->query($quer);
if ($result->num_rows > 0){
while($row = $result->fetch_assoc()) {
echo "<header class='title'>Seller: " . $row['username'] . "</header>";
echo "<header class='title'>Bodypart: " . $row['title'] . "</header>";
echo "<div class='card-content'>";
echo "<div class='innern'>Description: " . $row['description'] . "</div>";
echo "<div class='innern'>Price: " . $row['price'] . "</div>";
echo "<div class='inner'>" . "<img src=\"" . $row['attachment'] . "\" alt=\"attachment\" style=\"max-width:100%; height:auto;\">" . "</div>";
}
}
?>
</div>
</body>
</html>