<h2><?=$header?></h2>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<th align="right">
<div class="buttons">
<a href="<?=site_url($add_url)?>" class="blue">
<?= $this->page->icon('add');?>
Add
</a>
<?php foreach($sort_url as $urlname => $url) : ?>
<a href="<?=site_url($url)?>">
<?php if ($sort['name'] == $urlname) : ?>
<?= ($sort['direction'] == 'ASC') ? $this->page->icon('arrow_up') : $this->page->icon('arrow_down');?>
<b>
<?php endif; ?>
Sort by <?=$urlname?>
<?=($sort['name'] == $urlname) ? '</b>' : ''; ?>
</a>
<?php endforeach; ?>
</div>
</th>
</tr>
</table>
<br />
<table class="tbl" border="0" cellpadding="2" cellspacing="1" width="100%">
<thead>
<tr>
<th align="right" width="70"> sort by: </th>
<th VALIGN='MIDDLE' ALIGN='CENTER' class='tbl_headercell'>
Id
</th>
<th VALIGN='MIDDLE' ALIGN='CENTER' class='tbl_headercell'>
Name
</th>
<th VALIGN='MIDDLE' ALIGN='CENTER' class='tbl_headercell'>
Category
</th>
<th VALIGN='MIDDLE' ALIGN='CENTER' class='tbl_headercell'>
Track
</th>
<th VALIGN='MIDDLE' ALIGN='CENTER' class='tbl_headercell'>
StartDateTime
</th>
<th VALIGN='MIDDLE' ALIGN='CENTER' class='tbl_headercell'>
Length
</th>
<th VALIGN='MIDDLE' ALIGN='CENTER' class='tbl_headercell'>
Active?
</th>
<th VALIGN='MIDDLE' ALIGN='CENTER' class='tbl_headercell'>
Hide?
</th>
<th VALIGN='MIDDLE' ALIGN='CENTER' class='tbl_headercell'>
Public?
</th>
</tr>
</thead>
<tbody class="scrollingContent">
<?
$i = 0;
foreach ($events_list->result_array() as $event) {
$i++;
if (($i%2)==0) { $rowColor = "#FFFFFF"; } else { $rowColor = "#C0C0C0"; }
?>
<tr style="background-color: <?= $rowColor; ?>">
<td align="center" nowrap="nowrap">
<a href = "<?= site_url($edit_url)."/".$event["id"]; ?>" >Edit</a>
<a href = "<?= site_url($delete_url)."/".$event["id"]; ?>" >Delete</a>
</td>
<td align="left" nowrap="nowrap"><?= $event['id']; ?></td>
<td align="left" nowrap="nowrap"><?= $event['name']; ?></td>
<td align="left" nowrap="nowrap"><?= $event['category_name']; ?></td>
<td align="left" nowrap="nowrap"><?= $event['track_name']; ?></td>
<td align="left" nowrap="nowrap"><?= $event['startDateTime']; ?></td>
<td align="left" nowrap="nowrap"><?= $event['eventLength']; ?></td>
<td align="left" nowrap="nowrap"><?= ($event['activeQ']) ? 'Yes' : 'No'; ?></td>
<td align="left" nowrap="nowrap"><?= ($event['hideQ']) ? 'Yes' : 'No'; ?></td>
<td align="left" nowrap="nowrap"><?= ($event['track_publicQ']) ? 'Yes' : 'No'; ?></td>
</tr>
<? } ?>
</tbody>
</table>
<br />
<div class="buttons">
<a href="<?=site_url($cancel_url)?>" class="blue">
<?= $this->page->icon('arrow_left');?>
Back
</a>
</div>