-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkorisnici.php
59 lines (55 loc) · 1.81 KB
/
korisnici.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
<?php
if (isset($_SESSION['user_id'])) {
if ($_SESSION["user_type"] != "0") {
header("location:index.php");
exit();
}
}
require_once("header.php");
require_once("menu.php");
$curr = establishDbConnection();
$query = "SELECT * FROM korisnik ORDER BY korisnik_id ASC";
$result = executeQuery($curr, $query);
if (isset($_SESSION['user_id'])) {
if ($_SESSION["user_type"] == 0) { ?>
<div>
<button onclick="window.location = 'dodaj_korisnika.php'">
Dodaj novog korisnika</button>
</div>
<?php }
}
?>
<div class="mountain-wrapper">
<?php foreach ($result as $user) : ?>
<div class="image-wrapper" style="margin: 10px;">
<object data=<?= $user["slika"]; ?> type="image/png" class="mountain-image" style="width: 100px;">
<img src="https://upload.wikimedia.org/wikipedia/commons/b/b1/Missing-image-232x150.png" fallback alt="" class="mountain-image">
</object>
<p class="title-paragraph">Ime i prezime:</p>
<p>
<?= $user["ime"]; ?> <?= $user["prezime"]; ?>
</p>
<p class="title-paragraph">Email:</p>
<p class="description-wrapper">
<?= $user["email"]; ?>
</p>
<p class="title-paragraph">Tip korisnika:</p>
<p>
<?= $user["tip_korisnika_id"]; ?>
</p>
<p class="title-paragraph">Blokiran:</p>
<p>
<?= $user["blokiran"]; ?>
</p>
<p>
<button onclick="window.location = 'dodaj_korisnika.php?user=<?= $user['korisnik_id'] ?>'">
Uredi
</button>
</p>
</div>
<?php endforeach ?>
</div>
<?php
closeConnection($curr);
require_once("footer.php")
?>