<!--#include file="../here99login/0.asp"-->
<!--#include file="../conn/zkconn.asp" -->
<%
dim rs
dim count
set rs = conn.execute("select * from xlb order by xlbid asc")
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("xlbname"))%>","<%= trim(rs("lbid"))%>","<%= trim(rs("xlbid"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.xlbid.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.xlbid.options[document.myform.xlbid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<link href="../css/css.css" rel="stylesheet" type="text/css">

      <form action="ok-tianjia.asp" method="post" name="myform" id="myform">
  <script language="javascript">
	<!--//
	function checksignup() {

		if ( document.myform.lbid.value == '' ) {
			window.alert('请选择产品类别!!');
			document.myform.lbid.focus();
			
		}
		else if ( document.myform.xlbid.value == '' ) {
			window.alert('小类别不能为空，请先加入该大类下的小类别!!');
			document.myform.xlbid.focus();
		}
		else if ( document.myform.sl.value == '' ) {
			window.alert('产品数量不能为空!!');
			document.myform.sl.focus();
		}
		else if (isNaN( document.myform.sl.value)) {
			window.alert('产品数量只能是数字!!');
			document.myform.sl.focus();
		}
		else if ( document.myform.bh.value == '' ) {
			window.alert('请输入产品编号!!');
			document.myform.bh.focus();
		}
		else if ( document.myform.mc.value == '' ) {
			window.alert('请输入产品名称!!');
			document.myform.mc.focus();
		}
		else if ( document.myform.jg.value == '' ) {
			window.alert('请输入产品售价!!');
			document.myform.jg.focus();
		}
		else if (isNaN( document.myform.jg.value)) {
			window.alert('请输入产品售价，只能是数字!!');
			document.myform.jg.focus();
		}
		else if ( document.myform.cj.value == '' ) {
			window.alert('请输入产品产地或厂家!!');
			document.myform.cj.focus();
		}
		else if ( document.myform.js.value == '' ) {
			window.alert('请输入产品介绍!!');
			document.myform.js.focus();
		}
       else if (document.myform.js.value.length>5000)
  {
  window.alert("产品介绍不能超过5000字！");
  document.myform.js.focus();
  }
else {
			return true;
			}
		return false;
	}

	//-->
	</script>
  <table width="500" align="center" cellpadding="0" cellspacing="2">
    <tr valign="middle"> 
      <td height="25" colspan="4" bgcolor="#CCCCCC"><font color="#FF3333">&gt;&gt;产品添加</font></td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#f1f1f1">产品类别</td>
      <td height="25" colspan="3" bgcolor="#f1f1f1"> 
        <%
					set rs = conn.execute("select * from lb")
					if rs.eof and rs.bof then
						response.write "请先添加类别。"
						response.end
					else
					%> <select name="lbid" size="1" class="wenbenkuang" onChange="changelocation(document.myform.lbid.options[document.myform.lbid.selectedIndex].value)">
          <option value="" selected>==请选大类别==</option>
          <%do while not rs.eof%>
          <option value="<%=trim(rs("lbid"))%>"><%=trim(rs("lbname"))%></option>
          <%
        				rs.movenext
       					loop
						end if
       					rs.close
        				set rs = nothing
        				conn.Close
        				set conn = nothing
						%>
        </select> <select name="xlbid" class="wenbenkuang">
          <option selected value="">==请选小类别==</option>
        </select></td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#f1f1f1">产品数量</td>
      <td height="25" colspan="3" bgcolor="#f1f1f1"> 
        <input name="sl" type="text" class="wenbenkuang" id="sl" size="10" maxlength="20"> 
        <font color="#FF3333">*</font> </td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#f1f1f1">产品编号</td>
      <td height="25" colspan="3" bgcolor="#f1f1f1"> 
        <input name="bh" type="text" class="wenbenkuang" id="bh" size="25" maxlength="25"> 
        <font color="#FF3333">*</font> </td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#f1f1f1">产品名称</td>
      <td height="25" colspan="3" bgcolor="#f1f1f1"> 
        <input name="mc" type="text" class="wenbenkuang" id="mc" size="40" maxlength="28"> 
        <font color="#FF3333">*</font> </td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#f1f1f1">产品价格</td>
      <td width="98" height="25" bgcolor="#f1f1f1"> 
        <input name="jg" type="text" class="wenbenkuang" id="jg" size="10" maxlength="20"> 
        <font color="#FF3333">*</font></td>
      <td width="75" align="center" bgcolor="#f1f1f1">优惠价格</td>
      <td width="232" bgcolor="#f1f1f1">
<input name="rmb" type="text" class="wenbenkuang" id="rmb" size="10" maxlength="20"> 
      </td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#f1f1f1">产地厂家</td>
      <td height="25" colspan="3" bgcolor="#f1f1f1"> 
        <input name="cj" type="text" class="wenbenkuang" id="cj" size="40" maxlength="45"> 
        <font color="#FF3333">*</font> </td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#f1f1f1">厂家网址</td>
      <td height="25" colspan="3" bgcolor="#f1f1f1"> 
        <input name="cjurl" type="text" class="wenbenkuang" id="cjurl" value="http://" size="40" maxlength="45"> 
      </td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#f1f1f1">产品缩图</td>
      <td height="25" colspan="3" bgcolor="#f1f1f1"> 
        <input name="st" type="text" class="wenbenkuang" id="st" size="40" maxlength="50"> 
        <a href="shangchuan2.asp" OnClick='return openAdminWindow(this.href);'>&gt;&gt;上传</a> 
        <script language=""javascript"">function openAdminWindow(url) {	popupWin = window.open(url,'new_page','width=350,height=250');	return false;}</script>
      </td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#f1f1f1">产品全图</td>
      <td height="25" colspan="3" bgcolor="#f1f1f1"> 
        <input name="tp" type="text" class="wenbenkuang" id="tp" size="40" maxlength="50"> 
        <a href="shangchuan.asp" OnClick='return openAdminWindow(this.href);'>&gt;&gt;上传</a> 
        <script language=""javascript"">function openAdminWindow(url) {	popupWin = window.open(url,'new_page','width=350,height=250');	return false;}</script></td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#f1f1f1">产品简介</td>
      <td height="25" colspan="3" bgcolor="#f1f1f1"> 
        <textarea name="js" cols="60" rows="6" class="wenbenkuang" id="js"></textarea> 
        <font color="#FF3333">*</font></td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#f1f1f1"> 
        <input type="checkbox" name="cang" value="true" onFocus="this.blur()">
        产品隐藏 </td>
      <td height="25" colspan="3" bgcolor="#f1f1f1"> 
        <input name="Submit" type="submit" class="go-wenbenkuang" value="提交" ONCLICK="javascript:return checksignup()"> 
        <input name="Submit2" type="reset" class="go-wenbenkuang" value="重置"></td>
    </tr>
    <tr valign="middle"> 
      <td height="25" colspan="4"><font color="#FF9966"><strong>注：</strong></font>产品类别您可自己编号，以科学的管理您的产品。<br>
        &nbsp;&nbsp;&nbsp;&nbsp;如果产品的优惠售价为空，则产品优惠售价将自动成为产品价格。<br>
        &nbsp;&nbsp;&nbsp;&nbsp;同时须注意产品售价不能小于等于&quot;0&quot;。<br>
        &nbsp;&nbsp;&nbsp;&nbsp;产品如果不添加图片信息，将使用默认图片。(/admin/image/no.gif) 
      </td>
    </tr>
  </table>
</form>

