<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<!--#include file="top.asp"-->
<table width="762" border="0" align="center" cellpadding="2" cellspacing="0" style='BORDER-COLLAPSE: collapse;MARGIN: 3px'>
  <tr> 
    <td height="15" colspan="2"></td>
  </tr>
  <tr> 
    <td width="180" valign="top">
<!--#include file="left.asp"-->
    </td>
<td width="582" height="280" valign="top">
<%'禁止网页缓存及涮新
Response.Buffer = True 
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache"
if request("xiu")="yes" then
if Request("id")="" or isempty(request("id")) then
Response.Write "系统拒绝了您的错误操作请求"
response.end
end if
lbid=shopnet("lbid")
xlbid=shopnet("xlbid")
if shopnet("slbid")="" then slbid=0 else slbid=shopnet("slbid")
userlbid=shopnet("userlbid")
bh=shopnet("bh")
mc=shopnet("mc")
jp=left(shopnet("jp"),300)
js=left(shopnet("js"),3000)
if shopnet("fs")=0 then
jg1=FormatNumber(ccur(request("jg1")),2)
jg2=FormatNumber(ccur(request("jg2")),2)
jg3=FormatNumber(ccur(request("jg3")),2)
'价格判断
if jg1<=0 or jg2<=0 then
Response.Write("<script>alert(""您的产品销售价格不能小于等于0！"");history.back();</script>")
Response.end
end if
cp_sj=clng(shopnet("cp_sj"))
elseif shopnet("fs")=1 then
jg1=clng(shopnet("p_jg1"))
jg2=clng(shopnet("p_jg1"))
jg3=clng(shopnet("p_jg2"))
'价格判断
if jg1<=0 or jg2<=0 or jg3<=0 then
Response.Write("<script>alert(""价格不能小于等于0！"");history.back();</script>")
Response.end
end if
elseif shopnet("fs")=2 then
cp_sj=clng(shopnet("cp_sj"))
end if
xt=shopnet("xt")
zt=shopnet("zt")
dt=shopnet("dt")
cj=shopnet("cj")
If xt="" then
xt="xt.gif"
end if
If zt="" then
zt="zt.gif"
end if
If dt="" then
dt="zt.gif"
end if
If request("cang")="" then
cang=0
else
cang=1
end if
If request("user_tui")="" then
user_tui=0
else
user_tui=1
end if
'图片判断
if not(right(lcase(xt),4)=".gif" or right(lcase(xt),4)=".jpg") or not(right(lcase(zt),4)=".gif" or right(lcase(zt),4)=".jpg") or not(right(lcase(dt),4)=".gif" or right(lcase(dt),4)=".jpg") then
Response.Write("<script>alert(""您的产品图片不符合规范，只能为gif或jpg格式。"");history.back();</script>")
Response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from chanpin where userid="&myuserid&" and id="&shopnet("id")&"" 
rs.open sql,conn,1,3
rs("lbid")=lbid
rs("xlbid")=xlbid
rs("slbid")=slbid
rs("userlbid")=userlbid
rs("bh")=bh
rs("mc")=mc
rs("jg1")=jg1
rs("jg2")=jg2
rs("jg3")=jg3
if shopnet("fs")=0 or shopnet("fs")=2 then
if shopnet("xs")=0 and cp_sj>0 then
rs("sj2")=rs("sj2")+cp_sj
elseif shopnet("xs")=1 and cp_sj>0 then
rs("sj2")=rs("sj2")-cp_sj
end if
end if
rs("jp")=jp
rs("js")=js
rs("xt")=xt
rs("zt")=zt
rs("dt")=dt
rs("cj")=cj
rs("cang")=cang
rs("user_tui")=user_tui
rs("tui")=1
rs.update
rs.close
set rs=nothing
Response.Write "<script>alert(""修改产品成功"");location.href=""rikeeshopindex.asp?abc=cpgl"";</script>"
Response.end
end if
set rs = conn.execute("select xlbid,xlbname,lbid from xlb order by xlbid")%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%count = 0
do while not rs.eof
Response.Write "subcat["&count&"] = new Array('"&rs("xlbname")&"','"&rs("lbid")&"','"&rs("xlbid")&"');"&chr(10)&""
count = count + 1
rs.movenext
loop
rs.close
set rs=nothing%>
onecount=<%=count%>;  
<%set rs = conn.execute("select slbid,slbname,xlbid,lbid from slb order by slbid")%>
var onecount2;
onecount2=0;
subcat2 = new Array();
<%count2 = 0
do while not rs.eof
Response.Write "subcat2["&count2&"] = new Array('"&rs("slbname")&"','"&rs("xlbid")&"','"&rs("slbid")&"');"&chr(10)&""
count2 = count2 + 1
rs.movenext
loop
rs.close
set rs=nothing%>
onecount2=<%=count2%>;
function changelocation(locationid){
document.myform.xlbid.length = 0; 
document.myform.slbid.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]);
}}} ; 
function changelocation2(villageid){
document.myform.slbid.length = 0; 
var villageid=villageid;
var j;
for (j=0;j < onecount2; j++){
if (subcat2[j][1] == villageid){ 
document.myform.slbid.options[document.myform.slbid.length] = new Option(subcat2[j][0], subcat2[j][2]);}}} 
function changeInfo() {
if (document.getElementById('catInfo')) {
var rootCat = document.forms['myform'].elements['lbid'];
var subCat = document.forms['myform'].elements['xlbid'];
var subCat3 = document.forms['myform'].elements['slbid'];
var str = '';
var rootCatName = '';
var subCatName = '';
var subCatName3 = '';
if (rootCat && rootCat.selectedIndex>=0) {
rootCatName = rootCat.options[rootCat.selectedIndex].innerHTML;
str = rootCatName;
if (subCat && subCat.selectedIndex>=0) {
subCatName = subCat.options[subCat.selectedIndex].innerHTML;
if (subCatName.length > 0) {
str += ' &gt;&gt; ' + subCatName;}
if (subCat3 && subCat3.selectedIndex >= 0) {
subCatName3 = subCat3.options[subCat3.selectedIndex].innerHTML;
if (subCatName3.length > 0) {
str += ' &gt;&gt; ' + subCatName3;}}}}
document.getElementById('catInfo').innerHTML = str;
window.setTimeout('changeInfo()', 500);}} 
function checksignup() {
if ( document.myform.lbid.value == '' ) {
window.alert('请正确选择产品一级归类，一级二级归类不能为空!!');
return false;}
if ( document.myform.xlbid.value == '' ) {
window.alert('请正确选择产品二级归类，一级二级归类不能为空!!');
return false;}
if ( document.myform.mc.value == '' ) {
window.alert('请输入产品名称!!');
document.myform.mc.focus();
return false;}
if (( document.myform.fs.item(0).checked)){if(( document.myform.jg1.value == '' )||( document.myform.jg1.value<=0)||( document.myform.jg2.value == '' )||( document.myform.jg2.value<=0)||( document.myform.jg3.value == '' )||( document.myform.jg3.value<=0 )||(isNaN( document.myform.jg1.value))||(isNaN( document.myform.jg2.value))||(isNaN( document.myform.jg3.value)))  {
window.alert('请输入正确的销售价格，价格只能为数值，网上价格和支付宝价不能为空或小于等于0元!!');
return false;}}
if (( document.myform.fs.item(1).checked)){if(( document.myform.p_jg1.value == '' )||( document.myform.p_jg1.value<=0)||( document.myform.p_jg2.value == '' )||( document.myform.p_jg2.value<=0 )||(isNaN( document.myform.p_jg1.value))||(isNaN( document.myform.p_jg1.value)))  {
window.alert('请输入正确的拍卖价格，只能为大于等于0的数值!');
return false;}}
if ((!document.myform.fs.item(1).checked)){if(( document.myform.cp_sj.value == '' )||( document.myform.cp_sj.value<0)||(isNaN( document.myform.cp_sj.value)))  {
window.alert('请输入正确的产品销售增减时间，只能为数值不能为空或小于0天!!');
return false;}}
if ( document.myform.jp.value == '' ) {
window.alert('请输入产品简评!!');
document.myform.jp.focus();
return false;}
if (document.myform.jp.value.length>300){
window.alert("产品简评不能超过300字！");
document.myform.jp.focus();
return false;}
if (document.myform.js.value.length>3000){
window.alert("产品介绍不能超过3000字！");
document.myform.js.focus();
return false;}
return true;}  
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><table border="0" align="left" cellpadding="0" cellspacing="0">
      <tr>
        <td width="1"><IMG SRC="../images/mytaobaobj1_3.gif" WIDTH=3 HEIGHT=25 ALT=""></td>
        <td width="120" align="center" background="../images/mytaobaobj1_4.gif">商品修改<font color="#FFFFFF" span class="C">&nbsp;</font></td>
        <td width="1"><IMG SRC="../images/mytaobaobj1_6.gif" WIDTH=7 HEIGHT=25 ALT=""></td>
      </tr>
    </table>

</td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="4" bgcolor="1E88C1"></td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="5"></td>
  </tr>
</table>
<br>
<table width="570" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#EFEFEF"><form action=?xiu=yes method="post" name="myform" id="myform">
          
    <tr valign="middle">
      <td height="21" colspan="4" align="center" background="../image/bk.gif" bgcolor="#FFFFFF">&nbsp;</td>
      </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#FFFFFF">产品名称</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF">
<%set rs1 = conn.execute("select * from chanpin where id="&shopnet("id")&"")%>
<select name="lbid" size="8" class="wenbenkuang" style="width:170px" onChange="javascript:changelocation(document.myform.lbid.options[document.myform.lbid.selectedIndex].value);changeInfo();">
<%set rs = conn.execute("select lbid,lbname from lb order by lbid asc")
do while not rs.eof
Response.Write "<option value="&rs("lbid")&" "
if rs("lbid") = rs1("lbid") then response.write "Selected"
Response.Write ">"&rs("lbname")&"</option>"
rs.movenext
loop
rs.close%>
</select>
<select name="xlbid" size="8" style="width:120px" class="wenbenkuang" onChange="javascript:changelocation2(document.myform.xlbid.options[document.myform.xlbid.selectedIndex].value);changeInfo();">
<%Set rs = conn.execute("Select xlbid,xlbname from xlb where lbid = " &rs1("lbid")&"")
do while not rs.eof
Response.Write "<option value="&rs("xlbid")&" "
if rs("xlbid") = rs1("xlbid") then response.write "Selected"
Response.Write ">"&rs("xlbname")&"</option>"
rs.movenext
loop
rs.close%>
</select>
<select name="slbid" size="8" style="width:120px" class="wenbenkuang" onChange="javascript:changeInfo();">
<%Set rs = conn.execute("Select slbid,slbname from slb where xlbid = " &rs1("xlbid")&"")
do while not rs.eof
Response.Write "<option value="&rs("slbid")&" "
if rs("slbid") = rs1("slbid") then response.write "Selected"
Response.Write ">"&rs("slbname")&"</option>"
rs.movenext
loop
rs.close%>
</select> <font color="#FF3333">*</font></td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#FFFFFF">产品名称</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF"> <input name="mc" type="text" class="wenbenkuang" id="mc" value="<%=rs1("mc")%>" size="40" maxlength="28"> 
        <font color="#FF3333">*</font> </td>
    </tr>
    <tr valign="middle">
      <td height="25" align="center" bgcolor="#FFFFFF">产品编号</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF">
        <input name="bh" type="text" class="wenbenkuang" id="bh" value="<%=rs1("bh")%>" size="25" maxlength="25">        </td>
    </tr>
<%set rs = conn.execute("select id,userlb,lbid from user_lb where userid="&myuserid&" and lbid=0 order by px desc,id")
if not rs.eof then
Response.Write "<tr valign=middle><td width=120 height=25 align=center bgcolor=#FFFFFF>自建类别</td>"&_
"<td height=25 colspan=3 bgcolor=#FFFFFF>"&_
"<select name=userlbid class=wenbenkuang><option value=0>==请选择自建类别==</option>"
do while not rs.eof
if rs("id")=rs1("userlbid") then xz="selected" else xz=""
Response.Write "<option value="&rs(0)&" "&xz&">┣ "&rs(1)&"</option>"
set xlb = conn.execute("select id,userlb from user_lb where userid="&myuserid&" and lbid="&rs(0)&" order by px desc,id")
if not xlb.eof then
do while not xlb.eof
if xlb("id")=rs1("userlbid") then xz="selected" else xz=""
Response.Write "<option value="&xlb(0)&" "&xz&">&nbsp;&nbsp;┗ "&xlb(1)&"</option>"
xlb.movenext
loop
end if
xlb.close
set xlb=nothing
rs.movenext
loop
Response.Write("</select>")
Response.Write "</td></tr>"
else
Response.Write("<input name=userlbid type=hidden value=0>")
end if
rs.close
set rs=nothing
if rs1("fs")=1 then%>
    <tr valign="middle">
      <td height="25" align="center" bgcolor="#FFFFFF">销售方式</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF"><input name="fs" type="radio" disabled="true" value="0">
        一口价  <input name="fs" type="radio" value="1" checked>
拍卖  <input name="fs" type="radio" disabled="true" value="2">
        议价</td>
    </tr>
    <tr valign="middle">
      <td height="25" align="center" bgcolor="#FFFFFF">拍卖起价</td>
      <td height="25" bgcolor="#FFFFFF"><input name="p_jg1" type="text" class="wenbenkuang" id="p_jg1" value="<%=rs1("jg1")%>" size="10" maxlength="6">
        <font color="#FF3333">*</font></td>
      <td align="center" bgcolor="#FFFFFF">加价幅度</td>
      <td bgcolor="#FFFFFF"><input name="p_jg2" type="text" class="wenbenkuang" id="p_jg2" value="<%=rs1("jg3")%>" size="10" maxlength="4">
      <font color="#FF3333">*</font>每次竞价的最低加价</td>
    </tr>
    <tr valign="middle">
      <td height="25" align="center" bgcolor="#FFFFFF">结拍时间</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF"><%=rs1("sj")%> 至 <%=rs1("sj2")%> </td>
    </tr>
<%elseif rs1("fs")=0 then%>
	<tr valign="middle">
      <td height="25" align="center" bgcolor="#FFFFFF">销售方式</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF"><input name="fs" type="radio" onFocus="this.blur()" value="0" checked>
    一口价
      <input name="fs" type="radio" value="1" disabled="true">
      拍卖
      <input name="fs" type="radio" value="2" disabled="true">
      议价</td>
    </tr>
	<tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#FFFFFF">市场价格</td>
      <td width="98" height="25" bgcolor="#FFFFFF"> <input name="jg1" type="text" class="wenbenkuang" id="jg1" value="<%=rs1("jg1")%>" size="10" maxlength="20"> 
      <font color="#FF3333">*</font></td>
      <td width="75" align="center" bgcolor="#FFFFFF">网上价格</td>
      <td width="232" bgcolor="#FFFFFF"> <input name="jg2" type="text" class="wenbenkuang" id="jg2" value="<%=rs1("jg2")%>" size="10" maxlength="20"> 
        <font color="#FF3333">*</font> </td>
    </tr>
    
	<%elseif rs1("fs")=2 then%>
		<tr valign="middle">
      <td height="25" align="center" bgcolor="#FFFFFF">销售方式</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF"><input name="fs" type="radio" onFocus="this.blur()" value="0" disabled="true">
    一口价
      <input name="fs" type="radio" value="1" disabled="true">
      拍卖
      <input name="fs" type="radio" value="2" checked>
      议价</td>
    </tr>
	<%end if
	if rs1("fs")=0 or rs1("fs")=2 then%>
	    <tr valign="middle"> 
      <td height="25" align="center" bgcolor="#FFFFFF">销售时间</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF">该产品至<%=rs1("sj2")%>结束销售，您可以
        <select name="xs" class="wenbenkuang" id="xs">
          <option value="0" selected>增加</option>
          <option value="1">减少</option>
        </select>
        <input name="cp_sj" type="text" class="wenbenkuang" id="cp_sj" value="0" size="4" maxlength="3">天销售时间</td>
    </tr><%end if%>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#FFFFFF">产品关键字</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF"> <input name="cj" type="text" class="wenbenkuang" id="cj" value="<%=rs1("cj")%>" size="40" maxlength="45">
        多个关键之间用“|”隔开</td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" rowspan="2" align="center" bgcolor="#FFFFFF">产品小图片</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF"> <input name="xt" type="text" class="wenbenkuang" id="xt" value="<%=rs1("xt")%>" size="40" maxlength="50">
        图片尺寸75*75像素</td>
    </tr>
    <tr valign="middle"> 
      <td height="25" colspan="3" bgcolor="#FFFFFF"> <iframe name="ad" frameborder=0 width=100% height=20 scrolling=no src="01.asp"></iframe></td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" rowspan="2" align="center" bgcolor="#FFFFFF">产品中图片</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF"> <input name="zt" type="text" class="wenbenkuang" id="zt" value="<%=rs1("zt")%>" size="40" maxlength="50">
       图片尺寸200*200像素</td>
    </tr>
    <tr valign="middle"> 
      <td height="25" colspan="3" bgcolor="#FFFFFF"> <iframe name="ad" frameborder=0 width=100% height=20 scrolling=no src="02.asp"></iframe></td>
    </tr>
    <tr valign="middle"> 
      <td height="25" rowspan="2" align="center" bgcolor="#FFFFFF">产品大图片</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF"> <input name="dt" type="text" class="wenbenkuang" id="dt" value="<%=rs1("dt")%>" size="40" maxlength="50">      </td>
    </tr>
    <tr valign="middle"> 
      <td height="25" colspan="3" bgcolor="#FFFFFF"> <iframe name="ad" frameborder=0 width=100% height=20 scrolling=no src="03.asp"></iframe></td>
    </tr>
	<tr valign="middle"> 
      <td height="25" align="center" bgcolor="#FFFFFF">产品简评</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF"> <textarea name="jp" cols="65" rows="4" class="wenbenkuang" id="jp"><%=rs1("jp")%></textarea> 
        <font color="#FF3333">*</font></td>
    </tr>
    <tr valign="middle"> 
      <td width="120" height="25" align="center" bgcolor="#FFFFFF">产品介绍</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF"> <textarea name="js" cols="65" rows="6" class="wenbenkuang" id="js"><%=rs1("js")%></textarea>      </td>
    </tr>
    <tr valign="middle">
      <td height="25" align="center" bgcolor="#FFFFFF">产品设置</td>
      <td height="25" colspan="3" bgcolor="#FFFFFF"><input name="user_tui" type="checkbox" <%If rs1("user_tui")<>0 Then Response.Write("CHECKED")%> id="user_tui" onFocus="this.blur()" value="yes">
    产品推荐(将出现在商家网店首页新品推荐处)      <input type="checkbox" name="cang" <%If rs1("cang") <>0 Then Response.Write("CHECKED")%> value="yes" onFocus="this.blur()">
    产品隐藏 </td>
    </tr>
    <tr valign="middle"> 
      <td height="21" colspan="4" align="center" background="../image/bk1.gif" bgcolor="#FFFFFF"> <input name="Submit" type="submit" class="go-wenbenkuang" value="提交" ONCLICK="javascript:return checksignup()">&nbsp;&nbsp; 
        <input name="Submit2" type="reset" class="go-wenbenkuang" value="重置">&nbsp;&nbsp;
        <input name="Submit2" type="button" class="go-wenbenkuang" value="返回上页" onClick="javascript:window.history.go(-1)"> 
        <input name="id" type="hidden" value="<%=request("id")%>">
        <input name="keywords" type="hidden" value="<%=request("keywords")%>"> 
        <input name="page" type="hidden" value="<%=request("page")%>"></td>
      </tr></form>
  </table>
<%rs1.close:set rs1=nothing%>
</td>
  </tr>
</table>
<br>
<!--#include file="../bottom.asp"-->
