Skip to content

Instantly share code, notes, and snippets.

@ymhuang0808
Last active August 29, 2015 14:05
Show Gist options
  • Save ymhuang0808/12190b1884e398d3d0c0 to your computer and use it in GitHub Desktop.
Save ymhuang0808/12190b1884e398d3d0c0 to your computer and use it in GitHub Desktop.
<div class="container">
<ul id="tabs" class="nav nav-tabs" data-tabs="tabs">
<li <?php echo (empty($tab)) ? ' class = "active tab-pane"' : ''; ?>><a href="#events" data-toggle="tab">活動列表</a></li>
<?php
if($this->cmrdb_auth->logged_in()) {
$new_event = '<li ';
$new_event .= ($tab == 'create') ? ' class = "active tab-pane"' : '';
$new_event .= '><a href="#creat_event" data-toggle="tab">新增活動</a></li>';
echo $new_event;
}
?>
</ul>
<?php
$message_data = $this->session->flashdata('message_data');
if($this->session->flashdata('message_data'))
echo '<div class="alert-'.$message_data['type'].' alert alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>'.$message_data['message'].'</div>';
?>
<div id="my-tab-content" class="tab-content">
<div <?php echo (empty($tab)) ? ' class = "active tab-pane"' : 'class = "tab-pane"'; ?> id="events">
<table class="table table-hover" id="table-content">
<thead>
<tr>
<th>活動分類</th>
<th>活動名稱</th>
<th>活動時間</th>
<?php if($this->cmrdb_auth->logged_in())
echo '<th>報名狀況</th>';
?>
</tr>
</thead>
<tbody>
<?php
foreach($data as $row) {
echo '<tr id = "'.$row['event_id'].'" >';
echo '<td>'.$row['event_class'].'</td>';
echo '<td>'.$row['event_name'].'</td>';
echo '<td>'.date("Y/m/d",$row['event_time']).'</td>';
if($this->cmrdb_auth->logged_in())
echo '<td class="status"></td>';
echo '</tr>';
}
?>
</tbody>
</table>
<div id="alert_placeholder"></div>
</div>
<?php
if($this->cmrdb_auth->logged_in()) {
include('create_event.php');
}
?>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment