<?php
/*
Template Name: Course
*/
?>

<?php get_header(); ?>
<div id="main" class="group">
	<div id="content">
			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
			<div id="course">
			<table>
				<tbody>
				<tr>
					<th> <a href='<?php the_permalink(); ?>'><?php the_title(); ?></a><?php edit_post_link('<div style="float:Right;">[Edit]</div>'); ?></th>
				</tr>
				<tr>
					<td> <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?> </td>
				</tr>
				<?php
					// If comments are open or we have at least one comment, load up the comment template
					if ( comments_open() || '0' != get_comments_number() ) : ?>
					<tr> <td> <?php comments_template(); ?>	</td></tr>
					<?php endif;
				?>
				<?php
				$times = get_post_meta($post->ID, 'Aika', false);
				if (count($times) > 0) : ?>
					<tr> <td> Kurssiajankohdat:
					<ul style="list-style-type: none; padding: 0px; margin: 0px;">
						<?php foreach($times as $time) {
							echo '<li style="padding-left: 15px;">-'.$time.'</li>';
						} ?>
					</ul>
					</td></tr>
				<?php endif; ?>				
				</tbody>
			</table>
			</div>
			<div style="height:30px;"></div>
			<?php endwhile; else: ?>
			<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
		<?php endif; ?>
	</div>
<?php get_sidebar(); ?>
</div>
<div id="delimiter"></div>
<?php get_footer(); ?>