<?php

if (!isset($_REQUEST['ereignis'])) {
	header("Location: ../index.php");
}

switch ($_REQUEST['ereignis']) {
	case 'treffen2003':
		$heading = 'Fotos vom Treffen 2003';
		$foto_count = 42;
		$path = 'treffen2003/fotos/';
		break;
	case 'treffen2001':
		$heading = 'Fotos vom Treffen 2001';
		$foto_count = 27;
		$path = 'treffen2001/fotos/';
		break;
}
$page_title = 'Beethoven2000 - '. $heading;

$additional_headers = array();

include('../includes/header.inc');
?>

<div id="bread-crumbs">
	<a href="/intern.php">Intern</a> >
<?php
echo '<a href="fotos.php?ereignis='.$_REQUEST['ereignis'].'">'.$heading.'</a>';
if (isset($_REQUEST['nr']))
	echo ' > Foto '.$_REQUEST['nr'];
?>
</div>

<div id="content">

<h1><?php echo $heading; ?></h1>

<div id="thumbs">

<?php
// wenn Foto mit Nummer ausgewählt
if (isset($_REQUEST['nr'])) {

	$src = $path;
	if ($_REQUEST['nr'] < 10) $src .= '0'.$_REQUEST['nr'];
	else $src .= $_REQUEST['nr'];
	$src .= '.jpg';

	// weiterklicken
	echo "<div id=\"foto-navigation\">\n";
	if ($_REQUEST['nr'] > 1) {
		echo '<a href="fotos.php?ereignis='.$_REQUEST['ereignis'].'&amp;nr='.($_REQUEST['nr'] - 1).'#content">&lt;&lt;</a>';
	}
	echo '&nbsp;&nbsp;';
	if ($_REQUEST['nr'] < $foto_count) {
		echo '<a href="fotos.php?ereignis='.$_REQUEST['ereignis'].'&amp;nr='.($_REQUEST['nr'] + 1).'#content">&gt;&gt;</a>'."\n";
	}
	echo "</div>\n";

	echo "<img src=\"$src\" alt=\"Foto".$_REQUEST['nr']."\" />\n";
}
else {

	for ($i = 1; $i <= $foto_count; $i++) {

		$src = $path;
		$src .= 'k';
		if ($i < 10) $src .= '0'.$i;
		else $src .= $i;
		$src .= '.jpg';

		echo '<a href="fotos.php?ereignis='.$_REQUEST['ereignis']."&amp;nr=$i#foto\"><img src=\"$src\" alt=\"Foto$i\" /></a>\n";
	}
}

echo "</div>\n";

echo "</div>\n";

include('../includes/footer.inc');
?>