edithw.asp

来自「国内第一数字点卡销售程序。功能强大。 完整无错!数据文件经MD5加密!经严格测」· ASP 代码 · 共 216 行

ASP
216
字号
<%@ CODEPAGE = "936" %>
<!--#include file="conn.asp"-->
<%
if session("admin_rank")<>1 and session("admin_rank")<>4 then
response.write("<script>alert('您无权查看本页,SORRY!');window.location=('login.asp')</script>")
response.end
end if
%>

<%
set rs=server.createobject("adodb.recordset")
set rs1=server.createobject("adodb.recordset")
%><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<%dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_Nclass 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>
<%
function htmlencode(str)
htmlencode=replace(replace(replace(str,chr(13),"<br>"),"'","''"),chr(32),"&nbsp;")
end function
%>
<%
function modifycode(str)
modifycode=replace(replace(replace(str,"<br>",chr(13)),"'","''"),"&nbsp;",chr(32))
end function
%>
<%
if request("action")="save" then
   if request("anclassid")<>"" and request("nclassid")<>"" then
	sql="select * from hw where hw_id="&int(request("hw_id"))
    rs.open sql,conn,3,3
    rs("hw_name")=trim(request("hw_name"))
    rs("hw_content")=htmlencode(trim(request("hw_content")))
    rs("hw_jj")=trim(request("hw_jj"))
    rs("hw_cash")=trim(request("hw_cash"))
    rs("hw_cash1")=trim(request("hw_cash1"))
    rs("hw_cash2")=trim(request("hw_cash2"))
    rs("hw_cash3")=trim(request("hw_cash3")) 
    rs("hw_pic")=trim(request("hw_pic"))
    rs("hw_xp")=cbool(cint(request("hw_xp")))
    rs("hw_jp")=cbool(cint(request("hw_jp")))
    rs("hw_rm")=cbool(cint(request("hw_rm")))
    rs("hw_rx")=cbool(cint(request("hw_rx")))
    rs("hw_cz")=request("hw_cz")
    rs("hw_hostweb")=trim(request("hw_hostweb"))
    rs("hw_downweb")=trim(request("hw_downweb"))
    rs("hw_service")=trim(request("hw_service"))     
    rs("anclassid")=request("anclassid")
    rs("nclassid")=request("nclassid")
	rs("hw_date")=Now()
    rs.update
    response.write("<script>alert('修改成功!');window.location=('delhw.asp')</script>")
    response.end
    rs.close
    else
%>
<script language=vbs>
<!--
  msgbox"商品大类或小类未齐全,请检查后再定!!"
  window.location.href="delhw.asp" 
-->
</script>
    <%end if%>
<%    
else
%>
<body style="background-color: #F0FBF1">
<div align="center">
<table border="0" width="778" cellspacing="1">
  <tr>
    <td width="82%" style="padding-left: 10px">
      <form method="POST" action="edithw.asp?action=save" name="myform" >
        <div align="center">
        <table border="1" width="100%" cellspacing="0" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" cellpadding="0" height="397">
          	<%sql="select * from hw where hw_id="&int(request("hw_id"))
        rs.open sql,conn,3,3 %><tr> 
            <td width="100%" style="padding-left: 10px" height="39">大类:
<%    rs1.open "select * from shop_anclass order by anclassidorder",conn,1,1
	if rs1.eof and rs1.bof then
	response.write "请先添加栏目。"
	response.end
	else
%>
              <select name="anclassid" class="wenbenkuang" size="1" id="anclassid" onChange="changelocation(document.myform.anclassid.options[document.myform.anclassid.selectedIndex].value)">
                <% 
        do while not rs1.eof
%>
                <option value="<%=rs1("anclassid")%>" <%if rs("anclassid")=rs1("anclassid") then%>selected<%end if%>><%=trim(rs1("anclass"))%></option>
                <%
        rs1.movenext
        loop
	end if
        rs1.close
%>
              </select>
              小类: 
              <select name="Nclassid" class="wenbenkuang">
                <%rs1.open "select * from shop_Nclass where anclassid="&rs("anclassid") ,conn,1,1
do while not rs1.eof%>
                <option value="<%=rs1("NclassID")%>" <%if rs("nclassid")=rs1("nclassid") then%>selected<%end if%>><%=rs1("Nclass")%></option>
                <% rs1.movenext
loop
        rs1.close
        set rs1 = nothing
        
%>
              </select>
<input type="hidden" name="hw_id" value="<%=int(request("hw_id"))%>">
            </td>
          </tr>

          <tr> 
            <td width="100%" style="padding-left: 10px" height="39">商品名称:<input type="text" name="hw_name" size="20" class=input value="<%=rs("hw_name")%>">&nbsp;&nbsp; 
			是否为充值商品: <select size="1" name="hw_cz">
			<%if  rs("hw_cz")="0" then%>
                <option value="0" selected>非充值商品</option>
                <option value="1">充值商品</option>
                <%else%>
                <option value="1" selected>充值商品</option>
                <option value="0">非充值商品</option>
              <%end if%>                                
              </select>
            </td>
          </tr>
          <tr> 
            <td width="100%" style="padding-left: 10px" height="39">进价:<input type="text" name="hw_jj" size="10" class=input value="<%=rs("hw_jj")%>">&nbsp; 市场价:<input type="text" name="hw_cash" size="10" class=input value="<%=rs("hw_cash")%>">
			<font color="#FF0000">会员价:</font><input type="text" name="hw_cash1" size="8" class=input value=<%=rs("hw_cash1")%>>&nbsp;&nbsp;&nbsp;
			<font color="#FF0000">VIP会员价</font>:<input type="text" name="hw_cash2" size="10" class=input value="<%=rs("hw_cash2")%>">
			<font color="#FF0000">经销商会员价:</font><input type="text" name="hw_cash3" size="8" class=input value=<%=rs("hw_cash3")%>></td>
          </tr>
          <tr> 
            <td width="100%" style="padding-left: 10px" height="40">商品介绍:</td>
          </tr>
          <tr> 
            <td width="100%" style="padding-left: 10px" height="40"><%if rs("hw_content")="" then%>
              <textarea rows="9" name="hw_content" cols="65" class=input><%=rs("hw_content")%></textarea>
              <%else%>
              <textarea rows="9" name="hw_content" cols="65" class=input><%=modifycode(rs("hw_content"))%></textarea>
              <%end if%>
              
            </td>
          </tr>
          <tr> 
            <td width="100%" style="padding-left: 10px" height="40"><input type=checkbox name="hw_xp" value="1" <% if rs("hw_xp") then %> checked <%end if%>>新品上市&nbsp;&nbsp;&nbsp;
			<input type=checkbox name="hw_jp" value="1" <% if rs("hw_jp") then %> checked <%end if%>>精品推荐&nbsp;&nbsp; 
			<input type=checkbox name="hw_rx" value="1" <% if rs("hw_rx") then %> checked <%end if%>>热销产品&nbsp;&nbsp; 
			<input type=checkbox name="hw_rm" value="1" <% if rs("hw_rm") then %> checked <%end if%>>热门产品&nbsp;&nbsp;&nbsp;&nbsp; 
			(此项为可选项,非必填项) </td>
          </tr>
          <tr> 
            <td width="100%" style="padding-left: 10px" height="40">官方网址:<input type="text" name="hw_hostweb" size="34" class=input value="<%=rs("hw_hostweb")%>"> </td>
          </tr>
          <tr> 
            <td width="100%" style="padding-left: 10px" height="40">下载网址:<input type="text" name="hw_downweb" size="34" class=input value="<%=rs("hw_downweb")%>"> </td>
          </tr>
          <tr> 
            <td width="100%" style="padding-left: 10px" height="40">在线客服:<input type="text" name="hw_service" size="34" class=input value="<%=rs("hw_service")%>"> </td>
          </tr>
          <tr> 
            <td width="100%" style="padding-left: 10px" height="40">商品图片:    
              <input type="text" name="hw_pic" size="34" class=input value="<%=rs("hw_pic")%>"></td>
          </tr>
        </table>
        </div>
        <p>&nbsp;&nbsp;&nbsp;&nbsp; <input type="submit" value="提交" name="B1" class=input>&nbsp;&nbsp; &nbsp;
		<input type="reset" value="重写" name="B2" class=input></p>
      </form>
       </td>
  </tr>
</table>
</div>

<%
end if
set rs=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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