Skip to content

Commit

Permalink
Added generic view template for print_as_table()
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Rusev committed Jan 8, 2010
1 parent 74a9058 commit 7ae600c
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.mkd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Changelog
Last updated 08.01.2010

#Version 0.3
- Added query_time() function
- Added print_as_table() function
- Added inline configuration settings
44 changes: 44 additions & 0 deletions views/print_as_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<style>
.crystal_table
{
width:100%;
border:1px solid #eee;
border-collapse:collapse;
}
.crystal_table td
{
padding:4px;
border:1px solid #eee;
}
.crystal_table thead td
{
background:#eee;
font-weight:bold;
text-align:center;
}
</style>
<?php if(isset($table_fields)): ?>
<table class="crystal_table">
<thead>
<?php foreach($table_fields as $key => $field): ?>
<td>
<?php echo $field; ?>
</td>
<?php endforeach; ?>
</thead>
<?php foreach($result as $k => $v): ?>
<tr>
<?php foreach($v as $item): ?>
<td>
<?php echo $item; ?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</table>
<?php else: ?>
<p>
The specified table is empty
</p>

<?php endif; ?>

0 comments on commit 7ae600c

Please sign in to comment.