Skip to content
Snippets Groups Projects
Commit 9a789a17 authored by Olav Morken's avatar Olav Morken
Browse files

Template: Added status table template.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@263 44740490-163a-0410-bde0-09ae8108e29a
parent 89b402d2
No related branches found
No related tags found
No related merge requests found
<?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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment