<!--#include file="usertop.asp"-->
<!--#include file="usercookies.asp"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改商品--<%=title%>--<%=web%></title>
</head>

<body>
<script LANGUAGE=JavaScript>
  function textLimitCheck1(thisArea, maxLength){
    if (thisArea.value.length > maxLength){
      alert(maxLength + ' 个字限制. \r超出的将自动去除.');
      thisArea.value = thisArea.value.substring(0, maxLength);
      thisArea.focus();
    }
    /*回写span的值，当前填写文字的数量*/
    messageCount1.innerText = thisArea.value.length;
  }
</script>
<script LANGUAGE=JavaScript>
  function textLimitCheck(thisArea, maxLength){
    if (thisArea.value.length > maxLength){
      alert(maxLength + ' 个字限制. \r超出的将自动去除.');
      thisArea.value = thisArea.value.substring(0, maxLength);
      thisArea.focus();
    }
    /*回写span的值，当前填写文字的数量*/
    messageCount.innerText = thisArea.value.length;
  }
</script>
<div align="center">
<script language="JavaScript">
  function isDigit(c)
{
    if(c.length > 1){
        return false;
    }
    ic = c - '0';
    return ic >= 0 && ic <= 9;
}
function checkinput(){

        	if(form_fox.company.value.length<2 || form_fox.company.value.length>12 ){
            alert("标题名称在2-12字之间！");
            form_fox.company.focus();
            return false;
        }
	       if(form_fox.ad.value.length<1 || form_fox.ad.value.length>50 ){
            alert("简单内容！");
            form_fox.ad.focus();
            return false;
        } 
	       if(form_fox.memo.value.length<1 || form_fox.memo.value.length>500 ){
            alert("内容不合要求！");
            form_fox.memo.focus();
            return false;
        } 
			if(form_fox.class1.value == "0" || form_fox.class1.value == ""){
            alert("请选择商品大类！");
            form_fox.class1.focus();
            return false;
        } 
			if(form_fox.class2.value == "0" || form_fox.class2.value == ""){
            alert("请选择商品小类！");
            form_fox.class2.focus();
            return false;
        } 
            if(form_fox.youxiao.value == ""){
            alert("请输入有效期！");
            form_fox.youxiao.focus();
            return false;
        }  
            if(form_fox.jiage.value == ""){
            alert("请输入参考价格！");
            form_fox.jiage.focus();
            return false;
        }
            if(form_fox.lxrname.value == ""){
            alert("请输入您真实姓名！");
            form_fox.lxrname.focus();
            return false;
        } 
　　　　　　if(form_fox.usertel.value == ""){
            alert("请输入联系电话！");
            form_fox.usertel.focus();
            return false;
        } 

			if(form_fox.dizhi.value == ""){
            alert("请输入通讯地址！");
            form_fox.dizhi.focus();
            return false;
        } 
		　　if(form_fox.code.value == ""){
            alert("请输入邮编！");
            form_fox.code.focus();
            return false;
        } 
 
	if(form_fox.email.value == ""){
            alert("请输入您有效的电子邮件,方便我们能联系到您！");
            form_fox.email.focus();
            return false;
        }
    return true;
}  
function isEmail(strEmail) {
 if (strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
  return true;
 else
  alert("请输入您有效的电子邮件,方便我们能联系到您！");
}
</script>
<table cellSpacing="0" cellPadding="0" width="760" border="0" id="table1">
		<tr>
			<td  height="25" colspan="2" class="tdtop"><b>&nbsp;<img border="0" src="images/z1.gif" width="50" height="18"> 您的位置  
			<font color="#FFFFFF">-></font> <a class="scap1" href="index.htm"><%=title%></a>
			<font color="#FFFFFF">-></font> 修改商品：</b></td>
		</tr>
		<tr bgColor="#d9ebe5">
			<td  width="255" bgcolor="#FFFFFF" rowspan="2" valign="top">
            <!--#include file="caozuo.asp"-->
			</td>
		<tr bgColor="#d9ebe5">
			<td valign="top" width="505" height="315" bgcolor="#FFFFFF">
<%dim rso,sqlo,id,class1,class2,leixing
id=trim(request("id"))
set rso=server.createobject("adodb.recordset")
sqlo="select * from [FOX_shop] where UserName='"&UserName&"' and id="&cstr(id)&""
rso.open sqlo,conn,1,1
class1=rso("class1")
class2=rso("class2")
leixing=rso("leixing")
%>
			<table border="1" width="100%" id="table2" bordercolorlight="#D9EBE5" bordercolordark="#D9EBE5" style="border-collapse: collapse" cellpadding="0" cellspacing="0">
				<tr>
					<td class="tdtxt07" bgcolor="#D9EBE5">&nbsp;<img border="0" src="images/a01.gif" width="25" height="25">
用户：<font color="#FF0000"><%=username%></font>，您好，欢迎来到会员中心！您登陆本站共<font color="#FF0000"><%=rsuser("dlcs")%></font>次。<br>
您目前级别：<%if rsuser("huitype")="0" then%><font color="#FF0000"><%=aname%>会员</font><%elseif rsuser("huitype")="1" then%><font color="#FF0000"><%=bname%>会员</font><%elseif rsuser("huitype")="2" then%><font color="#FF0000"><%=cname%>会员</font><%end if%>
，验证状态：<%if rsuser("yz")="0" then%><font color="#FF0000">没有通过验证</font>，验证后才可以享受更多权利！<%elseif rsuser("yz")="1" then%><font color="#FF0000">已通过验证</font>，祝您愉快！<%end if%></td>
				</tr>
				<tr>
					<td class="tdtxt07" bgcolor="#D9EBE5" height="20">
					<table border="0" width="100%" id="table3" cellspacing="1" height="456">
						<tr>
							<td bgcolor="#FFFFFF" colspan="2" height="40" class="tdtxt07">
							<p align="center">
							<img border="0" src="images/a01.gif" width="25" height="25"><b>修改商品</b>（
							修改将扣除您 <font color="#FF0000"><%=xghjf%></font> 分）
</td>
						</tr>
	<form name="form_fox" onsubmit="return checkinput()" method="post" action="speditchk.asp">

						<input name="xiang" type="hidden" value="<%=rso("xiang")%>"><input name="shi" type="hidden" value="<%=rso("shi")%>"><input name="sheng" type="hidden" value="<%=rso("sheng")%>">
			<input name="yz" type="hidden" value="<%=rsuser("yz")%>"><input name="username" type="hidden" value="<%=rso("username")%>">

						<tr>
							<td bgcolor="#FFFFFF" width="22%" height="30" align="right">
							<font color="#FF0000">商品标题：</font></td>
							<td bgcolor="#FFFFFF" height="30" width="77%">
			<input id="topic6" maxLength="12" size="20" name="company" class="button01" value="<%=rso("company")%>"> <font color="#FF0000">
			*</font><input name="xxid" type="hidden" value="<%=rso("xxid")%>"></td>
						</tr>
<tr>
							<td bgcolor="#FFFFFF" width="22%" height="30" align="right">
							商品所属：</td>
							<td bgcolor="#FFFFFF" width="77%" height="30" align="right">
							<p align="left">
<%dim rsm,sqlm
dim count,i
Set rsm=Server.CreateObject("ADODB.Recordset")
sqlm = "select * from FOX_shopclass2 order by paixu desc"
rsm.open sqlm,conn,1,1
%><SCRIPT language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        <%
        count = 0
        do while not rsm.eof 
        %>
        subcat[<%=count%>] = new Array("<%= trim(rsm("class2"))%>","<%= trim(rsm("class1"))%>","<%= trim(rsm("id"))%>");
        <%
        count = count + 1
        rsm.movenext
        loop
        rsm.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.form_fox.class2.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.form_fox.class2.options[document.form_fox.class2.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</SCRIPT>
  <%
sqlm = "select * from FOX_shopclass1 order by paixu desc"
rsm.open sqlm,conn,1,1
if rsm.eof and rsm.bof then
response.write "请先添加分类。"
response.end
else
%>&nbsp;&nbsp;
  <SELECT name="class1" onChange="changelocation(document.form_fox.class1.options[document.form_fox.class1.selectedIndex].value)" size="1">
	  <OPTION value="0">＝一级分类＝</OPTION>
	  <%do while not rsm.eof%>
	  <OPTION  <%if trim(class1)=cstr(rsm("id")) then%>selected<%end if%>  value="<%=trim(rsm("id"))%>"><%=trim(rsm("class1"))%></OPTION>
          <%
        rsm.movenext
        loop
	    end if
        rsm.close
        %>
  </SELECT>
  <SELECT name="class2">
  <%
sqlm = "select id,class2 from FOX_shopclass2 where id="&cstr(class2)
rsm.open sqlm,conn,1,1
%>
  <OPTION  <%if trim(class2)=cstr(rsm("id")) then%>selected<%end if%>  value="<%=trim(rsm("id"))%>"><%=trim(rsm("class2"))%></OPTION>
  <%rsm.close%>
  </SELECT></td>
						</tr>
<%
dim rs1,sql1
set rs1=server.createobject("adodb.recordset")
sql1 = "select * from [FOX_leis] where id="&cstr(leixing)
rs1.open sql1,conn,1,1
%>    
						<tr>
							<td bgcolor="#FFFFFF" width="22%" height="30" align="right">
							商品类型：</td>
							<td bgcolor="#FFFFFF" height="30" width="77%">
	<select size="1" name="leixing" style="BACKGROUND-COLOR: #eeeeee; BORDER-BOTTOM: #FFFFFF 1px solid; BORDER-LEFT: #a2a2a2 1px solid; BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #a2a2a2 1px solid; COLOR: red; FONT-SIZE: 9pt; HEIGHT: 19px;">
                                <option <%if trim(leixing)=cstr(rs1("id")) then%>selected<%end if%> value="<%=trim(rs1("id"))%>" selected><%=trim(rs1("leixing"))%></option>
<%rs1.close
set rs1=nothing
set rs1=server.createobject("adodb.recordset")
sql1 = "select * from [FOX_leis] order by paixu desc"
rs1.open sql1,conn,1,1
do while not rs1.eof%>
         <option value="<%=rs1("id")%>"><%=rs1("leixing")%></option>
<%rs1.movenext
loop
rs1.close
set rs1=nothing%>						</select> <font color="#FF0000">*</font></td>
						</tr>
						<tr>
							<td bgcolor="#FFFFFF" width="22%" height="30" align="right">
							市场价：</td>
							<td bgcolor="#FFFFFF" width="77%" height="30" align="right">
							<p align="left">
							<input id="topic10" maxLength="6" size="6" name="jiage" class="button01" value="<%=rso("jiage")%>"> 
			元&nbsp;<font color="#FF0000">* （“0”为未知）</font></td>
						</tr>
						<tr>
							<td bgcolor="#FFFFFF" width="22%" height="30" align="right">
							本店价：</td>
							<td bgcolor="#FFFFFF" width="77%" height="30" align="right">
							<p align="left">
							<input id="topic8" maxLength="6" size="6" name="jiages" class="button01" value="<%=rso("jiages")%>"> 
			元&nbsp;<font color="#FF0000">* （“0”为面议）</font></td>
						</tr>
<tr>
							<td bgcolor="#FFFFFF" width="22%" height="30" align="right">
							简单介绍：</td>
							<td bgcolor="#FFFFFF" height="30" width="77%">
			<textarea  class="button02" rows="3" onkeyUp="textLimitCheck1(this, 30);" name="ad" cols="21"><%=rso("ad")%></textarea>&nbsp;<font color="#FF0000">*</font><br><font color=#666666>限 5-30 个字符  已输入 <font color="#CC0000"><span id="messageCount1">0</span></font> 个字</font></td>
						</tr>
						<tr>
							<td bgcolor="#FFFFFF" width="22%" height="30" align="right">
							详细内容：</td>
							<td bgcolor="#FFFFFF" height="30" width="77%">
			<textarea  class="button02" rows="8" onkeyUp="textLimitCheck(this, 500);" name="memo" cols="48"><%=rso("memo")%></textarea>&nbsp;<font color="#FF0000">*</font><br><font color=#666666>限 5-500 个字符  已输入 <font color="#CC0000"><span id="messageCount">0</span></font> 个字</font></td>
						</tr>
						<tr>
							<td bgcolor="#FFFFFF" width="22%" height="30" align="right">
							库存数量：</td>
							<td bgcolor="#FFFFFF" height="30" width="77%">
							<input id="topic11" maxLength="6" size="6" name="youxiao" class="button01" value="<%=rso("youxiao")%>"></td>
						</tr>
						<tr>
							<td bgcolor="#FFFFFF" width="99%" height="38" align="right" colspan="2">
							<p align="center">
			<input class="inputb" border="0" name="I5" type="submit" value="修改商品"></td>
						</tr></form>
					</table>
					</td>
				</tr>
			</table>
			</td>
			</tr>

</table>
<%rso.close
set rso=nothing
rsuser.close
set rsuser=nothing%>
</div>

</body>
<!--#include file="userbottom.asp"--></body></html>