-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetch-subjects.php
executable file
·36 lines (33 loc) · 1.29 KB
/
fetch-subjects.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
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/lib/rdf-db.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/lib/misc.php';
//the "yes" flag specifies that the term should have hyperlinks to source URL
$terms = get_conte_terms_hash("yes");
//$data = get_subjects();
$arr = get_subjects();
$data = $arr['data'];
$query = $arr['query'];
$query = str_replace("<", "<", $query);
$query = str_replace(">", ">", $query);
?>
<div style="float:right;">Toggle SPARQL Query <input style="vertical-align:middle;" type="checkbox" id="toggle_switch" onclick="toggleSPARQL();" /> </div>
<br />
<div id='sparql_query' style='display:none;'><pre><?php echo $query; ?></pre> </div>
<?php
$numrows = count($data);
//echo 'project: '.$_REQUEST['project'].' '.$_GET['fetch'];
echo $numrows.' records found.';
echo "<table class='gridtable'>";
echo '<tr><th title="' . $terms['subjectID'] . '">Subject ID</th>';
echo '<th title="' . $terms['timepoint'] . '">Timepoint</th>';
echo '<th title="' . $terms['species'] . '">Species</th></tr>';
for($ri = 0; $ri < $numrows; $ri++) {
$row = $data[$ri];
echo "<tr>";
echo "<td>".$row['subjectID']."</td>";
echo "<td>".$row['timepoint']."</td>";
echo "<td>".$row['species']."</td>";
echo "</tr>";
}
echo '</table>';
?>