-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetails.php
60 lines (55 loc) · 2.63 KB
/
details.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
52
53
54
55
56
57
58
59
60
<!doctype html>
<html lang="en">
<head>
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon">
<link rel="icon" href="./favicon.ico" type="image/x-icon">
<meta name="title" content="Crusaders Gallery">
<meta name="description" content="The online presence of the Crusaders Gallery, based in Hanover. ">
<meta name="keywords" content="art, gallery, crusaders gallery, hannover, hanover, paintings, shop, online shop">
<meta name="robots" content="index, follow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="English">
<meta name="author" content="--">
<title>Details</title>
<link rel="stylesheet" href="styleindex.css">
</head>
<body>
<header>
<?php include_once("header.php"); ?>
</header>
<nav>
<?php include_once("nav.php"); ?>
</nav>
<section>
<div>
<?php
include_once('connection.php'); //connects SQL-DB
include_once('session.php'); //starts SESSION
$detItems = isset($_POST['products_id']) ? $_POST['products_id'] : [];
$sql = "SELECT products.id AS prod_id, products.*, artist.*, artist.description AS artistdesc, medium.materials, style.style_name, img.*
FROM products
LEFT JOIN artist ON products.artist = artist.id
LEFT JOIN medium ON products.medium = medium.id
LEFT JOIN style ON products.style = style.id
LEFT JOIN img ON products.id = img.id
WHERE products.id = {$detItems}";
$prod = get_products($sql); //retrieve data from multiple tables.
//only for elements in array that was passed by card.php
$product = $prod->fetch(PDO::FETCH_ASSOC) ?> <!--display data -->
<h1><u><?php echo $product['title']; ?></u></h1><br>
<p class="details">
by <?=$product['name']?> (*<?=$product['birthyear']?>)
</p><br>
<img style="margin-right:auto; margin-left:auto; display:block; height:auto; width:50%;" src="./images/<?= $product['source'] ?>" title="'<?= $product['title']?>'" alt="<?=$product['alt']?>"><br>
<p class="details">
<b>Size:</b> <?=$product['size']?>cm<br><br>
<b>Materials:</b> <?=$product['materials']?><br><br>
<b>Style:</b> <?=$product['style_name']?><br><br>
<b>About the Artist:</b> <?=$product['artistdesc']?><br>
</p>
</div>
</section>
<footer>
<?php include_once("footer.php"); ?>
</footer>
</body>