<!--#include file="../here99login/0.asp"-->
<!--#include file="../conn/zkconn.asp"-->
 <%
page=request("page")
cpid=request("cpid")
 sql="select * from chanpin where cpid="&request("cpid")
set rs=server.createobject("adodb.recordset")
set rs = conn.execute(Sql)
cpid = rs("cpid")
lbid = rs("lbid")
xlbid = rs("xlbid")
bh=rs("bh")
mc=rs("mc")
jg=rs("jg")
rmb=rs("rmb")
js=rs("js")
st=rs("st")
tp=rs("tp")
cj=rs("cj")
cjurl=rs("cjurl")
rq=rs("rq")
sl=rs("sl")
cang=rs("cang")
v1=rs("v1")
v2=rs("v2")
v3=rs("v3")
v4=rs("v4")
v5=rs("v5")

if rs.eof and rs.bof then
	response.write "<script>alert(""出现异常错误"");window.close();</script>"
	Response.end
End if
rs.close 


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>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="../css/css.css" rel="stylesheet" type="text/css">
</head>
<body><br>
<form action="ok-xiugai.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.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 ( document.myform.rmb.value == '' ) {
			window.alert('产品优惠价不能空!!');
			document.myform.rmb.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" bgcolor="#CCCCCC"> 
      <td height="25" colspan="4"><font color="#FF3333">&gt;&gt;产品资料修改</font></td>
    </tr>
    <tr valign="middle" bgcolor="#f1f1f1"> 
      <td width="97" height="25" align="center">产品类别</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)">
          <%do while not rs.eof%>
          <option value="<%=trim(rs("lbid"))%>" <%if rs("lbid") = lbid then response.write "Selected"%>><%=trim(rs("lbname"))%></option>
          <%
        				rs.movenext
       					loop
						end if
       					rs.close
						%>
        </select> <select name="xlbid" class="wenbenkuang">
          <%
			Set rs = conn.execute("Select * from xlb where lbid = " & lbid)
			do while not rs.eof
			%>
          <option value="<%=rs("xlbid")%>" <%if rs("xlbid") = xlbid then response.write "Selected"%>><%=rs("xlbname")%></option>
          <%
			rs.movenext
			loop
			rs.close
set rs=nothing
			%>
        </select> <font color="#FF3333">*</font> </td>
    </tr>
    <tr valign="middle" bgcolor="#f1f1f1"> 
      <td height="25" align="center">产品编号</td>
      <td height="25" colspan="3" bgcolor="#f1f1f1"><input name="bh" type="text" class="wenbenkuang" id="bh" value="<%=bh%>" size="15" maxlength="25"></td>
    </tr>
    <tr valign="middle" bgcolor="#f1f1f1"> 
      <td height="25" align="center">产品名称</td>
      <td height="25" colspan="3"> <input name="mc" type="text" class="wenbenkuang" id="mc" value="<%=mc%>" size="50" maxlength="50"> 
        <font color="#FF3333">*</font> </td>
    </tr>
    <tr valign="middle" bgcolor="#f1f1f1"> 
      <td height="25" align="center">产品价格</td>
      <td width="129" height="25"> <input name="jg" type="text" class="wenbenkuang" id="jg" value="<%=jg%>" size="15" maxlength="20"> 
        <font color="#FF3333">*</font> </td>
      <td width="76" height="25" align="center">优惠价格</td>
      <td width="186" height="25"><input name="rmb" type="text" class="wenbenkuang" id="rmb5" value="<%=rmb%>" size="15" maxlength="20"></td>
    </tr>
    <tr valign="middle" bgcolor="#f1f1f1"> 
      <td height="25" align="center">产地厂家</td>
      <td height="25" colspan="3"> <input name="cj" type="text" class="wenbenkuang" id="cj" value="<%=cj%>" size="50" maxlength="50"> 
        <font color="#FF3333">*</font> </td>
    </tr>
    <tr valign="middle" bgcolor="#f1f1f1"> 
      <td height="25" align="center">厂家网址</td>
      <td height="25" colspan="3"> <input name="cjurl" type="text" class="wenbenkuang" id="cjurl" value="<%=cjurl%>" size="50" maxlength="50"> 
      </td>
    </tr>
    <tr valign="middle" bgcolor="#f1f1f1"> 
      <td height="25" align="center">产品缩图</td>
      <td height="25" colspan="3"> <input name="st" type="text" class="wenbenkuang" id="st" value="<%=st%>" size="40" maxlength="50"> 
        <a href="shangchuan2.asp" OnClick='return openAdminWindow(this.href);'>缩图上传</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" bgcolor="#f1f1f1"> 
      <td height="25" align="center">产品全图</td>
      <td height="25" colspan="3"> <input name="tp" type="text" class="wenbenkuang" id="tp" value="<%=tp%>" size="40" maxlength="50"> 
        <a href="shangchuan.asp" OnClick='return openAdminWindow(this.href);'>全图上传</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" bgcolor="#f1f1f1"> 
      <td height="25" align="center">产品简介</td>
      <td height="25" colspan="3"> <textarea name="js" cols="60" rows="6" class="wenbenkuang" id="js"><%=js%></textarea> 
        <font color="#FF3333">*</font> </td>
    </tr>
    <tr valign="middle" bgcolor="#f1f1f1"> 
      <td height="25" align="center" bgcolor="#f1f1f1">产品人气</td>
      <td height="25"><input name="rq" type="text" class="wenbenkuang" id="rq" value="<%=rq%>" size="15" maxlength="20"></td>
      <td height="25" align="center">库存数量</td>
      <td height="25"><input name="sl" type="text" class="wenbenkuang" id="zs2" value="<%=sl%>" size="15" maxlength="20"> 
      </td>
    </tr>
    <tr valign="middle" bgcolor="#f1f1f1"> 
      <td height="25" align="center"> <input <%If cang = true Then Response.Write("CHECKED") : Response.Write("")%> type="checkbox" name="cang" value="true" onFocus="this.blur()">
        产品隐藏</td>
      <td height="25" colspan="3"> <input name="Submit3" type="submit" class="go-wenbenkuang" value="提交" ONCLICK="javascript:return checksignup()"> 
        <input name="Submit22" type="reset" class="go-wenbenkuang" value="重置"> 
        <input name="Submit223" type="button" class="go-wenbenkuang" id="Submit223" onclick="javascript:window.history.go(-1)" value="返回"> 
        <input name=cpid type=hidden id="cpid" value=<%=cpid%>> 
        <input name="page" type="hidden" id="page" value="<%=page%>"></td>
    </tr>
    <tr valign="middle" bgcolor="#f1f1f1">
      <td height="25" align="center">会员投票</td>
      <td height="25" colspan="3"> 很好： 
        <input name="v1" type="text" class="wenbenkuang" id="v1" value="<%=v1%>" size="3" maxlength="10">
        好： 
        <input name="v2" type="text" class="wenbenkuang" id="v2" value="<%=v2%>" size="3" maxlength="10">
        一般： 
        <input name="v3" type="text" class="wenbenkuang" id="v3" value="<%=v3%>" size="3" maxlength="10">
        差： 
        <input name="v4" type="text" class="wenbenkuang" id="v4" value="<%=v4%>" size="3" maxlength="10">
        很差： 
        <input name="v5" type="text" class="wenbenkuang" id="v5" value="<%=v5%>" size="3" maxlength="10"></td>
    </tr>
  </table>
</form>

</body>
</html>