<?php
    if($events)
    {
    	echo '<table class="tablesorter">
    <thead>
        <th>ID</th>
        <th>Event Name</th>
        <th>Date</th>
        <th>Options</th>
    </thead>
    <tbody>';
        foreach($events as $event)
        {
            ?>
        	<tr>
        		<td>
        			<?php echo $event->id; ?>
        		</td>
        		<td>
        			<?php echo $event->name; ?>
        		</td>
        		<td>
        			<?php echo $event->date; ?>
        		</td>
        		<td align="center"><a type="button" href="<?php echo adminurl('/Timeline/update').'/'.$event->id; ?>"
                >Update</a></td>
        		<td align="center"><a type="button" href="<?php echo adminurl('/Timeline/delete_event').'/'.$event->id; ?>"
                <?php echo 'onclick="return confirm(\'Are you sure you want to delete this Timeline Event?\')"'; ?>>Delete</a></td>
        	</tr>
            <?php
        }
    }
    else
    {echo '<tr><td colspan="7"><h3>There are no Timeline Events Yet</h3></td></tr>';}

?>
    </tbody>
    
</table>