<html>
<head>
<title>Event Detail</title>
<link rel="stylesheet" href="../sft.css">
</head>

<body leftmargin="30" rightmargin="30" onload="window.self.focus()">
<center>
<table width="80%" cellspacing="0" cellpadding="5">
<tr><td><script src="top.js"></script></td></tr>
<?php
$eventid = $_GET["id"];

include "../conn.php";

$query = "select startdate, stopdate, venue, title, descrip, ldesc, imgpath, bropath from events where eventid='$eventid'";
//echo $query;
$result = mysql_query($query) or die (mysql_error());
if ($row = mysql_fetch_array($result))
{
	$startdate = $row["startdate"];
	$stopdate = $row["stopdate"];
	$title = $row["title"];
	$descrip = $row["descrip"];
	$ldesc = $row["ldesc"];
	$imgpath = $row["imgpath"];
	$bropath = $row["bropath"];
	$venue = $row["venue"];
	
	if ($startdate != "0000-00-00")
	{
		$year = substr($startdate, 0, 4);
		$month = substr($startdate, 5, 2);
		$day = substr($startdate, 8, 2);
			
		$date = date("dS M, Y", mktime(0,0,0,$month, $day, $year));
			
		if ($stopdate != "0000-00-00" && $stopdate != $startdate)
		{
			$year = substr($stopdate, 0, 4);
			$month = substr($stopdate, 5, 2);
			$day = substr($stopdate, 8, 2);
			
			$date .= " - " . date("dS M, Y", mktime(0,0,0,$month, $day, $year));
		}
	}
		
	echo "<tr><td align=\"left\" nowrap><b>$title</b></td></tr>";
	if ($date)
	{
		echo "<tr><td><b>$date</b></td></tr>";
	}
	if ($venue)
	{
		echo "<tr><td>$venue</td></tr>";
	}
	
	if (file_exists($imgpath))
	{
		echo "<tr><td align=\"center\"><img src=\"$imgpath\"></td></tr>";
	}
	
	if ($descrip)
	{
		echo "<tr><td>$descrip</td></tr>";
	}
	
	if ($ldesc)
	{
		echo "<tr><td>$ldesc</td></tr>";
	}
	if ($bropath)
	{
		echo "<tr><td><a href=\"$bropath\">Download Brochure</a></td></tr>";
	}
}
else
{
}
?>
</table>
<center>
</body>
</html>