Store logged data in spool directory
[usb-wde1-tools.git] / htmlreport / gen-html.php
index 92dc41c6fcdee70787ff8eccd4c05a8871680945..61c94ec47ec7e52f26c8e71713eacbfee5cd47a8 100755 (executable)
@@ -7,6 +7,18 @@ if (!file_exists($cfgfile)) {
 }
 require $cfgfile;
 
+if (!function_exists('rrd_lastupdate')) {
+    echo "rrd PHP extension is missing\n";
+    exit(2);
+}
+
+if (!is_array($filetemplate)) {
+    $filetemplate = array_combine(
+        array_keys($names),
+       array_fill(0, count($names), $filetemplate)
+    );
+}
+
 $data = array();
 foreach ($names as $id => $name) {
     $data[$id]['name'] = $name;
@@ -15,7 +27,7 @@ foreach ($names as $id => $name) {
             str_replace(
                 array('{item}', '{id}'),
                 array($item, $id),
-                $filetemplate
+                $filetemplate[$id]
             )
         );
         if ($lu === false) {