<!--#include file="conn.asp"-->
<!--#include file="checkUser.asp"-->
<% 
id = trim(request("id"))
action = request("action")
set rs=server.createobject("adodb.recordset")

if action = "update" then
	name = replace(trim(request("name")),"'","''")
	sex = replace(trim(request("sex")),"'","''")
	email = replace(trim(request("email")),"'","''")
	company = replace(trim(request("company")),"'","''") 
	tel = replace(trim(request("tel")),"'","''")
	fax = replace(trim(request("fax")),"'","''")
	address = replace(trim(request("address")),"'","''")
	introduce = replace(trim(request("introduce")),"'","''")
	sql = "update book set company='"&company&"',name='"&name&"',tel='"&tel&"',fax='"&fax&"',email='"&email&"',introduce='"&introduce&"' where id="&id&""
	conn.execute sql 
	%>
	<script language = "javascript">
	    alert('修改留言成功');
		window.parent.close();
	</script>
	<%
	response.end
end if
sql = "select * from book where id="&id&""
rs.open sql,conn,1,3
rs("click")=rs("click")+1
rs.update 

%>
<html>
<head>
<title>guestbook</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #003399}
-->
</style>
<link rel="stylesheet" href="Images/Admin_style.css">
</head>
<body background="pic/B.gif" leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
	<table width="99%" height="40" border="0" align="center" cellpadding="0" cellspacing="0" class="table2">
        <tr> 
          <td valign="bottom" background="../images/b003.gif"><div align="left"></div>
            <table width="82%" border="0" align="center" cellpadding="0" cellspacing="0" height="30">
              <tr> 
                <td valign="top"><font color="#003399">你现在的位置是：查看留言</font></td>
              </tr>
          </table></td>
        </tr>
</table>
  <form name = "myform" method = "post" action = "?action=update&id=<%=rs("id")%>">
	    <table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#008FD5" class="unnamed1" >
	
          <tr bgcolor="#D7EBFF"> 
            <td height="20" colspan="2" align="left">
                <font color="#003399">&nbsp;&nbsp;</font> 
              <div align="center"></div></td>
          </tr>
		  <tr bgcolor="#F3F3DC"> 
         <td height="30" bgcolor="#F4FAFF"><div align="center"><font color="#003399">姓
            名</font></div></td>
          <td bgcolor="#FFFFFF"><font color="#003399"> 　 
            <INPUT name=name id="name" 
            style="BORDER-RIGHT: #9a9999 1px solid; BORDER-TOP: #9a9999 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #9a9999 1px solid; BORDER-BOTTOM: #9a9999 1px solid; BACKGROUND-COLOR: #f8f8f8" value="<%=rs("name")%>" 
             size=20>
</font></td>
        </tr>
		<td height="30" bgcolor="#F4FAFF"><div align="center"><font color="#003399">E-mail</font></div></td>
          <td bgcolor="#FFFFFF"><font color="#003399"> 　 
            <INPUT name=email id="email" 
            style="BORDER-RIGHT: #9a9999 1px solid; BORDER-TOP: #9a9999 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #9a9999 1px solid; BORDER-BOTTOM: #9a9999 1px solid; BACKGROUND-COLOR: #f8f8f8" value="<%=rs("email")%>" 
             size=40>
            </font></td>
        </tr>
		<td height="30" bgcolor="#F4FAFF"><div align="center"><font color="#003399">电话</font></div></td>
          <td bgcolor="#FFFFFF"><font color="#003399"> 　 
              <input name=tel id="tel" 
            style="BORDER-RIGHT: #9a9999 1px solid; BORDER-TOP: #9a9999 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #9a9999 1px solid; BORDER-BOTTOM: #9a9999 1px solid; BACKGROUND-COLOR: #f8f8f8" value="<%=rs("tel")%>" 
             size=40>
　 
            
            </font></td>
        </tr><tr>
          <td height="30" align="center" bgcolor="#F4FAFF"><span class="style1">传真 </span></td>
          <td bgcolor="#FFFFFF"><font color="#003399">　
              <input name=fax id="fax" 
            style="BORDER-RIGHT: #9a9999 1px solid; BORDER-TOP: #9a9999 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #9a9999 1px solid; BORDER-BOTTOM: #9a9999 1px solid; BACKGROUND-COLOR: #f8f8f8" value="<%=rs("fax")%>" 
             size=40>
          </font></td>
        </tr>
        <tr>
          <td height="30" align="center" bgcolor="#F4FAFF"><span class="style1">留言标题</span></td>
          <td bgcolor="#FFFFFF"><font color="#003399">　
              <input name=title id="title" 
            style="BORDER-RIGHT: #9a9999 1px solid; BORDER-TOP: #9a9999 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #9a9999 1px solid; BORDER-BOTTOM: #9a9999 1px solid; BACKGROUND-COLOR: #f8f8f8" value="<%=rs("title")%>" 
             size=40>
          </font></td>
        </tr>
        <tr>
          <td height="30" align="center" bgcolor="#F4FAFF"><span class="style1">公司名称</span></td>
          <td bgcolor="#FFFFFF"><font color="#003399">　
              <input name=zip id="zip" 
            style="BORDER-RIGHT: #9a9999 1px solid; BORDER-TOP: #9a9999 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #9a9999 1px solid; BORDER-BOTTOM: #9a9999 1px solid; BACKGROUND-COLOR: #f8f8f8" value="<%=rs("company")%>" 
             size=40>
          </font></td>
        </tr>
        <td height="30" bgcolor="#F4FAFF"><div align="center"><font color="#003399">详细内容</font></div></td>
          <td bgcolor="#FFFFFF"><font color="#003399"> 　 
            <TEXTAREA name=introduce cols=46 rows=6 id="introduce" style="BORDER-RIGHT: #9a9999 1px solid; BORDER-TOP: #9a9999 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #9a9999 1px solid; BORDER-BOTTOM: #9a9999 1px solid; BACKGROUND-COLOR: #f8f8f8"><%=rs("introduce")%></TEXTAREA>
          </font></td>
        </tr>		
        <tr bgcolor="#D7EBFF"> 
          <td height="50" colspan="2"><div align="center">
				<input name="确定" type="submit" value=" 修 改 ">
                <input name="重写" type="button" onclick = "window.parent.close()" value=" 关 闭 ">
            </div></td>
        </tr>
  </table>
</form>
</body>
</html>
<%conn.close%>