r2043 + initial RackCode stats
[racktables] / inc / functions.php
index 98f7e5164ddf41e5ff11c70710dffebfc9450ead..ec8ac123b48fc04ceeeeb5e1741623c5e08b657b 100644 (file)
@@ -1611,4 +1611,24 @@ function redirectUser ($p, $t)
        die;
 }
 
        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;
+}
+
 ?>
 ?>