<%@ language="vbscript"%>
<%response.Expires = 0%>

<!--#include file="conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
sqltext="select * from Product where  Product_name='" & request.form("p_name") & "'"
rs.open sqltext,conn,1,1

'ݿ⣬ƷǷѾ
if rs.recordcount >= 1 then 
   if rs("Product_name")=request.form("p_name") then
      Response.Redirect "messagebox.asp?msg=ƷѾڣƷ!"
      response.end
      rs.close
   end if
end if


set rs=server.createobject("adodb.recordset")
sqltext="select * from Product"
rs.open sqltext,conn,3,3

'һƷݿ
rs.addnew
rs("Class_2")=request.form("class_2_name")
rs("Class_1")=request.form("class_1_name")
rs("Product_name")=request.form("p_name")
rs("Product_intro")=request.form("p_intro")
rs("Product_show")=request.form("p_show")
rs("P_newprice")=request.form("newprice")
rs("P_oldprice")=request.form("oldprice")
rs("P_pic")=request.form("p_pic")
rs("P_Full_pic")=request.form("p_full_pic")
rs.update
%>
<%
set rs_detail=server.createobject("adodb.recordset")
sqltext2="select * from Product where  Product_name='" & request.form("p_name") & "'"
rs_detail.open sqltext2,conn,1,1
%>

<html>
<head>
<title>Ʒӳɹ</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<STYLE type=text/css>.main {
	FONT-SIZE: 12px
}
.main1 {
	FONT-SIZE: 14px
}
.main2 {
	FONT-SIZE: 16px
}
.main3 {
	FONT-SIZE: 7px
}
.main4 {
	FONT-SIZE: 10px
}
A:link {
	COLOR: #ffffff; TEXT-DECORATION: none
}
A:visited {
	COLOR: #ffffff; TEXT-DECORATION: none
}
A:active {
	COLOR: #ff0000; TEXT-DECORATION: none
}
A:hover {
	COLOR: #aa0000; TEXT-DECORATION: underline
}
</STYLE>
</head>

<body  text="#000000">
<!--#include file="index_top.asp" -->
<p align="center"><br>
<br>
</p>
      <div align="center">
        <center>
            <TABLE cellSpacing=1 cellPadding=4 width=429 bgColor=#416327 height="144">
              <TBODY>
              <TR vAlign=top bgColor=#e6e4c4>
                <TD class=main1 colSpan=2 width="415" height="10" bgcolor="#6D8E4D"></TD></TR>
              <TR vAlign=top bgColor=#e6e4c4>
                <TD class=main1 colSpan=2 width="415" height="32"><font color="#FF0000">Ʒӳɹ--</font></TD></TR>
              <TR bgColor=#e6e4c4>
                <TD class=main1 width=102 bgColor=#6d8e4d height=25 align="right"><SPAN 
                  class=main1><font color="#FFFFFF">ࣺ</font></SPAN></TD>
                <TD class=main1 width=301 height=25><%=rs_detail("class_1")%></TD></TR>
              <tr>
                <TD class=main1 width=102 bgColor=#6d8e4d height=25 align="right"><SPAN 
                  class=main1><font color="#FFFFFF">Сࣺ</font></SPAN></TD>
                <TD class=main1 width=301 height=25 bgcolor="#E6E4C4"><%=rs_detail("class_2")%></TD>
              </tr>
              <tr>
                <TD class=main1 width=102 bgColor=#6d8e4d height=25 align="right"><SPAN 
                  class=main1><font color="#FFFFFF">Ʒƣ</font></SPAN></TD>
                <TD class=main1 width=301 height=25 bgcolor="#E6E4C4"><%=rs_detail("product_name")%></TD>
              </tr>
              <tr>
                <TD class=main1 width=102 bgColor=#6d8e4d height=25 align="right"><SPAN 
                  class=main1><font color="#FFFFFF">Աۣ</font></SPAN></TD>
                <TD class=main1 width=301 height=25 bgcolor="#E6E4C4"><%=rs_detail("p_newprice")%> Ԫ</TD>
              </tr>
              <tr>
                <TD class=main1 width=102 bgColor=#6d8e4d height=25 align="right"><SPAN 
                  class=main1><font color="#FFFFFF">гۣ</font></SPAN></TD>
                <TD class=main1 width=301 height=25 bgcolor="#E6E4C4"><%=rs_detail("p_oldprice")%> Ԫ</TD>
              </tr>
              <tr>
                <TD class=main1 width=102 bgColor=#6d8e4d height=25 align="right"><SPAN 
                  class=main1><font color="#FFFFFF">Ʒ飺</font></SPAN></TD>
                <TD class=main1 width=301 height=25 bgcolor="#E6E4C4"><%=rs_detail("product_intro")%></TD>
              </tr>
              <tr>
                <TD class=main1 width=102 bgColor=#6d8e4d height=25 align="right"><SPAN 
                  class=main1><font color="#FFFFFF">Ʒ˵</font></SPAN></TD>
                <TD class=main1 width=301 height=25 bgcolor="#E6E4C4"><%=rs_detail("product_show")%></TD>
              </tr>
              <tr>
                <TD class=main1 width=102 bgColor=#6d8e4d height=25 align="right"><SPAN 
                  class=main1><font color="#FFFFFF">Ʒ΢ͼƬ</font></SPAN></TD>
                <TD class=main1 width=301 height=25 bgcolor="#E6E4C4"><%=rs_detail("p_pic")%></TD>
              </tr>
              <tr>
                <TD class=main1 width=102 bgColor=#6d8e4d height=25 align="right"><SPAN 
                  class=main1><font color="#FFFFFF">ƷȫͼƬ</font></SPAN></TD>
                <TD class=main1 width=301 height=25 bgcolor="#E6E4C4"><%=rs_detail("p_full_pic")%></TD>
              </tr>
              <TR vAlign=top bgColor=#e6e4c4>
                <TD class=main1 colSpan=2 width="415" height="15"></TD></TR>
              <TR bgColor=#e6e4c4>
                <TD class=main1 colSpan=2 width="415" height="27">
                  <p align="center">&nbsp; 
<INPUT type="button" class=main  size=3 value='һ' name=Submit2 onclick="window.location.href='add_product.asp';"> 
                </TD></TR>
              <TR bgColor=#e6e4c4>
                <TD class=main1 colSpan=2 width="415" height="4" bgcolor="#6D8E4D"></TD></TR></TBODY></TABLE>
        </center>
      </div>
</body>
</html>
<%
rs.close
rs_detail.close
conn.close
%>