<?php 

   require_once "getphotoexif.php";
   require_once "photos.php";

   $index = $_GET['photo'];
   $uri = $_SERVER['SCRIPT_NAME'];

   if (empty($index))
      $index = 0;

   $prev = $index - 1;

   if ($index < (count($photos) - 1)) {
     $next = $index + 1;
   }

   $exif = getExifData($photos[$index]);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pl">
<head>
<title>Pokaz slajdĂłw</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="slideshow.css" />
<link rel="stylesheet" type="text/css" href="photoslideshow.css" />
<script type="text/javascript" src="mootools.js">
</script>
<script type="text/javascript" src="addingajax.js">
</script>
<script type="text/javascript" src="navigation2.js">
</script>
<script type="text/javascript" src="photoslideshow3.js">
</script>
<script type="text/javascript">
//<![CDATA[

var photos = [];
<?php

for ($i = 0; $i < count($photos); $i++) {
   echo "photos[$i] = '" . $photos[$i] . "';\n";
}

?>
//]]>
</script>
</head>
<body>
<div id="slideshow">

<div id="content">
<div id="main">
<img src="<?php echo $photos[$index]; ?>" id="photo" />
</div>
<div id="meta">
<p id="permalink">
<a href="<?php echo $uri . "?photo=$index"; ?>">TrwaĹy odnoĹnik do strony</a>
</p>
<ul id="metacontent">
<?php

echo "<li>" . $exif['Model'] . "</li>";
echo "<li>" . $exif['ISOSpeedRatings']. "</li>";
echo "<li>" . $exif['ExposureTime'] . "</li>";
echo "<li>" . $exif['DateTimeOriginal'] . "</li>";
echo "<li>" . $exif['COMPUTED']['ApertureFNumber'] . "</li>";

?>
</div>
</div>

<div id="navigation">
<div id="previous" class="<?php if ($prev >= 0) echo 'displaynavlink'; else echo 
'hiddennavlink'; ?>">
<a href="<?php echo "$uri?photo=$prev"; ?>">Wstecz</a></div>
<div id="home" class="displaynavlink"><a href="<?php echo $uri 
?>?photo=1">Start</a></div>
<div id="next" class="<?php if (!empty($next)) echo 'displaynavlink'; else echo 
'hiddennavlink'; ?>">
<a href="<?php echo "$uri?photo=$next"; ?>">Dalej</a></div>
</div>

<div id="footer">
</div>
</div>
</body>
</html>
