<%@ Language=VBScript %>
<%
Response.Buffer=false
Response.Expires=0
%>
<!-- #include file="../dsn.asp" -->
<!-- #include file="../links.asp" -->
<%

set cn = Server.CreateObject("ADODB.Connection")
cn.Open mycnstr
set rs = Server.CreateObject("ADODB.Recordset")

keyno=Request.QueryString("keyno")
if keyno="" then
	sqltext="select * from contact order by creatdate desc"
	rs.Open sqltext,cn,1,1
	if not rs.EOF then
		keyno=rs("id")
		title=trim(rs("title"))
		content=trim(rs("body"))
		myname=trim(rs("name"))
		address=trim(rs("add"))
		phone=trim(rs("tel"))	
		fax=trim(rs("fax"))
		corpname=trim(rs("compa"))
		email=trim(rs("email"))
		datedate=rs("creatdate")
	else
		Response.End
	end if
	rs.Close
else	
	sqltext="select * from contact where id="&keyno
	rs.Open sqltext,cn,1,1
	if not rs.EOF then
		title=trim(rs("title"))
		content=trim(rs("body"))
		myname=trim(rs("name"))
		address=trim(rs("add"))
		phone=trim(rs("tel"))	
		fax=trim(rs("fax"))
		corpname=trim(rs("compa"))
		email=trim(rs("email"))
		datedate=rs("creatdate")
	else
		Response.End
	end if
	rs.Close
end if

%>

<html>
<head>
<title>信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="font.css" type="text/css">
<style type="text/css">
<!--
body {font-size: 12px; color: #000000; font-family: 宋体}
td {font-size: 12px; color: #000000; font-family: 宋体;line-height:130%}
.t1 {font:12px 宋体;color=000000} 
.t2 {font:14px 宋体;color=000000} 

.bt2 {font:16px 宋体;color=000000} 

.td1 {font-size:12px;background-color:#3388bb;color:#ffffff}
.td2 {font-size:12px;background-color:#ffffff;color:#000000;}

A:link {color: #000077}
A:visited {color: #000077}
A:hover {color: #ff0000}

A.r1:link {text-decoration:none;color:#304556;}
A.r1:visited {text-decoration:none;color:#304556;}
A.r1:hover {text-decoration:underline;color:ff6600;}

A.r2:link {text-decoration:none;color:#ffffff;}
A.r2:visited {text-decoration:none;color:#ffffff;}
A.r2:hover {text-decoration:underline;color:cccc00;}

-->
</style>

</head>

<body bgcolor="#eeeeee" text="#000000" leftmargin="0" topmargin="0">
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center" height=100%>
  <tr><td height="5"></td></tr>
  <tr><td class=t1>标题：&nbsp;<%=title%></td></tr>
  <tr><td class=t1>时间：&nbsp;<%=datedate%></td></tr>
  <tr><td class=t1>姓名：&nbsp;<%=myname%></td></tr>
  <tr><td class=t1>单位：&nbsp;<%=corpname%></td></tr>
  <tr><td class=t1>电话：&nbsp;<%=phone%></td></tr>
  <tr><td class=t1>地址：&nbsp;<%=address%></td></tr>
  <tr><td class=t1>Email：&nbsp;<a href="mailto:<%=email%>" class=td><%=email%></a></td></tr>
  <tr><td class=t1>传真：&nbsp;<%=fax%></td></tr>
  <tr><td class=t1>&nbsp;<%=checkstr(content)%></td></tr>
  <tr><td height="10">&nbsp;</td></tr>
</table>
</body>
</html>
<%
function checkstr(str)
	dim i,xx1,xx2,ttt
	ttt="&nbsp;&nbsp;&nbsp;&nbsp;"
	xx1=1
	xx2=instr(xx1,str,chr(13))
	do while xx2>0
		ttt=ttt+mid(str,xx1,xx2-xx1)+"<br>&nbsp;&nbsp;&nbsp;&nbsp;"		
		xx1=xx2+1
		xx2=instr(xx1,str,chr(13))
	loop
	ttt=ttt+mid(str,xx1)
	checkstr=ttt
end function	
%>	
