]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/scripts/public_html/showquery.php
beauty\!
[helm.git] / helm / matita / scripts / public_html / showquery.php
index bd54d6a63e47dc3ad7aca5fe373d90f77f37d3d0..e7db764d80e78d5f529490668a674b23386a5a83 100644 (file)
     $qs[$x[0]] = $x[1];
   }
 
+function prettify($s) {
+  if (preg_match("/^[0-9]{12}$/",$s)) {
+    $year = substr($s,0,4);
+    $month = substr($s,4,2);
+    $day = substr($s,6,2);
+    $hour = substr($s,8,2);
+    $minute = substr($s,10,2);
+    return $day . "/" . $month . "/" . $year . " " . $hour . ":" . $minute;
+  } else
+    return $s;
+}
+  
 ?>
 <html>
   <head>
           echo "<th>$name</th>";
         }
       echo "</tr>\n";
+      $i=0;
       foreach ($q as $k => $v) {
-        echo "<tr>";      
+        $i = $i + 1;
+        if ( $i%2 == 0)
+          echo "<tr class=\"even\">";      
+        else
+          echo "<tr class=\"odd\">";
         foreach( $v as $name => $txt) {
-          echo "<td>$txt</td>";
+          echo "<td>" . prettify($txt) . "</td>";
         }
         echo "</tr>\n";      
       }