-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstructeur.php
69 lines (57 loc) · 2.71 KB
/
constructeur.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
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Liste des Constructeurs et Voitures</title>
<link rel="icon" type="image/png" href="./img/monkey_narotu.png">
<link rel="stylesheet" type="text/css" href="./css/continent.css">
</head>
<body>
<img class="world_map" src="./img/36479.svg">
<div class="noir"></div>
<a href="./index.php">
<div class="buttonback">
<img src="./img/97591.svg" class="imgback" style="height: 80%; width: 80%;">
</div>
</a>
<div class="scroller">
<?php
$urleuropearabeworld = $_GET['arabworld'];
$urleuropecontinentaleurope = $_GET['continentaleurope'];
$urleuropeasiaoceania = $_GET['asiaoceania'];
$urleuropeasiaoceania = $_GET['europecentralasia'];
$urleuropeasiaoceania = $_GET['latinamericacaribbean'];
$urleuropeasiaoceania = $_GET['northamerica'];
$urleuropeasiaoceania = $_GET['subsaharanafrica'];
$bdd = new PDO('mysql:host=db;dbname=fil_rouge_401_Corneille_Jules', 'Fil_Rouge_Jules_Conrneille', '1234');
// Récupération de la liste des constructeurs par pays
$constructeurQuery = $bdd->prepare('SELECT * FROM ApiConstructeur ORDER BY pays, nom ASC');
$constructeurQuery->execute();
$constructeurs = $constructeurQuery->fetchAll();
$currentCountry = "";
foreach ($constructeurs as $constructeur) {
if ($constructeur['pays'] != $currentCountry) {
if ($currentCountry != "") {
echo '</div><hr></div>';
}
$currentCountry = $constructeur['pays'];
// Recherche du lien du drapeau du pays dans la table ApiContinent
$drapeauQuery = $bdd->prepare('SELECT drapeaupays FROM ApiContinent WHERE nom_pays = ?');
$drapeauQuery->execute([$currentCountry]);
$drapeau = $drapeauQuery->fetch();
echo '<div class="partie">';
echo '<div class="pays"><img src="' . htmlspecialchars($drapeau['drapeaupays'], ENT_QUOTES, 'UTF-8') . '" class="imgpays"><h1 class="txtpays">' . $constructeur['pays'] . '</h1></div>';
echo '<div class="marques">';
}
echo '<a href="./template_marque.php?id=' . $constructeur['id'] . '"><div class="boutondiv">';
echo '<img src="./img/logo_marque/' . htmlspecialchars($constructeur['nom'], ENT_QUOTES, 'UTF-8') . '.svg" class="logoimg">';
echo '</div></a>';
}
if ($currentCountry != "") {
echo '</div><hr></div>';
}
?>
</div>
</body>
</html>