-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstring-match-result.php
60 lines (47 loc) · 1.88 KB
/
string-match-result.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
<?php include('includes/header.php');?>
<?php
if(isset($_GET['site'])) {
$query_rankings = "SELECT * FROM rankingsites WHERE id = ".$_GET['site'];
$result_rankings = $mysqli->query($query_rankings) or die($mysqli->error.__LINE__);
$row_rankings = $result_rankings->fetch_assoc();
echo "<h1>Check Match (".$row_rankings['site'].")</h1>";
echo "<hr />";
// The maximum execution time, in seconds. If set to zero, no time limit is imposed.
set_time_limit(0);
$query_site = "SELECT * FROM rankingsites WHERE id = ".$_GET['site'];
$result_site = $mysqli->query($query_site) or die($mysqli->error.__LINE__);
$row_site = $result_site->fetch_assoc();
$query = "SELECT * FROM parsingrows WHERE `site-id` = '".$_GET['site']."' AND `dbpedia-uri` <> '' ORDER BY university";
$result = $mysqli->query($query) or die($mysqli->error.__LINE__);
echo '<table class="table table-bordered">';
echo '<tr>';
echo '<th>DBpedia URI</td>';
echo '<th>Original Name</td>';
echo '<th>Oliver Best Match</td>';
echo '<th class="text-center">Oliver score ('.$row_site['best-oliver-score'].'%)</th>';
echo '</tr>';
// GOING THROUGH THE DATA
if($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//url decode
$dbpedia_uri = urldecode($row['dbpedia-uri']);
// style class for true positive rows
if($row['oliver-score'] > $row_site['best-oliver-score']) {
$class_row = '';
} else {
$class_row = 'class="danger"';
}
echo '<tr '.$class_row.'>';
echo '<td><a href="'.$dbpedia_uri.'" target="_blank">'.$dbpedia_uri.'</a></td>';
echo '<td>'.$row['university'].'</td>';
echo '<td>'.$row['oliver-best-match'].'</td>';
echo '<td class="text-center">'.$row['oliver-score'].'%</td>';
echo '</tr>';
}
} else {
echo 'NO RESULTS';
}
echo '</table>';
}
?>
<?php include('includes/footer.php');?>