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

📄 changehw.asp

📁 简单的servlet/jsp注册
💻 ASP
字号:
<% @ LANGUAGE="VBSCRIPT" %>
<%
if session("admin_name")="" then response.end
%>
<!--#include file="../inc/adconn.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_pic2=rs("hw_pic2")
	  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")
      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")
    'hw_pic2=request("hw_pic2")
	hw_pic=request("upfile")
    hw_pic2=request("upfile2")
	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+"<bār>"+"<li>图书类别不能为空"
        founderr=true
    end if       
    if founderr=true then
        response.write errmsg
        response.write "<br>"
        response.write "<a href=addhw.asp>返回</a>"
        response.end
    else
        hw_pic=server.htmlencode(hw_pic)    
        set rs=server.createobject("adodb.recordset")
        sql="select * from hw where hw_id="&request("hw_id")
        rs.open sql,conn,3,3
		 if hw_pic="" then hw_pic=rs("hw_pic")
	    if hw_pic2="" then hw_pic2=rs("hw_pic2")
        
		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("hw_pic2")=hw_pic2
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
%>
<SCRIPT language=javascript>
  var upfile_obj;
  var upfile_obj2;
  function OnUpFile()
  {
   upfile_obj.src=upfile_obj.lowsrc;
   upfile_obj.src=document.forms["form1"].upfile.value;
  }
  function OnUpFile2()
  {
   upfile_obj2.src=upfile_obj2.lowsrc;
   upfile_obj2.src=document.forms["form1"].upfile2.value;
  }
</SCRIPT>
      <form name="form1" method="post" action="changehw.asp?hw_id=<%=hw_id%>&action=save">
  <INPUT name=upfile type=hidden onchange=return(OnUpFile()) value="">
  <INPUT name=upfile2 type=hidden onchange=return(OnUpFāile2()) value="">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
  <TABLE cellSpacing=1 cellPadding=0 width="540" align=center bgColor=#999999 border=0>
    <TBODY> 
    <TR> 
        <TD width="735" bgcolor="f0f0f0" id=maintitleback> 
          <TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
          <TBODY>
            <TR> 
                <TD width="10"><IMG height=9 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="351">
            <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> <div align="center">
                    <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" align=left noWrap 
          background=../images/pics/tile_sub.gif id=titlemedium> <p>  
                    <input type="text" name="hw_name" size="20" class=input value="<%=hw_name%>">
                  </p></TD>
              </TR>
              <!TR>
              <tr> 
                <TD bgColor=#ffffff height="30"> <div align="center"><font color="#FF0000">作品原价</font></div></TD>
                <TD width=122 height="30" align=left bgColor=#ffffff> <font color=#333333> 
                  <input type="text" name="pifa" size="10" class=input value="<%=pifa%>">
                  元</font></TD>
                <TD align=middle bgColor=#ffffff height="30">&nbsp;</TD>
                <TD height="30" align="left" bgColor=#ffffff>&nbsp;</TD>
              </TR>
              <TR> 
                <TD height="30" align="center" bgColor=#ffffff>型号</TD>
                <TD height="30" align=left bgColor=#ffffff>  
                  <input type="text" name="chubsh" size="12" class=input value="<%=chubsh%>"> 
                  <div align="center"></div></TD>
                <TD align=middle bgColor=#ffffff height="30"> <div align="center">成 份</div></TD>
                <TD height="30" align="left" bgColor=#ffffff>   
                  <input type="text" name="kaiben" size="10" class=input value="<%=kaiben%>"> 
                </TD>
              </TR>
              <TR>
                <TD align=middle bgColor=#ffffff height="30"> <div align="center">尺寸</div></TD>
                <TD height="30" align="left" bgColor=#ffffff>   
                  <input name="hw_sn" type="text" class=input id="hw_sn" style="FONT-SIZE: 12px; WIDTH: 110px" value="<%=hw_sn%>" size="9"> 
                </TD>
                <TD align=center bgColor=#ffffff height="30">联系人</TD>
                <TD height="30" align="left" bgColor=#ffffff> 
<input name="isbn" type="text" class=input id="isbn" style="FONT-SIZE: 12px; WIDTH: 110px" value="<%=isbn%>" size="9"></TD>
              </TR>
              <TR> 
                <TD bgColor=#ffffff height="30"> <font color="#FF0000">作品简介</font></TD>
                <TD height="30" colspan="3" align=center bgColor=#ffffff>
	<textarea name="hw_Content" style="display:none"><%=Server.HTMLEncode(trim(hw_content))%></textarea><IFRAME ID="eWebEditor1" SRC="../eWebEditor/ewebeditor.asp?id=hw_content&style=standard_coolblue" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="350"></IFRAME></TD>
              </TR>
              <TR> 
                <TD height="33" colspan="4" bgColor=#ffffff><table width="100%" border="0" cellspacing="0">
                    <tr> 
                      <td>作品图片: 
                        <iframe name="ad" frameborder=0 width=100% height=50 scrolling=no src=upload.asp></iframe></td>
                    </tr>
                  </table></TD>
              </TR>
              <TR> 
                <TD height="30" colspan="4" 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="4" bgColor=#ffffff> <div align="center"><img src="../../images/pics/seperator.gif" width="359" height="1"></div></TD>
              </TR>
              <TR bgcolor="f0f0f0"> 
                <TD height="30" colSpan=4 id=mainfoot> 
                  <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/s_button000.gif" alt=进入 align=absMiddle width="45" height="20" cache tppabs="">
                          </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 + -