forked from ifgi-webteam/Campusplan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfachbereiche.php
81 lines (56 loc) · 1.63 KB
/
fachbereiche.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
require_once("functions.php");
checkCache();
getHead();
?>
<div class="container">
<?php
if(isset($_GET['lang'])){
getFBs($_GET['lang']);
} else {
getFBs();
}
?>
</div><!--/container -->
<?php
getFoot();
// loads all university departments in $lang (currently supported: de, en (TODO!))
function getFBs($lang = "de"){
echo '<div class="row-fluid">
<h1>Fachbereiche</h1>
</div>
<div class="row-fluid">
<div class="btn-group btn-group-vertical" style="width: 100%">
';
$fbs = sparql_get("
prefix foaf: <http://xmlns.com/foaf/0.1/>
prefix lodum: <http://vocab.lodum.de/helper/>
prefix owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT * WHERE {
?fb a lodum:Department ;
foaf:name ?name;
lodum:departmentNo ?no.
FILTER langMatches(lang(?name),'".$lang."') .
FILTER regex(?name,' - ') .
FILTER regex(str(?fb), '/fb') .
} ORDER BY ?no
");
if( !isset($fbs) ) {
print "<li>Fehler beim Abruf der Fachbereichsdaten.</li>";
}else{
// only start if there are any results:
if($fbs->results->bindings){
foreach ($fbs->results->bindings as $fb) {
$name = $fb->name->value;
$title = substr($name, 0, 14);
$desc = substr($name, 17);
$title = str_replace("Fachbereich 0", "Fachbereich ", $title);
$url = $fb->fb->value;
echo '<a class="btn btn-large btn-stacked internal" href="orgdetails.php?org_uri='.$url.'">'.$title.'<br class="visible-phone" /><span class="hidden-phone" style="margin-left:30px"> </span><small>'.$desc.'</small></a>';
}
}
}
echo '</div>';
}
flushCache();
?>