-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
34 lines (32 loc) · 916 Bytes
/
functions.php
File metadata and controls
34 lines (32 loc) · 916 Bytes
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
<?php
function insertQnA(){
$json = file_get_contents("data/datas.json");
$data = json_decode($json, true);
$otazky = $data["otazky"];
$odpovede = $data["odpovede"];
echo '<section class="container">';
for ($i = 0; $i < count($otazky); $i++) {
echo '<div class="accordion">
<div class="question">'.$otazky[$i].'
</div>
<div class="answer">'.
$odpovede[$i].'
</div>
</div>';
}
echo '</section>';
}
function generateSlides($dir) {
$files = glob($dir . "/*.jpg");
$json = file_get_contents("data/datas.json");
$data = json_decode($json, true);
$text = $data["text_banner"];
foreach ($files as $file) {
echo '<div class="slide fade">';
echo '<img src="' . $file . '">';
echo '<div class="slide-text">';
echo ($text[basename($file)]);
echo '</div>';
echo '</div>';
}
}