www.gusucode.com > 爱美尔女性商城源码 1.0源码程序 > admintouch/editbook.asp

    <!--#include file="conn.asp"-->
<%if session("bjxadmin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"
response.End
end if
dim bookid
bookid=request.QueryString("id")
if not isnumeric(bookid) then 
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
end if
%>
<html><head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<%
typeid=request("typeid")
dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * FROM BJX_class2 where typeid="&typeid&" order by Nclassidorder ",conn,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
   count = 0
   do while not rs.eof 
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%= rs("anclassid")%>","<%= rs("Nclassid")%>");
<%
        count = count + 1
        rs.movenext
        loop
        rs.close
%>
		
onecount=<%=count%>;

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

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { //这句不是很理解
             document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>

<body>
<table class="tableBorder" width="90%" border="0" align="center" cellpadding="0" cellspacing="1" >
<tr> 
<td align="center" background="images/admin_bg_1.gif"><b><font color="#ffffff">修改商品</font></b></td>
</tr>
<tr> 

<form name="myform" method="post" action="saveaddgood.asp?action=edit&id=<%=bookid%>&typeid=<%=typeid%>">
<td> 
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr > 
<td width="20%" align="right">选择分类:</td>
<td><%dim rs1
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from BJX_goods where bookid="&bookid,conn,1,1
%>
<%
	rs.open "select * FROM BJX_class1 where typeid="&typeid&" order by anclassidorder",conn,1,1
	if rs.eof and rs.bof then
	response.write "请先添加栏目。"
	response.end
	else
%>
										
<select name="anclassid" size="1" id="anclassid" onChange="changelocation(document.myform.anclassid.options[document.myform.anclassid.selectedIndex].value)">
                                        <option selected value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%></option>
                                        <%      dim selclass
         selclass=rs("anclassid")
        rs.movenext
        do while not rs.eof
%>
                                        <option value="<%=rs("anclassid")%>"  <%if rs1("anclassid")=rs("anclassid") then%>selected<%end if%>><%=trim(rs("anclass"))%></option>
                                        <%
        rs.movenext
        loop
		end if
        rs.close
%>
                                      </select> 
									 小类:
<select name="Nclassid">
 <%rs.open "select * FROM BJX_class2 where typeid="&typeid&" and anclassid="&rs1("anclassid") ,conn,1,1
   if not(rs.eof and rs.bof) then
     %>
	 
<% 
                                 dim selclass3
 				 selclass3=rs("nclassid")
do while not rs.eof
  response.write  "<option value="&rs("nclassid")
  if rs1("nclassid")=rs("nclassid") then response.write " selected "
  response.write ">"&trim(rs("nclass"))&"</option>"  
rs.movenext
loop
end if
        rs.close
        set rs = nothing
        
%>                           </select>
</td>
</tr>
								   <tr >
								  <td align="right">商品编号:</td>
                                    <td><label>
                                      <input name="booknum" type="text" id="booknum" size="20" value="<%=rs1("booknum")%>">
                                    </label></td>
                                  </tr>
<tr > 
  <td align="right">商品名称:</td>
  <td> 
<input name="bookname" type="text" id="bookname" size="50" value="<%=trim(rs1("bookname"))%>"></td>
</tr>
<!--
<tr > 
  <td align="right">商品品牌:</td>
  <td>
<input name="pingpai" type="text" id="pingpai" value="<%=trim(rs1("pingpai"))%>">
<%
set rs_s=server.createobject("adodb.recordset")
rs_s.open "select * from BJX_pingpai order by pingpaiorder ",conn,1,1
%>
<select name="select" onChange="(document.myform.pingpai.value=this.options[this.selectedIndex].value)">
<option selected>请选择品牌</option>
<%
while not rs_s.eof
%>
<option value="<%=rs_s("pingpainame")%>"><%=rs_s("pingpainame")%></option>
<%
rs_s.movenext
wend
rs_s.close
set rs_s=nothing
%>
</select></td>
</tr>
-->
<tr > 
<td align="right">价格:</td>
<td>
市场价:<input name="shichangjia" type="text" id="shichangjia" size="6" onKeyPress	= "return regInput(this,	/^\d*\.?\d{0,2}$/,		String.fromCharCode(event.keyCode))" 
onpaste		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		window.clipboardData.getData('Text'))"
ondrop		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		event.dataTransfer.getData('Text'))" value="<%=rs1("shichangjia")%>">
会员价:<input name="huiyuanjia" type="text" id="huiyuanjia" size="6" onKeyPress	= "return regInput(this,	/^\d*\.?\d{0,2}$/,		String.fromCharCode(event.keyCode))" 
onpaste		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		window.clipboardData.getData('Text'))"
ondrop		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		event.dataTransfer.getData('Text'))" value="<%=rs1("huiyuanjia")%>">
<!--促销价:
		<input name="vipjia" type="text" id="vipjia" size="6" onKeyPress	= "return regInput(this,	/^\d*\.?\d{0,2}$/,		String.fromCharCode(event.keyCode))" 
		onpaste		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		window.clipboardData.getData('Text'))"
		ondrop		= "return regInput(this,	/^\d*\.?\d{0,2}$/,		event.dataTransfer.getData('Text'))" value="<%=rs1("vipjia")%>">--></td>
</tr>
<tr > 
<td align="right">&nbsp;</td>
<td>
库 存: <input name="kucun" type="text" id="kucun" value="<%=rs1("kucun")%>" size="6" onKeyPress	= "return regInput(this,	/^[0-9]*$/,		String.fromCharCode(event.keyCode))"
onpaste		= "return regInput(this,	/^[0-9]*$/,		window.clipboardData.getData('Text'))"
ondrop		= "return regInput(this,	/^[0-9]*$/,		event.dataTransfer.getData('Text'))" >

积 分:
<input name="yeshu" type="text" id="yeshu" value="<%=rs1("yeshu")%>" size="6" onKeyPress	= "return regInput(this,	/^[0-9]*$/,		String.fromCharCode(event.keyCode))"
onpaste		= "return regInput(this,	/^[0-9]*$/,		window.clipboardData.getData('Text'))"
ondrop		= "return regInput(this,	/^[0-9]*$/,		event.dataTransfer.getData('Text'))"></td>
</tr>
  <tr >
								  <td align="right">规格:</td>
                                    <td><label>
                                      <input name="gg" type="text" id="gg" value="<%=rs1("gg")%>" size="10">
                                    </label></td>
                                  </tr>
								    
								 
<tr > 
<td align="right">图片</td>
<td>
<input name="bookpic" type="text" id="bookpic" size="30" value="<%=trim(rs1("bookpic"))%>">&nbsp;
<input type="button" name="Submit2" value="上传小图片" onClick="window.open('../BJXupload.asp?formname=myform&editname=bookpic&uppath=bjxGpic&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"></td>
</tr>
<tr > 
<td align="right"></td>
<td><input name="zhuang" type="text" id="zhuang" size="30" value="<%=trim(rs1("zhuang"))%>">&nbsp;
<input type="button" name="Submit2" value="上传大图片" onClick="window.open('../BJXupload.asp?formname=myform&editname=zhuang&uppath=bjxGpic&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"></td>
</tr>
<tr > 
  <td valign="middle" align="right">详细说明:</td>
<td>
 <IFRAME ID="ewebeditor1" SRC="../webedit/ewebeditor.asp?id=Content&style=s_coolblue1" FRAMEBORDER="0" SCROLLING="no" WIDTH="600" HEIGHT="380"></IFRAME>
		  <textarea name="Content" id="Content"  style="display:none"><%=rs1("bookcontent")%></textarea>									</td>
</tr>
<tr > 
<td align="right"></td>
<td height="30">
<input name="newsbook" type="checkbox" id="newsbook" value="1" <%if rs1("newsbook")=1 then%>checked<%end if%>>
新品 <input name="bestbook" type="checkbox" id="bestbook" value="1" <%if rs1("bestbook")=1 then%>checked<%end if%>>
推荐 <input name="tejiabook" type="checkbox" id="tejiabook" value="1" <%if rs1("tejiabook")=1 then%>checked<%end if%>>
特价 
<!--<input name="pjbook" type="checkbox" id="pjbook" value="1" <%if rs1("pjbook")=1 then%>checked<%end if%>>
品酒 
<input name="jjbook" type="checkbox" id="jjbook" value="1" <%if rs1("jjbook")=1 then%>checked<%end if%>>
鉴酒--> <br> 
<input type="submit" name="Submit" value="修改保存">
<input type="button" value=" 返 回 " onClick="javascript:history.go(-1)" class="unnamed5" name="button">
<input type="hidden" name="linkaddress" value="<%=request.servervariables("http_referer")%>"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
<%rs1.close
set rs1=nothing
conn.close
set conn=nothing%>
<!--#include file="bjxfoot.asp"-->
</body>
</html>

<SCRIPT LANGUAGE="JavaScript">
<!--
function check()
{
if(checkspace(document.myform.bookname.value)) {
document.myform.bookname.focus();
alert("请输入商品名称!");
return false;
}
if(checkspace(document.myform.shichangjia.value)) {
document.myform.shichangjia.focus();
alert("请输入市场价格!");
return false;
}
if(checkspace(document.myform.huiyuanjia.value)) {
document.myform.huiyuanjia.focus();
alert("请输入会员价格!");
return false;
}

}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
//-->
</script>
<script>
function regInput(obj, reg, inputStr)
{
var docSel	= document.selection.createRange()
if (docSel.parentElement().tagName != "INPUT")	return false
oSel = docSel.duplicate()
oSel.text = ""
var srcRange	= obj.createTextRange()
oSel.setEndPoint("StartToStart", srcRange)
var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
return reg.test(str)
}
</script>
<%
function HTMLEncode(fString)
fString = Replace(fString, "</P><P>", CHR(10) & CHR(10))
fString = Replace(fString, "<BR>", CHR(10))
HTMLEncode = fString
end function
%>
<script language="javascript">
function upF()
{
if(document.forms[0].slt.checked==false){l1.style.display='none';}else{l1.style.display='block';}
}
upF();

</script>