<?
session_start();
ini_set("display_errors",1);
include "db_info.php";
$id=$_GET['id'];
$no=0;
$no=($_GET['no'])?$_GET['no']:0;
?>
<html>
<head>
<title>게시판</title>
</head>
<body topmargin=0 leftmargin=0 text="#464646">
<center>
<?
$result=mysql_query("update listt set see=see+1 where id=$id",$conn);
$result=mysql_query("select id,name,email,title,wdate,see,comment,ip,filename from listt where id=$id",$conn);
$row=mysql_fetch_array($result);
?>
<table width=500 border=0 cellpadding=2 cellspacing=1 bgcolor="#777777">
<tr>
<td height=20 colspan=4 align=center bgcolor="#999999">
<font color=white><B><?=$row['title']?></B></font>
</td>
</tr>
<tr>
<td width=50 height=20 align=center bgcolor="#EEEEEE">Writer</td>
<td width=240 bgcolor=white><?=$row['name']?></td>
<td width=50 height=20 align=center bgcolor="#EEEEEE">E-mail</td>
<td width=240 bgcolor=white><?=$row['email']?></td>
</tr>
<tr>
<td width=50 height=20 align=center bgcolor="#EEEEEE">날 짜</td>
<td width=240 bgcolor=white><?=$row['wdate']?></td>
<td width=50 height=20 align=center bgcolor="#EEEEEE">See</td>
<td width=240 bgcolor=white><?=$row['see']?></td>
</tr>
<tr>
<td bgcolor=white colspan=4>
<font color=black>
<?
if($row['filename']){
?><div align=right>
<a href='downfile.php?file=<?=$row['filename']?>'><img src='file.png' width=20 height=20><?=$row['filename']?>
</a></div>
<?
}
?>
<pre><?=$row['comment']?></pre>
</font>
</td>
</tr>
<tr>
<td colspan=4 bgcolor="#999999">
<table width=100%>
<tr>
<td width=200 align=left height=20>
<a href="list.php?no=<?=$no?>"><font color=white>[목록보기]</font></a>
<a href="write.php"><font color=white>[Write]</font></a>
<a href="edit.php?id=<?=$id?>&no=<?=$no?>"><font color=white>[Edit]</font></a>
<a href="predel.php?id=<?=$id?>"><font color=white>[Delete]</font></a>
</td>
<td align=right>
<?
$query=mysql_query("select id from listt where id>$id limit 1",$conn);
$prev_id=mysql_fetch_array($query);
if($prev_id['id']){
echo "<a href='read.php?id=$prev_id[id]&no=$no'><font color=white>[Prev]</font></a>";
}
else{
echo "[Prev]";
}
$query=mysql_query("select id from listt where id <$id order by id desc limit 1",$conn);
$next_id=mysql_fetch_array($query);
if($next_id['id']){
echo "<a href='read.php?id=$next_id[id]&no=$no'><font color=white>[Next]</font></a>";
}else{
echo "[Next]";
}
?>
</td>
</tr>
</table>
</b></font>
</td>
</tr>
</table>
</center>
<?
$sql='select * from comment_free where co_no=co_order and b_no='.$id;
$result=mysql_query($sql,$conn);
?>
<div id="commentView">
<?
while($row=mysql_fetch_array($result)){
?>
<ul class="one Depth">
<li>
<table border=1 width=500 height=100>
<div>
<tr><td><span>작성자</td><td><?=$row['co_id']?></span></td><td><?=$row['wdate']?></td></tr>
<tr><td colspan=3>
<p><?=$row['co_content']?></p></td></tr>
<p></p>
</div>
</table>
</li>
</ul>
</form>
<?
}
include "comment.php";
mysql_close($conn);
?>
</body>
</html>