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

📄 ad_addhw.asp

📁 商品订单管理:商品分类管理 添加与修改商品 管理订单 投诉订单 反馈信息 商品留言管理 管理网站用户:管理用户 管理后台管理员 新闻公告管理:新闻添加(支持图片新闻) 修改删除 首页公告设置 网站常规
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
function htmlencode2(str)
    dim result
    dim l
    if isNULL(str) then 
       htmlencode2=""
       exit function
    end if
    l=len(str)
    result=""
	dim i
	for i = 1 to l
	    select case mid(str,i,1)
	           case "<"
	                result=result+"&lt;"
	           case ">"
	                result=result+"&gt;"
              case chr(13)
	                result=result+"<br>"
	           case chr(34)
	                result=result+"&quot;"
	           case "&"
	                result=result+"&amp;"
              case chr(32)	           
	                'result=result+"&nbsp;"
	                if i+1<=l and i-1>0 then
	                   if mid(str,i+1,1)=chr(32) or mid(str,i+1,1)=chr(9) or mid(str,i-1,1)=chr(32) or mid(str,i-1,1)=chr(9)  then	                      
	                      result=result+"&nbsp;"
	                   else
	                      result=result+" "
	                   end if
	                else
	                   result=result+"&nbsp;"	                    
	                end if
	           case chr(9)
	                result=result+"    "
	           case else
	                result=result+mid(str,i,1)
         end select
       next 
       htmlencode2=result
   end function
%>

<%
if session("admin_name")="" then
    response.redirect "ad_login.asp"
end if
set rs=server.createobject("adodb.recordset")%>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<link href=img/css.css rel=STYLESHEET type=text/css>
</head>
<%
if request("action")="save" then
    hw_name=request("hw_name")
    hw_content=server.htmlencode(request("hw_content"))
	hw_content2=server.htmlencode(request("hw_content2"))
    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")
    company=request("company")
   pifa=request("pifa")
daili=request("daili")
hwsn=request("hwsn")
data=request("data")
kaiben=request("kaiben")
tuijian=request("tuijian")
jia=request("jia")
    if not(isnumeric(hw_cash)) then
        errmsg="<br>"+"<li>Not number price"
        founderr=true
    end if
    if hw_name="" then
        errmsg=errmsg+"<br>"+"<li>Not null Name"
        founderr=true
    end if
    if hw_content="" then
        errmsg=errmsg+"<Br>"+"<li>Not null detail"
        founderr=true
    end if
    if sort_id="" then
        errmsg=errmsg+"<br>"+"<li>Not null Sort"
        founderr=true
    end if
   
      if nsort_id="" then
        errmsg=errmsg+"<br>"+"<li>Not null Sort"
        founderr=true
    end if
    if hw_pic="" then hw_pic="img/noimage.gif"
    
    if founderr=true then
        response.write errmsg
        response.write "<br>"
        response.write "<a href=ad_addhw.asp>Back</a>"
        response.end
    else
        hw_content=server.htmlencode(hw_content)
        hw_content=replace(hw_content," ","&nbsp;")
        hw_content=replace(hw_content,chr(13)&chr(10),"<br>")   
		
		hw_content2=server.htmlencode(hw_content2)
        hw_content2=replace(hw_content2," ","&nbsp;")
        hw_content2=replace(hw_content2,chr(13)&chr(10),"<br>")     
        
            
        sql="select * from hw"
        rs.open sql,conn,3,3
        rs.addnew
        rs("hw_name")=hw_name
        rs("hw_content")=hw_content
		rs("hw_content2")=hw_content2
        rs("hw_cash")=hw_cash
        rs("sort_id")=sort_id
        rs("Nsort_id")=Nsort_id
       rs("company")=company
       rs("daili")=daili
       rs("pifa")=pifa
       rs("hw_sn")=hwsn
	   rs("chubsh")=chubsh
	   rs("kaiben")=kaiben
	   rs("yeshu")=yeshu
	   rs("data")=data
	   rs("isbn")=isbn
	   rs("zhuang")=zhuang
        rs("hw_pic")=hw_pic
        rs("tuijian")=tuijian
        rs("jia")=jia
        rs.update
    end if
    response.write "OK"
    response.write "<br>"
    response.write "<a href=ad_addhw.asp>Back</a>"
    rs.close
    

else
%>
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<title>Add Product</title>
<link rel="stylesheet" type="text/css" href="img/css.css">
<%
dim count

set rs=server.createobject("adodb.recordset")
sql = "select * from  Nsort  order by Nsort_id asc"
rs.open sql,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("Nsort_name"))%>","<%= trim(rs("sort_id"))%>","<%= trim(rs("Nsort_id"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.form.Nsort_id.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.form.Nsort_id.options[document.form.Nsort_id.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
</head>

<body>


  <table  cellspacing="0" width="80%" border="0" cellpadding="4" cellspacing="0" >
   <form method="POST" name="form" action="ad_addhw.asp?action=save"> 
    <tr align="center">
      <td class="tdbg" width="100%">
	<table border="0" cellspacing="1" width="100%">
        
                <td width="85%">1st-sort:
<%
        sql = "select * from sort"
        rs.open sql,conn,1,1
	if rs.eof and rs.bof then
	response.write "请先添加栏目。"
	response.end
	else%>
<select name="sort_id" onChange="changelocation(document.form.sort_id.options[document.form.sort_id.selectedIndex].value)" size="1">
        <option selected value="<%=trim(rs("sort_id"))%>"><%=trim(rs("sort_name"))%></option>
<%      dim selclass
         selclass=rs("sort_id")
        rs.movenext
        do while not rs.eof
%> <option value="<%=trim(rs("sort_id"))%>"><%=trim(rs("sort_name"))%></option>
<%rs.movenext
        loop
	end if
        rs.close
%></select>2st-sort:
<select name="Nsort_id">                  
<%sql="select * from Nsort where sort_id="&selclass
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
%>
        <option selected value="<%=rs("Nsort_ID")%>"><%=rs("Nsort_name")%></option>
<% rs.movenext
do while not rs.eof%>
        <option value="<%=rs("Nsort_ID")%>"><%=rs("Nsort_name")%></option>
<% rs.movenext
loop
end if
        rs.close
        set rs = nothing%>
</td>
  </tr>
</table>

<table border="0" width="500" cellspacing="1" height="392" align="left">
  <tr>
    <td width="100%" height="395"> 
      
            <table border="0" width="100%" cellspacing="1">
              <tr> 
                <td colspan="2"><font color="#FF0000">Product Name</font> 
                  <input type="text" name="hw_name" size="20" class=input>
                  <font color="#FF0000"> &nbsp;&nbsp;&nbsp;&nbsp; </font> </td>
              </tr>
              <tr> 
                <td colspan="2"><font color="#FF0000">Market Price</font> 
                  <input type="text" name="pifa" size="7" class=input>
                  RMB <font color="#FF0000">&nbsp;&nbsp;&nbsp;Member Price</font> 
                  <input type="text" name="hw_cash" size="7" class=input>
                  RMB <font color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;VIP  Price</font> 
                  <input type="text" name="daili" size="7" class=input>
                  RMB </td>
              </tr>
              <tr> 
                <td><font color="#000000">Isbn</font> 
                  <input type="text" name="hwsn" size="10" class=input value="80928177">
                </td>
                <td width="63%"><font color="#000000">Company</font> 
                  <input type="text" name="chubsh" size="30" class=input value="VenShop.Com">
                </td>
              </tr>
              <tr> 
                <td><font color="#000000">Size</font> 
                  <input type="text" name="kaiben" size="10" class=input value="M">
                </td>
                <td width="63%">Production Date 
                  <input type="text" name="data" size="17" class=input value="2004-04-10">
                  eg.:2002-10-10</td>
              </tr>
              <tr> 
                <td><font color="#000000">Color</font> 
                  <input type="text" name="yeshu" size="10" class=input value="White">
                </td>
                <td width="63%"><font color="#000000">Points</font> 
                  <input type="text" name="isbn" size="30" class=input value="1">
                </td>
              </tr>
            
              <tr> 
                <td colspan="2"> <font color="#000000">Packing</font> 
                  <input type="text" name="zhuang" size="30" class=input value="Normal">
                </td>
              </tr>
              <tr> 
                <td colspan="2"> brief introduction</td>
              </tr>
              <tr> 
                <td valign="top" colspan="2"> 
                  <textarea rows="3" name="hw_content" cols="80" class=input>brief introduction</textarea>
                </td>
              </tr>
              <tr>
                <td valign="top" colspan="2"><font color="#FF0000">Introduction</font></td>
              </tr>
              <tr>
                <td valign="top" colspan="2">
                  <textarea rows="8" name="hw_content2" cols="80" class=input>introduction</textarea>
                </td>
              </tr>
              <tr> 
                <td colspan="2"> <font color="#FF0000">Photo:</font> 
                  <input type="text" name="hw_pic" size="46" class=input>
                </td>
              </tr>
              <tr> 
                <td colspan="2"><IFRAME src="upfile.asp" frameBorder=0 width="100%" height="30" scrolling=no height=21></IFRAME></td>
              </tr>
            </table>
            <table width="372" border="0" cellspacing="0" cellpadding="0" height="24">
              <tr>
                <td>Recommend or not: Yes
                  <input type="radio" name="tuijian" value="-1">&nbsp; No 
                  <input type="radio" name="tuijian" value="0" checked>
                  <br>
                  special offer:Yes 
                  <input name="jia" type="radio" value="0" checked>&nbsp;&nbsp;&nbsp; 
				No
                  <input type="radio" name="jia" value="1"> 
                </td>
              </tr>
            </table>
            <p>
              <input type="submit" value="Add" name="B1" class=input>
              <input type="reset" value="Reset" name="B2" class=input>
            </p>
    
      
    </td>
  </tr>
</table>
</form>

</body>
</html>

<%end if%>

⌨️ 快捷键说明

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