diff --git a/htdocs/demo/report/index.php b/htdocs/demo/report/index.php index d205cfcc7..91cfc5987 100644 --- a/htdocs/demo/report/index.php +++ b/htdocs/demo/report/index.php @@ -69,10 +69,11 @@ $parsed = array(); $xml = simplexml_load_string($output); foreach ($xml->errors->error as $error) { //for all errors... + $severity = (string)$error->attributes()->severity; $msg = (string)$error->attributes()->msg; $line = (string)$error->location->attributes()->line; - if (!empty($msg) && !empty($line)) { //if complete error... - $parsed[$line][] = $msg; + if (!empty($severity) && !empty($msg) && !empty($line)) { //if complete error... + $parsed[] = array('severity' => $severity, 'msg' => $msg, 'line' => $line); } } return $parsed; @@ -106,16 +107,23 @@ echo "

Output

\n"; $output = get_democlient_output($code); - $report = parse_democlient_output($output); + $results = parse_democlient_output($output); - echo "
\n"; - foreach ($report as $lineNumber => $results) { //for each line results... - echo "
Line $lineNumber:
\n"; - foreach ($results as $result) { //for each results... - echo "
" . htmlspecialchars($result) . "
\n"; + if (!empty($results)) { + echo "\n"; + echo "\n"; + echo " \n"; + echo "\n"; + echo "\n"; + foreach ($results as $result) { //for each result... + echo " \n"; } + echo "\n"; + echo "
LineSeverityMessage
" . htmlspecialchars($result['line']) . "" . htmlspecialchars($result['severity']) . "" . htmlspecialchars($result['msg']) . "
\n"; + } + else { + echo "

No errors found.

\n"; } - echo "
\n"; } else { echo "

Use the online demo page to create the report.

\n"; diff --git a/htdocs/site/css/all.css b/htdocs/site/css/all.css index 1f9520a9b..3e959073c 100644 --- a/htdocs/site/css/all.css +++ b/htdocs/site/css/all.css @@ -136,8 +136,29 @@ pre.code em { border: 1px solid #e2e2e2; } +/* Results table */ +table.results { + border-collapse: collapse; +} +table.results th { + padding: .25em; + text-align: left; + background: #e2e2e2; + border: 1px solid #e2e2e2; +} +table.results td { + padding: .25em; + background: #f7f7f7; + border: 1px solid #e2e2e2; +} +table.results .center { + text-align: center; +} + /* Printing */ @media print { #header { color: black; border-bottom: 1px solid black; } #tabs { display: none; } + table.results th { background: white; border: 1px solid black; } + table.results td { background: white; border: 1px solid black; } } \ No newline at end of file