<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/Beauty.asp" -->
<%
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If

' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
  If condition = "" Then
    MM_IIf = ifFalse
  Else
    MM_IIf = ifTrue
  End If
End Function
%>
<%
If (CStr(Request("MM_insert")) = "form1") Then
  If (Not MM_abortEdit) Then
    ' execute the insert
    Dim MM_editCmd

    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_Beauty_STRING
    MM_editCmd.CommandText = "INSERT INTO b_Product (CatalogID, productID, productName, MarketPrice, MemberPrice, Introduce, Explain, img) VALUES (?, ?, ?, ?, ?, ?, ?, ?)" 
    MM_editCmd.Prepared = true
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 5, 1, -1, MM_IIF(Request.Form("CatalogID"), Request.Form("CatalogID"), null)) ' adDouble
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 50, Request.Form("productID")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 100, Request.Form("productName")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 50, Request.Form("MarketPrice")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202, 1, 50, Request.Form("MemberPrice")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 203, 1, 536870910, Request.Form("Introduce")) ' adLongVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 203, 1, 536870910, Request.Form("Explain")) ' adLongVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 202, 1, 50, Request.Form("img")) ' adVarWChar
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    ' append the query string to the redirect URL
    Dim MM_editRedirectUrl
    MM_editRedirectUrl = "add_Produce.asp"
    If (Request.QueryString <> "") Then
      If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
        MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
      Else
        MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
      End If
    End If
    Response.Redirect(MM_editRedirectUrl)
  End If
End If
%>
<%
Dim rsAllCatalogs
Dim rsAllCatalogs_cmd
Dim rsAllCatalogs_numRows

Set rsAllCatalogs_cmd = Server.CreateObject ("ADODB.Command")
rsAllCatalogs_cmd.ActiveConnection = MM_Beauty_STRING
rsAllCatalogs_cmd.CommandText = "SELECT * FROM b_Catalogs ORDER BY CatalogID ASC" 
rsAllCatalogs_cmd.Prepared = true

Set rsAllCatalogs = rsAllCatalogs_cmd.Execute
rsAllCatalogs_numRows = 0
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Beauty100%</title>
<style type="text/css">
<!--
.STYLE1 {
	font-family: "黑体";
	font-size: 14px;
	color: #FFFFFF;
}
.STYLE3 {
	font-size: 12px;
	color: #7C327F;
	font-family: "宋体";
}
.STYLE4 {
	color: #5A105D;
	font-size: 18px;
	font-family: "黑体";
}
.biao {
	background-repeat: no-repeat;
}
.STYLE9 {font-family: "黑体"; font-size: 12px; color: #FFFFFF; }
.STYLE10 {font-family: "黑体"; font-size: 12px; color: #000000; }
-->
</style>
</head>

<body>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="300"><img src="images/logo.jpg" width="299" height="80" /></td>
    <td width="680"><img src="images/daohang.gif" width="680" height="35" /></td>
  </tr>
</table>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><img src="images/banner.jpg" width="980" height="214" /></td>
  </tr>
</table>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top"><table width="980" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="224"><table width="224" border="0" align="center" cellpadding="0" cellspacing="5">
          <tr>
            <td height="147" align="center" background="images/huiyuan.jpg"><table width="213" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="40" colspan="2">&nbsp;</td>
              </tr>
              <tr>
                <td height="25" colspan="2">　<span class="STYLE1">用户名：</span>
                  <label>
                  <input name="textfield" type="text" id="textfield" size="10" maxlength="20" />
                  </label></td>
              </tr>
              <tr>
                <td height="25" colspan="2">　<span class="STYLE1">密　码：</span>
                  <input name="textfield2" type="text" id="textfield2" size="10" maxlength="20" /></td>
              </tr>
              <tr>
                <td width="107" height="30">　<img src="images/denglu.jpg" width="66" height="19" /></td>
                <td width="108">　<img src="images/qingchu.jpg" width="66" height="19" /></td>
              </tr>
              <tr>
                <td height="25" colspan="2" align="center"><span class="STYLE3">新用户注册　 忘记密码？</span></td>
              </tr>
            </table></td>
          </tr>
        </table>
          <table width="224" border="0" align="center" cellpadding="0" cellspacing="5">
            <tr>
              <td bgcolor="#F6EDEF"><table width="213" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="35" valign="middle" background="images/tiao_bg.jpg">　　　<span class="STYLE4">商品分类</span></td>
                </tr>
                <tr>
                  <td height="25">&nbsp;</td>
                </tr>
                <tr>
                  <td height="25">&nbsp;</td>
                </tr>
                <tr>
                  <td height="25">&nbsp;</td>
                </tr>
                <tr>
                  <td height="25">&nbsp;</td>
                </tr>
                <tr>
                  <td height="25">&nbsp;</td>
                </tr>
                <tr>
                  <td height="25">&nbsp;</td>
                </tr>
                <tr>
                  <td height="25">&nbsp;</td>
                </tr>
              </table></td>
            </tr>
          </table>
          <table width="224" border="0" align="center" cellpadding="0" cellspacing="5">
            <tr>
              <td bgcolor="#F6EDEF"><table width="213" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="35" background="images/tiao_bg.jpg">　　　<span class="STYLE4">产品查询    </span></td>
                </tr>
                <tr>
                  <td height="25">　　
                    <label>
                    <select name="select" id="select">
                      <option>产品名称</option>
                    </select>
                    </label></td>
                </tr>
                <tr>
                  <td height="25">　　
                    <label>
                    <select name="select2" id="select2">
                      <option>所有大类　　　　　　</option>
                    </select>
                    </label></td>
                </tr>
                <tr>
                  <td height="25">　　
                    <select name="select3" id="select3">
                      <option>所有小类</option>
                    </select></td>
                </tr>
                <tr>
                  <td height="25">　　                    
                    <select name="select4" id="select4">
                      <option selected="selected">关键字</option>
                                        </select>　
                    　<img src="images/search.gif" width="49" height="15" /></td>
                </tr>
              </table></td>
            </tr>
          </table>
          <table width="224" border="0" align="center" cellpadding="0" cellspacing="5">
            <tr>
              <td bgcolor="#F6EDEF"><table width="213" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="35" background="images/tiao_bg.jpg">　　　</td>
                </tr>
                <tr>
                  <td height="25" align="center" valign="middle"><img src="images/li_01.gif" width="7" height="7" />　　   0386-8204574</td>
                </tr>
                <tr>
                  <td height="25" align="center" valign="middle"><img src="images/li_01.gif" alt="" width="7" height="7" />　　   0386-8204576</td>
                </tr>
                <tr>
                  <td height="25" align="center" valign="middle"><img src="images/li_01.gif" alt="" width="7" height="7" />　　   0386-8204578<br /></td>
                </tr>
                <tr>
                  <td height="25" align="center" valign="middle">&nbsp;</td>
                </tr>
              </table></td>
            </tr>
          </table></td>
        <td width="756" valign="top"><table width="730" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="30"><img src="images/fenlei.jpg" width="730" height="30" /></td>
          </tr>
          <tr>
            <td><p>&nbsp;</p>
              <form action="<%=MM_editAction%>" method="post" name="form1" id="form1">
                <table align="center">
                  <tr valign="baseline">
                    <td nowrap="nowrap" align="right">所属分类：</td>
                    <td><select name="CatalogID">
                        <%
While (NOT rsAllCatalogs.EOF)
%>
                        <option value="<%=(rsAllCatalogs.Fields.Item("CatalogID").Value)%>"><%=(rsAllCatalogs.Fields.Item("CatalogName").Value)%></option>
                        <%
  rsAllCatalogs.MoveNext()
Wend
If (rsAllCatalogs.CursorType > 0) Then
  rsAllCatalogs.MoveFirst
Else
  rsAllCatalogs.Requery
End If
%>
                      </select>
                    </td>
                  </tr>
                  <tr valign="baseline">
                    <td nowrap="nowrap" align="right">商品货号：</td>
                    <td><input type="text" name="productID" value="" size="32" />
                    </td>
                  </tr>
                  <tr valign="baseline">
                    <td nowrap="nowrap" align="right">商品名称：</td>
                    <td><input type="text" name="productName" value="" size="32" />
                    </td>
                  </tr>
                  <tr valign="baseline">
                    <td nowrap="nowrap" align="right">零售价格：</td>
                    <td><input type="text" name="MarketPrice" value="" size="32" />
                    </td>
                  </tr>
                  <tr valign="baseline">
                    <td nowrap="nowrap" align="right">会员价格：</td>
                    <td><input type="text" name="MemberPrice" value="" size="32" />
                    </td>
                  </tr>
                  <tr valign="baseline">
                    <td nowrap="nowrap" align="right">商品介绍：</td>
                    <td><textarea name="Introduce" cols="50" rows="5"></textarea>
                    </td>
                  </tr>
                  <tr valign="baseline">
                    <td nowrap="nowrap" align="right">商品详细说明：</td>
                    <td><textarea name="Explain" cols="50" rows="5"></textarea>
                    </td>
                  </tr>
                  <tr valign="baseline">
                    <td nowrap="nowrap" align="right">商品图片：</td>
                    <td><input type="text" name="img" value="" size="32" />
                    </td>
                  </tr>
                  <tr valign="baseline">
                    <td nowrap="nowrap" align="right">&nbsp;</td>
                    <td><input type="submit" value="插入记录" />
                    </td>
                  </tr>
                </table>
                <input type="hidden" name="MM_insert" value="form1" />
              </form>
              <p>&nbsp;</p></td>
          </tr>
        </table></td>
      </tr>
    </table>
</td>
  </tr>
</table>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="135" height="35" bgcolor="#FF86BA">&nbsp; </td>
    <td width="105" bgcolor="#FF86BA"><span class="STYLE9">关于我们　｜</span></td>
    <td width="100" bgcolor="#FF86BA"><span class="STYLE9">会员中心　｜</span></td>
    <td width="100" bgcolor="#FF86BA"><span class="STYLE9">产品中心　｜</span></td>
    <td width="100" bgcolor="#FF86BA"><span class="STYLE9">招商引资　｜</span></td>
    <td width="100" bgcolor="#FF86BA"><span class="STYLE9">联系我们　</span></td>
    <td width="340" bgcolor="#FF86BA">&nbsp;</td>
  </tr>
</table>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="80" align="center" valign="middle" bgcolor="#EAEAEA"><p class="STYLE10">版权所有： | Copyright© 2008 All rights reserved  地址:**********</p>
      <p><span class="STYLE10">电话:**********     　　传真:**********</span><br />
      </p></td>
  </tr>
</table>
</body>
</html>
<%
rsAllCatalogs.Close()
Set rsAllCatalogs = Nothing
%>
