r2043 + initial RackCode stats
authorDenis Ovsienko <infrastation@yandex.ru>
Mon, 7 Jul 2008 13:58:34 +0000 (13:58 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 7 Jul 2008 13:58:34 +0000 (13:58 +0000)
inc/functions.php
inc/interface.php

index 98f7e5164ddf41e5ff11c70710dffebfc9450ead..ec8ac123b48fc04ceeeeb5e1741623c5e08b657b 100644 (file)
@@ -1611,4 +1611,24 @@ function redirectUser ($p, $t)
        die;
 }
 
+function getRackCodeStats ()
+{
+       global $rackCode;
+       $defc = $grantc = 0;
+       foreach ($rackCode as $s)
+               switch ($s['type'])
+               {
+                       case 'SYNT_DEFINITION':
+                               $defc++;
+                               break;
+                       case 'SYNT_GRANT':
+                               $grantc++;
+                               break;
+                       default:
+                               break;
+               }
+       $ret = array ('Definition sentences' => $defc, 'Grant sentences' => $grantc);
+       return $ret;
+}
+
 ?>
index da5febc3e1bc8293769023e9e37e8552adb046ca..422e02b98494236ceb1e57a9e668b0d226e6da9e 100644 (file)
@@ -3467,24 +3467,30 @@ function renderReportSummary ()
 {
        echo "<table width='100%'>\n";
        echo "<tr><td class=pcleft>\n";
-       startPortlet ("Dictionary/objects stats");
+       startPortlet ("Dictionary/objects");
        echo "<table>\n";
        foreach (getDictStats() as $header => $data)
                echo "<tr><th class=tdright>${header}:</th><td class=tdleft>${data}</td></tr>\n";
        echo "</table>\n";
        finishPortlet();
-       startPortlet ('IPv4 stats');
+       startPortlet ('IPv4');
        echo "<table>\n";
        foreach (getIPv4Stats() as $header => $data)
                echo "<tr><th class=tdright>${header}:</th><td class=tdleft>${data}</td></tr>\n";
        echo "</table>\n";
        finishPortlet();
-       startPortlet ('Rackspace stats');
+       startPortlet ('Rackspace');
        echo "<table>\n";
        foreach (getRackspaceStats() as $header => $data)
                echo "<tr><th class=tdright>${header}:</th><td class=tdleft>${data}</td></tr>\n";
        echo "</table>\n";
        finishPortlet();
+       startPortlet ('RackCode');
+       echo "<table>\n";
+       foreach (getRackCodeStats() as $header => $data)
+               echo "<tr><th class=tdright>${header}:</th><td class=tdleft>${data}</td></tr>\n";
+       echo "</table>\n";
+       finishPortlet();
 
        echo "</td><td class=pcright>\n";