-
Notifications
You must be signed in to change notification settings - Fork 0
/
hald.php
54 lines (40 loc) · 1.11 KB
/
hald.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
<?php
require_once("dataAccess.php");
require_once("decoder.php");
require_once("rewritingRules.php");
print "Form sends input: $_POST[query]<br>";
$decoder = new Decoder($_POST['query']);
print "Decoder returns params: ";
var_dump($decoder->output_params);
print "<br>";
print "Decoder returns target: ";
var_dump($decoder->target);
print "<br>";
$rules = RewritingRules::instance();
$dataaccess = new DataAccess();
$dataaccess->executeQuery($rules->getValue($decoder->output_params), $decoder->target);
print "Rewriter returns params: ";
var_dump($rules->getValue($decoder->output_params));
print "<br>";
$fields = $dataaccess->getResultFields();
print "<p>Number of rows: ".$dataaccess->getResultNumRows()." results.</p>";
print "<table class='example_table'>";
print "<tr>";
foreach( $fields as $field )
{
print "<th>$field</th>";
}
print "</tr>";
while( $row = $dataaccess->getResultArray() )
{
print "<tr>";
foreach( $fields as $field )
{
print "<td>$row[$field]</td>";
}
print "</tr>";
}
print "</table>";
//$aggregator = new Aggregator();
//print $aggregator->getAggregate($dataaccess->getResultArray());
?>