diff --git a/templates/default/en/status-table.php b/templates/default/en/status-table.php new file mode 100644 index 0000000000000000000000000000000000000000..8d8612b50895a14879997b887edcad7add991248 --- /dev/null +++ b/templates/default/en/status-table.php @@ -0,0 +1,56 @@ +<?php +$this->includeAtTemplateBase('includes/header.php'); + +$title = $data['title']; +$table = $data['table']; + +/* Identify column headings. */ +$column_titles = array(); +foreach($table as $row_title => $row_data) { + foreach($row_data as $ct => $data) { + if(!in_array($ct, $column_titles)) { + $column_titles[] = $ct; + } + } +} + +?> + +<div id="content"> +<h2><?php echo htmlspecialchars($title); ?></h2> + +<table> + +<tr> +<th></th> +<?php +foreach($column_titles as $ct) { + echo '<th>' . htmlspecialchars($ct) . '</th>' . "\n"; +} +?> +</tr> + +<?php +foreach($table as $row_title => $row_data) { + echo '<tr>' . "\n"; + echo '<th class="rowtitle">' . htmlspecialchars($row_title) . '</th>' . "\n"; + + foreach($column_titles as $ct) { + echo '<td>'; + + if(array_key_exists($ct, $row_data)) { + echo htmlspecialchars($row_data[$ct]); + } + + echo '</td>' . "\n"; + } + + echo '</tr>' . "\n"; +} +?> + +</table> + +<?php +$this->includeAtTemplateBase('includes/footer.php'); +?> \ No newline at end of file