⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 changehw.asp

📁 自做的购物网站
💻 ASP
字号:
<% @ LANGUAGE="VBSCRIPT" %>
<%
if session("admin_name")="" then response.end
set rs=server.createobject("adodb.recordset")
%>
<!--#include file="conn.asp"-->
<!--#include file="css.asp"-->
<%
dim hw_id ,hw_name,hw_cash,hw_pic,hw_date,sort_id,hw_content,he_views,he_buys,chubsh,zhuang,hw_sn,company,yeshu,kaiben,isbn,pifa,daili,data
set rs=server.createobject("adodb.recordset")
sql="select * from hw where hw_id="&request("hw_id") 
rs.open sql,conn,1,1
      hw_id=rs("hw_id")
      hw_name=rs("hw_name")
      hw_cash=rs("hw_cash")
      hw_pic=rs("hw_pic")
      hw_date=rs("hw_date")
hw_sn=rs("hw_sn")
      sort_id=rs("sort_id")
Nsort_id=rs("Nsort_id")
tuijian=rs("tuijian")
      hw_content=rs("hw_content")
      hw_views=rs("hw_views")
      hw_buys=rs("hw_buys")
      chubsh=rs("chubsh")
      zhuang=rs("zhuang")
      hw_sn=rs("hw_sn")
      company=rs("company")
      yeshu=rs("yeshu")
      kaiben=rs("kaiben")
      isbn=rs("isbn")
pifa=rs("pifa")
daili=rs("daili")
data=rs("data")
rs.close
%>
<%
if request("action")="save" then
    hw_name=request("hw_name")
    hw_content=request("hw_content")
    hw_cash=request("hw_cash")
    hw_pic=request("hw_pic")
	chubsh=request("chubsh")
	zhuang=request("zhuang")
	yeshu=request("yeshu")
	isbn=request("isbn")
    sort_id=request("sort_id")
Nsort_id=request("Nsort_id")
tuijian=request("tuijian")
    company=request("company")
   pifa=request("pifa")
daili=request("daili")
hw_sn=request("hw_sn")
data=request("data")
kaiben=request("kaiben")
    if not(isnumeric(hw_cash)) then
        errmsg="<br>"+"<li>图书的价格应该为数字"
        founderr=true
    end if
    if hw_name="" then
        errmsg=errmsg+"<br>"+"<li>图书名称不能为空"
        founderr=true
    end if
    if hw_content="" then
        errmsg=errmsg+"<Br>"+"<li>图书介绍不能为空"
        founderr=true
    end if
    if sort_id="" then
        errmsg=errmsg+"<br>"+"<li>图书类别不能为空"
        founderr=true
    end if
   
    
    if hw_pic="" then hw_pic="images/noimage.gif"
    
    if founderr=true then
        response.write errmsg
        response.write "<br>"
        response.write "<a href=addhw.asp>返回</a>"
        response.end
    else
        hw_name=server.htmlencode(hw_name)
        hw_name=replace(hw_name," ","&nbsp;")
        hw_name=replace(hw_name,chr(13)&chr(10),"<Br>")
        
        
        hw_content=server.htmlencode(hw_content)
        hw_content=replace(hw_content," ","&nbsp;")
        hw_content=replace(hw_content,chr(13)&chr(10),"<Br>")        
        
        hw_pic=server.htmlencode(hw_pic)    
        
        sql="select * from hw where hw_id="&request("hw_id")
        rs.open sql,conn,3,3
        rs("hw_name")=hw_name
        rs("hw_content")=hw_content
        rs("hw_cash")=hw_cash
        rs("sort_id")=sort_id
       rs("company")=company
       rs("daili")=daili
       rs("pifa")=pifa
       rs("hw_sn")=hw_sn
	   rs("chubsh")=chubsh
	   rs("kaiben")=kaiben
	   rs("yeshu")=yeshu
	   rs("data")=data
	   rs("isbn")=isbn
	   rs("zhuang")=zhuang
        rs("hw_pic")=hw_pic
rs("Nsort_id")=Nsort_id
rs("tuijian")=tuijian
        rs.update
    end if
    response.write "商品修改成功!"
    response.write "<br>"
    response.write "<a href=delhw.asp>返回</a>"
    rs.close
    

else
%>


      <form name="form1" method="post" action="changehw.asp?hw_id=<%=hw_id%>&action=save">
  <TABLE cellSpacing=1 cellPadding=0 width="540" align=center bgColor=#999999 
border=0>
    <TBODY> 
    <TR> 
      <TD width="735" background=images/pics/tile_back.gif id=maintitleback> <TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
          <TBODY>
            <TR> 
              
            <TD width="10"><IMG height=8 src="images/pics/nav_m.gif" width=8 
            border=0></TD>
                
            <TD height="30" valign="bottom" id=maintitle>商品管理 -&gt; 商品修改 -&gt;<b> 
              所有选项都必须填写</b></TD>
            </TR>
          </TBODY>
        </TABLE></TD>
    </TR>
    <TR> 
      <TD id=mainbg> 
        <TABLE cellSpacing=1 cellPadding=4 width="100%" border=0 height="330">
          <TBODY> 
          <TR> 
            <TD height="30" noWrap 
          background=images/pics/tile_sub.gif id=titlemedium> 
              <div align="center"><font color="#FFFFFF">商品分类</font></div>
            </TD>
            <TD height="30" noWrap 
          background=images/pics/tile_sub.gif id=titlemedium colspan="2"> 
              <div align="center"><font color="#FF0000"> </font> 
                <select class="smallSel" name="sort_id" size="1">
                  <%
	dim rs,sql
	dim content,sel
	sort_id=request("sort_id")
	Nsort_id=request("Nsort_id")
 	set rs=server.createobject("adodb.recordset")
  	sql="select * from sort"
 	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		response.write "Not record."
	else
	do while not rs.eof
        if sort_id=cstr(rs("sort_id")) then
               sel="selected"
        else
               sel=""
        end if	
	response.write "<option " & sel & " value='"+CStr(rs("sort_ID"))+"' name=sort_id>"+rs("sort_name")+"</option>"+chr(13)+chr(10)
	rs.movenext
    	loop
	end if
	rs.close
%>
                </select>
                &nbsp;&nbsp; 
              <select name="Nsort_id" size="1">
                <%
  	sql="select * from Nsort"
 	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		response.write "Not record."
	else
        do while not rs.eof
        if Nsort_id=cstr(rs("Nsort_id")) then
               sel="selected"
        else
               sel=""
        end if	
        response.write "<option " & sel & " value='" +  Cstr(rs("Nsort_id")) + "'>" + rs("Nsort_name") + "</option>"
        rs.MoveNext
        Loop
	end if
        rs.close
%>
              </select></div>
            </TD>
            <TD height="30" align=middle noWrap 
          background=images/pics/tile_sub.gif id=titlemedium> 
              <div align="center"><font color="#FFFFFF">商品名称</font></div>
            </TD>
            <TD height="30" colspan="2" align=middle noWrap 
          background=images/pics/tile_sub.gif id=titlemedium> 
              <div align="center"> 
                <input type="text" name="hw_name" size="20" class=input value="<%=hw_name%>">
              </div>
            </TD>
          </TR>
          <TR> 
            <TD bgColor=#ffffff height="30"> 
              <div align="center"><font color="#FF0000">商品原价</font></div>
            </TD>
            <TD width=122 height="30" align=middle bgColor=#ffffff> 
              <div align="center"><font color=#333333> 
                <input type="text" name="pifa" size="10" class=input value="<%=pifa%>">
                元</font></div>
            </TD>
            <TD width=60 height="30" align=middle bgColor=#ffffff> 
              <div align="center"><font color="#FF0000">会员价格</font></div>
            </TD>
            <TD width=122 height="30" align=middle bgColor=#ffffff> 
              <div align="center"> 
                <input type="text" name="hw_cash" size="10" class=input value="<%=hw_cash%>">
                元 </div>
            </TD>
            <TD width=60 height="30" bgColor=#ffffff> 
              <div align="center"><font color="#FF0000">VIP价格</font></div>
            </TD>
            <TD width=122 height="30" align=middle bgColor=#ffffff> 
              <div align="center"> 
                <input type="text" name="daili" size="10" class=input value="<%=daili%>">
                元</div>
            </TD>
          </TR>
          <TR> 
            <TD height="30" colspan="6" bgColor=#ffffff> 
              <div align="center"><img src="../IMAGES/pics/seperator.gif" width="359" height="1"></div>
            </TD>
          </TR>
          <TR> 
            <TD bgColor=#ffffff height="30"> 
              <div align="center">录入</div>
            </TD>
            <TD height="30" align=middle bgColor=#ffffff> 
              <div align="center"> 
                <input type="text" name="hw_sn" size="12" class=input value="<%=hw_sn%>">
              </div>
            </TD>
            <TD align=middle bgColor=#ffffff height="30"> 
              <div align="center">出品公司</div>
            </TD>
            <TD align=middle bgColor=#ffffff height="30"> 
              <div align="center"> 
                <input type="text" name="chubsh" size="12" class=input value="<%=chubsh%>">
              </div>
            </TD>
            <TD bgColor=#ffffff height="30"> 
              <div align="center">尺码</div>
            </TD>
            <TD align=middle bgColor=#ffffff height="30"> 
              <div align="center"> 
                <input type="text" name="kaiben" size="10" class=input value="<%=kaiben%>">
              </div>
            </TD>
          </TR>
          <TR> 
            <TD bgColor=#ffffff height="30"> 
              <div align="center">出品日期</div>
            </TD>
            <TD height="30" align=middle bgColor=#ffffff> 
              <div align="center"> 
                <input type="text" name="data" size="12" class=input value="<%=data%>">
              </div>
            </TD>
            <TD align=middle bgColor=#ffffff height="30"> 
              <div align="center">编号</div>
            </TD>
            <TD align=middle bgColor=#ffffff height="30"> 
              <div align="center"> 
                <input type="text" name="isbn" size="12" class=input value="<%=isbn%>">
              </div>
            </TD>
            <TD bgColor=#ffffff height="30"> 
              <div align="center">颜色</div>
            </TD>
            <TD align=middle bgColor=#ffffff height="30"> 
              <div align="center"> 
                <input type="text" name="yeshu" size="10" class=input value="<%=yeshu%>">
              </div>
            </TD>
          </TR>
          <TR> 
            <TD bgColor=#ffffff height="30"> 
              <div align="center">包装类型 </div>
            </TD>
            <TD height="30" align=middle bgColor=#ffffff> 
              <input type="text" name="zhuang" size="12" class=input value="<%=zhuang%>">
            </TD>
            <TD height="30" align=middle bgColor=#ffffff>&nbsp;</TD>
            <TD height="30" align=middle bgColor=#ffffff>&nbsp;</TD>
            <TD height="30" align=middle bgColor=#ffffff>&nbsp;</TD>
            <TD height="30" align=middle bgColor=#ffffff>&nbsp;</TD>
          </TR>
          <TR> 
            <TD height="30" colspan="6" bgColor=#ffffff> 
              <div align="center"><img src="../IMAGES/pics/seperator.gif" width="359" height="1"></div>
            </TD>
          </TR>
          <TR> 
            <TD bgColor=#ffffff height="30"> 
              <div align="center"><font color="#FF0000">内容简介</font></div>
            </TD>
            <TD height="30" colspan="5" align=middle bgColor=#ffffff> 
              <div align="left"> 
                <textarea rows="3" name="hw_content" cols="50" class=input><%=hw_content%></textarea>
              </div>
            </TD>
          </TR>
          <TR> 
            <TD width=122 bgColor=#ffffff height="33"> 
              <div align="center"><font color="#FF0000">商品图片</font> </div>
            </TD>
            <TD height="33" colspan="5" align=middle bgColor=#ffffff> 
              <div align="left"> 
                <input type="text" name="hw_pic" size="46" class=input value="<%=hw_pic%>">
                <a href="xgpic.asp?hw_id=<%=hw_id%>"><font color="#FF0000">图形上传</font></a> 
              </div>
            </TD>
          </TR>
          <TR> 
            <TD height="30" colspan="6" bgColor=#ffffff> 
              <div align="center"> 
                <input type="radio" name="tuijian" value="-1">
                推荐此商品    
                <input type="radio" name="tuijian" value="0" checked>
                不推荐</div>
            </TD>
          </TR>
          <TR> 
            <TD height="30" colspan="6" bgColor=#ffffff> 
              <div align="center"><img src="../IMAGES/pics/seperator.gif" width="359" height="1"></div>
            </TD>
          </TR>
          <TR> 
            <TD id=mainfoot 
colSpan=6 height="30"> 
              <div align="center"> 
                <table width="30%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr> 
                    <td height="25"> 
                      <div align="center"> 
                        <input name=submit2 type=image 
      src="../IMAGES/pics/ok.gif" alt=进入 
      align=absMiddle width="45" height="20" cache tppabs="">
                      </div>
                      <div align="center"> </div>
                    </td>
                  </tr>
                </table>
              </div>
            </TD>
          </TR>
          </TBODY> 
        </TABLE>
      </TD>
    </TR>
  </TBODY>
</TABLE>
</form>
<%
end if
set rs=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -