-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeneracija.php
66 lines (52 loc) · 1.58 KB
/
generacija.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
<?php
// generacija.php ? generacija=2020 => GET REQUEST
// $_GET['generacija']
$generacija = $_GET['generacija'];
$title = "Studenti " . $generacija . ". generacije";
?>
<?php require_once "db.php" ?>
<?php include "modul/head.php" ?>
<?php
$studenti = $pdo->query(
"select students.*, smers.naziv as `smer`
from students
join smers on
smers.id = students.smer_id
where students.generacija = $generacija
"
)->fetchAll();
// print_r($studenti);
?>
<div class="row">
<div class="col-sm-3">
<div class="panel panel-primary">
<?php include "modul/smerovi.php" ?>
<?php include "modul/generacije.php" ?>
</div>
</div>
<div class="col-sm-9">
<table class="table">
<thead>
<tr>
<th>Ime i prezime</th>
<th>Generacija</th>
<th>Smer</th>
<th>Opsirnije</th>
</tr>
</thead>
<tbody>
<?php foreach($studenti as $student) { ?>
<tr>
<td><?= $student['ime'] ?> <?= $student['prezime'] ?></td>
<td><?= $student['generacija'] ?></td>
<td><?= $student['smer'] ?></td>
<td>
<a href="student.php?id=<?= $student['id'] ?>">Opsirnije...</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<?php include "modul/foot.php" ?>