]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/scripts/public_html/showquery.php
fix
[helm.git] / helm / software / matita / scripts / public_html / showquery.php
index e7db764d80e78d5f529490668a674b23386a5a83..1e385d46ee1ad57e86584aaeaf40def1670671bb 100644 (file)
@@ -22,26 +22,15 @@ function prettify($s) {
     return $s;
 }
   
-?>
-<html>
-  <head>
-  <link type="text/css" rel="stylesheet" href="style.css"/>
-  </head>
-  <body>
-    <h1>QUERY results</h1>
-<? foreach( $qs as $name => $q) { ?>
-    <h2><? echo $name; ?></h2>
-    <p>
-    <tt><? print $q; ?></tt>
-    </p>
-    <table border=1>
-    <? 
-      $q = query($q);
+function printer($q){
+  static $i = 0;
+  if ( $i == 0) {
       echo "<tr>";
-      foreach( $q[0] as $name => $txt) {
+      foreach( $q as $name => $txt) {
           echo "<th>$name</th>";
         }
       echo "</tr>\n";
+  } else {
       $i=0;
       foreach ($q as $k => $v) {
         $i = $i + 1;
@@ -54,7 +43,24 @@ function prettify($s) {
         }
         echo "</tr>\n";      
       }
-    ?>
+  }
+  $i++;
+}
+
+?>
+<html>
+  <head>
+  <link type="text/css" rel="stylesheet" href="style.css"/>
+  </head>
+  <body>
+    <h1>QUERY results</h1>
+<? foreach( $qs as $name => $q) { ?>
+    <h2><? echo $name; ?></h2>
+    <p>
+    <tt><? print $q; ?></tt>
+    </p>
+    <table border=1>
+    <?  query($q,&$printer); ?>
     </table>
 <? } ?>
     <p><a href="bench.php">BACK to the query page</a></p>