-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
65 lines (56 loc) · 2.03 KB
/
index.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
<?php include 'includes/header.php'; ?>
<?php
if (isset($_GET['dodana'])) {
echo '
<div class="alert alert-success uspesno-dodana animated">Ocena uspešno dodana!</div>
';
} else {
}
?>
<?php
$result = mysqli_query($con, "SELECT * FROM uporabniki");
while ($uporabnik = mysqli_fetch_assoc($result)) {
$predmeti = [$predmet1, $predmet2, $predmet3, $predmet4, $predmet5, $predmet6, $predmet7, $predmet8, $predmet9, $predmet10, $predmet11, $predmet12];
echo '<div class="col-lg-6">';
echo '<div class="o-uporabniku col-lg-12">';
echo '<div class="col-lg-1 slika">';
echo '<img class="pull-left" src="' . $uporabnik['slika'] . '">';
echo '</div>';
echo '<div class="col-lg-11 col-md-11 ime"><h2><a href="profil.php?id=' . $uporabnik['id'] . '">' . $uporabnik['ime_priimek'] . ', ' . $uporabnik['razred'] .'</a></h2></div>';
echo '</div>';
echo '
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>' . $uporabnik['ime_priimek'] . '</th>
<th>1. konferenca</th>
<th>2. konferenca</th>
<th>Povprečje</th>
</tr>
</thead>
<tbody>';
foreach($predmeti as $imepredmeta) {
echo '<tr>
<td class="predmet">' . $imepredmeta. '</td>';
echo '<td>';
$ocene = mysqli_query($con, "SELECT * FROM ocene WHERE predmet='". $imepredmeta ."' AND uporabnik_id='". $uporabnik['id'] . "'");
while ($ocena = mysqli_fetch_assoc($ocene)) {
echo $ocena['ocena'] . ", ";
}
echo '</td>';
echo '<td></td>';
echo '<td>';
$ocene = mysqli_query($con,"SELECT ROUND(AVG(ocena), 1) as `povprecje` FROM ocene WHERE predmet = '". $imepredmeta . "' AND uporabnik_id='". $uporabnik['id'] . "'");
while ($ocena = mysqli_fetch_assoc($ocene)) {
echo $ocena['povprecje'];
}
echo '</td>';
echo '</tr>';
}
echo '</tbody>
</table>
';
echo "</div>";
}
?>
<?php include 'includes/footer.php'; ?>