<!-- #include virtual = "/include/myopen.asp" -->
<%
	set RS = Server.CreateObject("ADODB.RecordSet")
	set RS1 = Server.CreateObject("ADODB.RecordSet")
%>
<%'类别填加
	'判断用户是否登陆过
	IF Request.Cookies ("Admin_name") = "" OR Request.Cookies ("Admin_Pass") ="" THEN
	'没有登陆
	Response.Redirect ("/manage/Admin_Login.ASP")
	END IF
	IF REQUEST("HOME") <> "" THEN
	Response.Redirect ("/manage/default.asp")
	END IF
	IF REQUEST("Add") <> "" THEN
	Response.Redirect ("/manage/name_add.asp")
	END IF
	'用户已经成功注册

'产生随即编号
SQL = "SELECT CARD_ID FROM ID "
	RS.Open SQL,CONN,adOpenStatic ,adLockReadOnly
		P_P_NO=RS(0)
	P_NO = RS(0) + 1
	SQL = "UPDATE ID SET CARD_ID = '" & P_NO & "'"
	CONN.Execute (SQL)
	RS.Close 
  %>
  <script language="javascript">

var lsdz = "";
function checkIn()
{
    

    if( document.un.no1.value.length <1) {
      alert("编号必须填写");
      document.un.no1.focus();
      return false;
   }
 
    if( document.un.lb.value.length <1) {
      alert("名称必须填写");
      document.un.lb.focus();
      return false;
   } 
   
    if( document.un.jg.value.length <1) {
      alert("价格必须填写");
      document.un.jg.focus();
      return false;
   }
    if( document.un.bjg.value.length <1) {
      alert("优惠价格必须填写");
      document.un.bjg.focus();
      return false;
   } 
       
   
}
</script>
 <html>
<head>
<title>商品添加</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
td {  font-size: 9pt; line-height: 16pt}
.main {  font-size: 9pt}
-->
</style>
</head>

<body bgcolor="#FFFFFF">
<table width="200" border="0" cellspacing="0" cellpadding="0" align="center" class="main">
  <tr>
    <td>
      <div align="center"><font color="#3333CC" size="3">商 品 添 加</font></div>
    </td>
  </tr>
</table>
<p class="main">图片的路径请输入全部路径 
<form method="post" action="name_save.asp" name="un" onSubmit="return checkIn();">
  <table width="700" border="1" cellspacing="0" cellpadding="1" bordercolor="#CCFFFF" bordercolorlight="#66CCFF" bordercolordark="#FFFFFF" align="center">
    <tr bgcolor="#D5F1FB"> 
      <td width="149"> 
        <div align="center">商品编号：</div>
      </td>
      <td width="190"> 
        <input type="hidden" name="num" size="20" value="<%=P_P_NO%>">
        <input type="text" name="no1" size="15">
      </td>
      <td width="159"> 
        <div align="center">所属总类别：</div>
      </td>
      <td width="241"> 
        <select name="class">
          <%
			SQL1 = "SELECT DISTINCT CLASS_NAME FROM CLASS"
			RS1.Open SQL1,CONN,adOpenKeyset ,adLockReadOnly
				IF RS1.RecordCount >0 THEN
					DO WHILE NOT RS1.EOF 
						
			%> 
          <option value="<%=RS1("CLASS_NAME")%>"><%=RS1("CLASS_NAME")%></option>
          <%
					RS1.MoveNext 
					LOOP
				END IF
			RS1.Close 
				%> 
        </select>
      </td>
    </tr>
    <tr bgcolor="#D5F1FB"> 
      <td width="149"> 
        <div align="center">所属次类别：</div>
      </td>
      <td width="190"> 
        <select name="Zlb">
          <%
			SQL1 = "SELECT DISTINCT CLASS_NAME FROM CLASS"
			RS1.Open SQL1,CONN,adOpenKeyset ,adLockReadOnly
				IF RS1.RecordCount >0 THEN
					DO WHILE NOT RS1.EOF 
						
			%> 
          <option value="<%=RS1("CLASS_NAME")%>"><%=RS1("CLASS_NAME")%></option>
          <%
					RS1.MoveNext 
					LOOP
				END IF
			RS1.Close 
				%> 
        </select>
      </td>
      <td width="159"> 
        <div align="center">商品名称： </div>
      </td>
      <td width="241"> 
        <input type="text" name="lb" size="30">
      </td>
    </tr>
    <tr bgcolor="#D5F1FB"> 
      <td width="149"> 
        <div align="center">零售价格：</div>
      </td>
      <td width="190"> 
        <input type="text" name="jg" size="15">
      </td>
      <td width="159"> 
        <div align="center">优惠价格：</div>
      </td>
      <td width="241"> 
        <input type="text" name="bjg" size="15">
      </td>
    </tr>
    <tr bgcolor="#D5F1FB"> 
      <td width="149" height="35"> 
        <div align="center">图片名称(大)：</div>
      </td>
      <td colspan="3" height="35"> 
        <input type="text" name="zmtp" size="50">
      </td>
    </tr>
    <tr bgcolor="#D5F1FB"> 
      <td width="149" height="35"> 
        <div align="center">大图片说明：</div>
      </td>
      <td colspan="3" height="35"> 
        <input type="text" name="zmta" size="50">
      </td>
    </tr>
    <tr bgcolor="#D5F1FB"> 
      <td width="149" height="35"> 
        <div align="center">图片名称(小)：</div>
      </td>
      <td colspan="3" height="35"> 
        <input type="text" name="bmtp" size="50">
      </td>
    </tr>
    <tr bgcolor="#D5F1FB"> 
      <td width="149" height="35"> 
        <div align="center">小图片说明：</div>
      </td>
      <td colspan="3" height="35"> 
        <div align="left"> 
          <input type="text" name="bmta" size="50">
        </div>
      </td>
    </tr>
    <tr bgcolor="#D5F1FB"> 
      <td width="149"> 
        <div align="center">数量单位：</div>
      </td>
      <td width="190"> 
        <input type="text" name="dw" size="10">
      </td>
      <td width="159"> 
        <div align="center">记录特性：</div>
      </td>
      <td width="241"> 
        <select name="status">
          <option value="常规商品" selected>常规商品</option>
          <option value="特卖商品">特卖商品</option>
          <option value="推荐商品">推荐商品</option>
          <option value="最新商品">最新商品</option>
          <option value="特价商品">特价商品</option>
        </select>
      </td>
    </tr>
    <tr bgcolor="#D5F1FB"> 
      <td width="149"> 
        <div align="center">商品介绍：</div>
      </td>
      <td colspan="3"> 
        <textarea name="bz" cols="60" rows="3"></textarea>
      </td>
    </tr>
  </table>
  <div align="center">
    <input type="submit" name="asave" value="添 加">
    <input type="reset" name="reset" value="重 填">
    <input type="submit" name="home" value="主 页">
    <input type="button" name="Button" value="返 回" onclick="history.back()">
  </div>
</form>
</body>
</html>

