<h3>Tour Center</h3>


<?php if(!$tours) { echo "No Tours added"; } else { ?>
<table width="100%" class="tablesorter">
<thead>
<th>Tour</th>
<th>Tour Start</th>
<th>Tour End</th>
<th>Legs</th>
<th>Status</th>
<th>Edit</th>
<th>Delete</th>
</thead>
<?php foreach($tours as $tour) { ?>
<tr>
<td><?php echo $tour->tourtitle ?></td>
<td><?php echo $tour->firstdep ?> (<?php echo $tour->startdate ?>)</td>
<td><?php echo $tour->lastarr ?> <?php if($tour->enddate != '0000-00-00') { ?>(<?php echo $tour->enddate ?>) <?php } ?></td>
<td><?php echo $tour->legnumber ?></td>
<td><?php echo TourCenterData::tourstatus($tour->status); ?></td>
<td width="15%" ><button class="{button:{icons:{primary:'ui-icon-wrench'}}}" onclick="window.location='<?php echo SITE_URL ?>/admin/index.php/tourcenter/tourdetails/<?php echo $tour->id; ?>';">Tour Details / Edit</button></td>
<td width="15%" ><button class="{button:{icons:{primary:'ui-icon-closethick'}}}" onclick="window.location='<?php echo SITE_URL ?>/admin/index.php/tourcenter/deletetour/<?php echo $tour->id; ?>';">Delete Tour</button></td>
</tr>
<?php } ?>
</table>
<?php } ?>