- $repno = $match[1];
- $title = '';
-
- $line = file_get_contents($path.$fname);
- if (preg_match('/.*(FrontReport\()\s*_\([\'"]([^\'"]*)/', $line, $match)) {
- $title = trim($match[2]);
- }
- else // for any 3rd party printouts without FrontReport() class use
+ // reports have filenames in form rep(repid).php
+ // where repid must contain at least one digit (reports_main.php is not ;)
+ if (is_file($path.$fname)
+ && preg_match('/rep(.*[0-9]+.*)[.]php/', $fname, $match))
+ {
+ $repno = $match[1];
+ $title = '';
+
+ $line = file_get_contents($path.$fname);
+ if (preg_match('/.*(FrontReport\()\s*_\([\'"]([^\'"]*)/', $line, $match)) {
+ $title = trim($match[2]);
+ }
+ else // for any 3rd party printouts without FrontReport() class use