-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdetailView.php
112 lines (97 loc) · 3.01 KB
/
detailView.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
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
<?php
$id = $_GET['id'];
require_once("./server/config.php");
ini_set('display_errors', 1);
$conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
if (!$conn) {
echo 'Connection error: ' . mysqli_connect_error();
}
$id = $conn->escape_string($id);
$sql = "SELECT * FROM details WHERE id='$id'";
$result = mysqli_query($conn, $sql);
$detail = mysqli_fetch_all($result, MYSQLI_ASSOC);
mysqli_close($conn)
?>
<!DOCTYPE html>
<html lang="it-IT">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Name of your awesome camera app -->
<title>Smart Lens</title>
<!-- Link to your main style sheet-->
<link rel="stylesheet" href="css/detailViewStyle.css">
</head>
<body>
<a id="close-sheet" href="camera-view.html">✖</a>
<div id="languageContainer">
<a id="Italian" href="#">Italiano</a>
<a id="English" href="en/detailView.php?id=<?php echo htmlspecialchars($detail[0]['id']) ?>">English</a>
</div>
<h2 id="artwork">
<span id="artworkTitle">
<?php
echo htmlspecialchars($detail[0]['artwork']);
?>
</span>
-
<span id="author">
<?php
echo htmlspecialchars($detail[0]['author']);
?>
</span>
</h2>
<h3 id="detailName">
<?php
echo htmlspecialchars($detail[0]['detail-name']);
?>
</h3>
<div class="flex-container">
<div>
<img class="responsive-image" id="detailImage" src="
<?php
echo htmlspecialchars($detail[0]['image']);
?>
" alt="<?php
echo htmlspecialchars($detail[0]['detail-name']) . 'image';
?>">
</div>
<div id="information">
<audio id="audio" controls src=""></audio>
<button type="button" id="audioGuide">
<img class="responsive-image" src="images/icons/Audio%20Icon.png" alt="Icona audio-guida">
<p>Ascolta la guida</p>
</button>
<button type="button" id="restart">
↻ Restart
</button>
<p id="description">
<?php
echo htmlspecialchars($detail[0]['description']);
?>
</p>
</div>
</div>
<video class="responsive-image" id="detailVideo" src="" controls>
</video>
<script>
const audio = document.getElementById('audio');
const audioSource = "<?php echo htmlspecialchars($detail[0]['audio-guide'])?>";
if (audioSource !== "") {
audio.style.display = 'block';
audio.src = audioSource;
document.getElementById('audioGuide').style.display = 'none';
document.getElementById('restart').style.display = 'none';
}
const video = document.getElementById('detailVideo');
const videoSource = "<?php echo htmlspecialchars($detail[0]['video'])?>";
if (videoSource !== "") {
video.style.display = 'block';
video.src = videoSource;
video.poster = "<?php echo htmlspecialchars($detail[0]['image'])?>";
}
</script>
<script src="js/textToSpeech.js"></script>
</body>
</html>