-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnou_temes.php
44 lines (40 loc) · 1.31 KB
/
nou_temes.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
<?php
$title = 'Tecno2nBAT';
require_once'include/header.php';
require_once'db/connect.php';
require_once'db/crud.php';
$crud = new crud($pdo);
$temes = $crud->gettemes();
?>
<?php
$categories = [];
$temes->execute();
while ($row = $temes->fetch(PDO::FETCH_ASSOC)) {
$categories[] = $row;
}
$count_temes = 0;
echo '<div class="row row-cols-1 row-cols-md-3 mb-3 text-center">';
foreach ($categories as $index => $category) {
echo '<div class="col">';
echo '<div class="card mb-4 shadow-sm">';
echo '<div class="card-body">';
echo '<a href="exercicis.php?id=' . $category['id_temes'] . '&tema_titol=' . urlencode($category['temes']) . '" class="w-100 btn btn-lg btn-primary">';
echo $category['temes'];
echo '</a>';
echo '<div class="d-flex justify-content-between align-items-center">';
echo '<div class="btn-group mt-2">';
echo '<a href="' . $category['link_teoria'] . '" type="button" class="btn btn-sm btn-outline-secondary">Teoria</a>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
if (($index + 1) % 3 === 0 && ($index + 1) !== count($categories)) {
echo '</div>';
echo '<div class="row row-cols-1 row-cols-md-3 mb-3 text-center">';
}
$count_temes++;
}
echo '</div>';
?>
<?php require_once 'include/footer.php'; ?>