<html>
<head>
<style>
<!--
body
{
	font-family: verdana;
	font-size: 12;
}
td
{
	font-family: verdana;
	font-size: 12;
}
-->
</style>
<title>News Detail</title>
</head>

<body>

<?php
include "popuptop.php";

include "../conn.php";

$id = $_GET["id"];
//echo "<hr>$id<hr>";

if (isset($id))
{
	$title = "news detail";
	$header = "news detail";
	
	//include "normalheader.php";
	
	$query = "select date, subject, author, summary, body, url, img, highlight from news where id='$id'";
	//echo $query;
	
	$result = mysql_query($query);
	
	$row = mysql_fetch_array($result);
	
	$date = $row[0];
	$subject = $row[1];
	$author = $row[2];
	$summary = $row[3];
	$body = $row[4];
	$url = $row[5];
	$img = $row[6];
	$highlight = $row[7];
	
	$year = substr($date, 0, 4);
	$month = substr($date, 4, 2);
	$day = substr($date, 6, 2);
	
	?>
	<h3 align="center"><?php echo $subject ?></h3>
	<p>
	
	<center>
	<table width=80% border=0 cellpadding=5 cellspacing=5>
	
	<?php
	$file = @fopen ($img, "r");
	if ($file)
	{ 
		/*
		echo "<tr><td>related image:</td>";
		echo "<td><img src=$img></td></tr>";
		*/
		
		echo "<tr><td colspan=2><img src=$img></td></tr>";
	}
	?>
	
	<?php echo "<tr><td>$day/$month/$year</td><td>$author</td></tr>" ?>
	
	<tr><td colspan=2><?php echo "$summary" ?></td></tr>
	<tr><td colspan=2><?php echo $body ?></td></tr>
	<tr><td colspan=2>
	<?php
	$file = @fopen($url, "r");
	if ($file)
	{ 
		echo "<a href=$url target=_new>more details about this news</a>";
	}
	 
	?></td></tr>
	
	
	</table>
	</center>
	
	<?php

	//include "footer.php";
}
else
{
	header("location: view.php");
}


?>
</body>
</html>