-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwork.php
More file actions
144 lines (138 loc) · 5.68 KB
/
work.php
File metadata and controls
144 lines (138 loc) · 5.68 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php if(empty($_GET['workid'])) {header('Location: index.php');}
require_once('structure/header.php');
require_once('treatment/pdo.php');
$id = $_GET['workid'];
$select = "SELECT * FROM oeuvre INNER JOIN icone ON oeuvre.id_icone = icone.id_icone WHERE id_oeuvre = ?;";
$stmt = $connexion->prepare($select);
$stmt->bindParam(1, $id);
$stmt->execute();
$stmt = $stmt->fetch(); ?>
<section id="Presentation">
<h2><?php echo $stmt['title']; ?></h2>
<img src="content/<?php echo $stmt['icone_name']; ?>" alt="<?php echo $stmt['icone_alt']; ?>" class="etat">
<p class="lib_etat"><?php echo $stmt['libelle']; ?></p>
<div id="Premiere_section">
<div id="Commentaire">
<?php if(!empty($stmt['comment'])) {echo $stmt['comment'];} ?>
</div>
<div id="Fiche_info">
<div id="Image">
<?php if(!empty($stmt['media_link'])) { ?>
<a href="<?php echo $stmt['media_link']; ?>" target="_blank" aria-label="Lien pour télécharger les médias du jeu pour la ludothèque"><img src="content/<?php echo $stmt['cover_name']; ?>" alt="Cover art de l'œuvre"></a>
<?php } else { ?>
<img src="content/<?php echo $stmt['cover_name']; ?>" alt="Cover art de l'œuvre">
<?php } ?>
</div>
<?php $select = "SELECT * FROM link_createur
INNER JOIN oeuvre ON link_createur.id_oeuvre = oeuvre.id_oeuvre
INNER JOIN createur ON link_createur.id_createur = createur.id_createur
WHERE link_createur.id_oeuvre = ? ORDER BY role;";
$stmt = $connexion->prepare($select);
$stmt->bindParam(1, $id);
$stmt->execute();
$role = '';
foreach($stmt as $row) {
if($role != $row['role']) {
if($role != '') { ?>
</div>
<?php }
$role = $row['role']; ?>
<div>
<p><?php echo $row['role']; ?> :</p>
<?php } ?>
<p><a href="creator.php?creatorid=<?php echo $row['id_createur']; ?>"><?php echo $row['name']; ?></a></p>
<?php } ?>
</div>
<div>
<p>Date de sortie :</p>
<?php $select = "SELECT DATE_FORMAT(date_sortie, '%d/%m/%Y') AS date_format, version
FROM date_info WHERE id_oeuvre = ? ORDER BY date_sortie;";
$stmt = $connexion->prepare($select);
$stmt->bindParam(1, $id);
$stmt->execute();
foreach($stmt as $row) { ?>
<p><?php echo $row['date_format']; ?> (<?php echo $row['version']; ?>)</p>
<?php } ?>
</div>
<?php $select = "SELECT * FROM link_categorie
INNER JOIN oeuvre ON link_categorie.id_oeuvre = oeuvre.id_oeuvre
WHERE link_categorie.id_oeuvre = ? ORDER BY category;";
$stmt = $connexion->prepare($select);
$stmt->bindParam(1, $id);
$stmt->execute();
if(!empty($stmt)) { ?>
<div>
<p>Catégorie :</p>
<?php foreach($stmt as $row) { ?>
<p><?php echo $row['category']; ?></p>
<?php } ?>
</div>
<?php } ?>
<div>
<p>Acquisition :</p>
<?php $select = "SELECT * FROM link_icone
INNER JOIN oeuvre ON link_icone.id_oeuvre = oeuvre.id_oeuvre
INNER JOIN icone ON link_icone.id_icone = icone.id_icone
WHERE link_icone.id_oeuvre = ?;";
$stmt = $connexion->prepare($select);
$stmt->bindParam(1, $id);
$stmt->execute();
foreach($stmt as $row) { ?>
<a href="<?php echo $row['page_link']; ?>" target="_blank" aria-label="Bouton vers la page <?php echo $row['icone_alt']; ?> du jeu"><img src="content/<?php echo $row['icone_name']; ?>" alt="Logo de <?php echo $row['icone_alt']; ?>"></a>
<?php } ?>
</div>
</div>
</div>
</section>
<?php $select = "SELECT * FROM section WHERE id_oeuvre = ? ORDER BY section_rank;";
$stmt1 = $connexion->prepare($select);
$stmt1->bindParam(1, $id);
$stmt1->execute();
if(!empty($stmt1)) {
foreach($stmt1 as $section) { ?>
<section id="<?php echo $section['section_link']; ?>">
<h2><?php echo $section['section_title']; ?></h2>
<?php if($section['section_title'] != 'Trivia') {
echo $section['resume'];
}
$id_section = $section['id_section'];
$select = "SELECT * FROM element
INNER JOIN icone ON element.id_icone = icone.id_icone
WHERE id_section = ? ORDER BY elt_rank;";
$stmt2 = $connexion->prepare($select);
$stmt2->bindParam(1, $id_section);
$stmt2->execute();
if(!empty($stmt2)) {
foreach($stmt2 as $element) { ?>
<section>
<?php if(!empty($element['elt_link'])) { ?>
<h3><a href="<?php echo $element['elt_link']; ?>" target="_blank"><?php echo $element['elt_title']; ?></a></h3>
<?php } else { ?>
<h3><?php echo $element['elt_title']; ?></h3>
<?php }
if($section['section_link'] != 'Trivia' && $section['section_link'] != 'Fanmade') { ?>
<img src="content/<?php echo $element['icone_name']; ?>" alt="<?php echo $element['icone_alt']; ?>" class="etat">
<p class="lib_etat"><?php echo $element['libelle']; ?></p>
<?php }
echo $element['elt_resume'];
$id_elt = $element['id_elt'];
$select = "SELECT * FROM image WHERE id_elt = ?;";
$stmt3 = $connexion->prepare($select);
$stmt3->bindParam(1, $id_elt);
$stmt3->execute();
if(!empty($stmt3)) {
foreach($stmt3 as $image) {
if(!empty($image['img_link'])) { ?>
<a href="<?php echo $image['img_link']; ?>" target="_blank" aria-label="<?php echo $image['aria_label']; ?>"><img src="content/<?php echo $image['img_name']; ?>" alt="<?php echo $image['img_alt']; ?>"></a>
<?php } else { ?>
<img src="content/<?php echo $image['img_name']; ?>" alt="<?php echo $image['img_alt']; ?>">
<?php }
}
} ?>
</section>
<?php }
} ?>
</section>
<?php }
} ?>
<?php require_once('structure/footer.php'); ?>