<html>
<head>
<LINK href="blue.css" rel=stylesheet type=text/css>
</head>
<body>

<?php
$pic=$_GET['pic'];

if (!$file = fopen("images/pics.dat", "r"))
{
        echo ("Could not open pics.dat datafile");
	exit ();
}

while ($text = fgets($file, 255))
{
	echo ("<tr>");
	$pat = "<>";
	$arr = split($pat, $text);
	if ($arr[0]==$pic)
		break;
}

if ($arr[0] != $pic)
{
	echo("Could not find picture in database");
	exit();
}

$place=$arr[1];
$title=$arr[2];
$back=$arr[3];
$next=$arr[4];
$width=$arr[5];
$height=$arr[6];

if ($width <= 0)
	$width = 880;

if ($height <= 0)
	$height = 584;

echo("<center>\n");
echo("<h1>$place</h1>\n");
echo("<table cellspacing=5 border=0 cellpadding=2 align=\"center\">\n");
echo("<tr><td class=\"normcent\">\n");
echo("<img src=images/$pic width=$width height=$height border=0>\n");
echo("</tr><tr><td class=\"normcent\"><strong>$title</td></tr>\n");
echo("</table>\n");


include("./advert.php");
echo("<table width=100%>\n");
echo("<tr>\n");
echo("<td class=\"norm\"><a href=\"$back\">\n");
echo("<IMG width=40 height=40 SRC=\"button.return.gif\" ALT=\"[Back]\">\n");
echo("Back to trip report</a>\n");
if (strlen($next) != 0)
{
	echo("<td class=\"normright\"><a href=\"picview.php3?pic=$next\">\n");
	echo("<IMG width=40 height=40 SRC=\"button.more.gif\" ALT=\"[Next]\">\n");
	echo("Next Picture</a>\n");
}
echo("</table>\n");

?>
</body>
</html>
