This repository was archived by the owner on Jul 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrubrix.php
More file actions
114 lines (109 loc) · 4.69 KB
/
rubrix.php
File metadata and controls
114 lines (109 loc) · 4.69 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
session_start();
include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/connection.php');
if (isset($_GET['r'])) {
if (!empty($_GET['r'])) {
$rubrixArray = array();
$query = $PDO->prepare('SELECT DISTINCT name FROM rubrix');
$query->execute();
$rubrixs = $query->fetchAll();
foreach ($rubrixs as $rubrix) {
array_push($rubrixArray, $rubrix['name']);
}
if (in_array($_GET['r'], $rubrixArray)) {
$short = $_GET['r'];
$query = $PDO->prepare('SELECT * FROM rubrix WHERE name = ?');
$query->bindValue(1, $short);
$query->execute();
$currentRubrix = $query->fetchAll();
$query = $PDO->prepare('SELECT name, short FROM categories WHERE short = ?');
$query->bindValue(1, $short);
$query->execute();
$result = $query->fetchAll();
$currentCategory = $result[0];
?>
<html lang="nl">
<head>
<title>Rubrix <?= $currentCategory['short']; ?> | Max Altena</title>
<?php include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/head.php'); ?>
<link rel="stylesheet" type="text/css" href="/css/rubrixstyle.css">
</head>
<body>
<?php include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/loader.php'); ?>
<?php include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/menu.php'); ?>
<main>
<div id="rubrixHeader">
<h1>Rubrix voor <?= $currentCategory['name']; ?> (<span class="accent"><?= $currentCategory['short']; ?></span>)</h1>
</div>
<div id="rubrixContent" style="display: flex; flex-direction: column;">
<div style="margin-bottom: 25px;">
<p style="text-align: center;">Hover over een leerdoel die geselecteerd is om toelichting te krijgen</p>
</div>
<table>
<tr>
<th>Criterium</th>
<th>Zeer goed</th>
<th>Goed</th>
<th>Voldoende</th>
<th>Onvoldoende</th>
</tr>
<?php
foreach ($currentRubrix as $value) {
?>
<tr>
<td class="criterium criterium<?= $value['id']; ?>"><?= $value['criterium']; ?></td>
<td class="zeer zeer<?= $value['id']; ?>"><?= $value['zeer']; ?></td>
<td class="goed goed<?= $value['id']; ?>"><?= $value['goed']; ?></td>
<td class="voldoende voldoende<?= $value['id']; ?>"><?= $value['voldoende']; ?></td>
<td class="onvoldoende onvoldoende<?= $value['id']; ?>"><?= $value['onvoldoende']; ?></td>
</tr>
<div class="opinionBlock" id="opinion<?= $value['id']; ?>" style="display: none;"><p><?= $value['opinion']; ?></p></div>
<script>
$(".<?= $value['value'].$value['id']; ?>").addClass("selected");
$(".<?= $value['value'].$value['id']; ?>.selected").on({
mousemove: function(e){
var top = e.pageY + 10;
var left = e.pageX - 265;
$("#opinion<?= $value['id']; ?>").css({top: top, left: left });
},
mouseenter: function(e){
$("#opinion<?= $value['id']; ?>").css({ display: "block" });
},
mouseleave: function(){
$("#opinion<?= $value['id']; ?>").css({ display: "none" });
}
});
</script>
<?php
}
?>
</table>
</div>
<div id="rubrixTerug">
<a href="/categorie?c=<?= $currentCategory['short']; ?>">
<div class="terug">
<span class="arrowSpan arrowSpanRubrix"><svg viewBox="0 0 24 24" class="arrow"><path class="arrowPath" d="M24 11.871l-5-4.871v3h-19v4h19v3z"/></svg></span><span class="textSpan">Terug naar <span class="accent"><?= $currentCategory['short']; ?></span></span>
</div>
</a>
</div>
</main>
<script src="/js/rubrix.js"></script>
</body>
</html>
<?php
}
else {
header('Location: ../');
exit();
}
}
else {
header('Location: ../');
exit();
}
}
else {
header('Location: ../');
exit();
}
?>