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

📄 pud_add.asp

📁 网站的后台管理代码......内容比较全面....新手比较适合
💻 ASP
字号:
<%
'====================================================================
'
'           中国企业平台后台管理系统  版权所有:中国企业平台
'
'                公司网址 http://www.cnept.net
'
'                        版权所有 翻版必究
'====================================================================
%>
<!--#include file="../inc/adconn.asp"-->
<!--#include file="../css.asp"-->
<% set rs=server.CreateObject("adodb.recordset") %>
<%
if session("admin_name")="" then 
response.end
end if%>
<% dim title,pic,content,sclass
if request("action")="save" then 
title=trim(request.Form("title"))
content=trim(request.Form("hw_content"))
dalei=request.Form("dalei")
xiaolei=request.Form("xiaolei")
sql="select * from pud order by id desc"
rs.open sql,conn,1,3
rs.addnew
rs("nbigarea")=dalei
rs("nsmallarea")=xiaolei
rs("title")=title
rs("content")=content
rs.update
response.Write "添加产品成功!!"
	response.Write "<a href='pud_manage.asp'>"
	Response.Write "返回"
	Response.Write("</a>")
%>
	<%end if%>
	
	<script language="JavaScript">
<%
set rs=server.createobject("adodb.recordset")
sql = "select * from nsmallarea "
rs.open sql,conn,1,1
%>
    var onecount;
    onecount=0;
    subcat = new Array();
        <%count = 0
        do while not rs.eof %>
    subcat[<%=count%>] = new Array("<%= trim(rs("nsmallarea"))%>","<%=cstr(rs("nbigarea"))%>","<%=cstr(rs("id"))%>");<%count = count + 1
        rs.movenext
        loop
        rs.close
        %>
    onecount=<%=count%>;
	
	
function changelocation(locationid)
    {
    document.dataform.xiaolei.length = 0; 

    var locationid=locationid;
    var i;
    document.dataform.xiaolei.options[document.dataform.xiaolei.length] = new Option('直属大类',0);
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.dataform.xiaolei.options[document.dataform.xiaolei.length] = new Option(subcat[i][0], subcat[i][2]);
            }   
			
 
        }
	if(document.dataform.xiaolei.length == 0)
	{
	document.dataform.xiaolei.options[document.dataform.xiaolei.length] = new Option("没有相关小类", "0");
	}
		
		
		
    }
// end JavaScript -->
</script>



<SCRIPT language=JavaScript>
function checkit()
{
  if (document.dataform.dalei.value.length==0)
  {
    alert("请选择信息一类!");
	document.dataform.dalei.focus();
	return false;
  }
  if (document.dataform.xiaolei.value.length==0)
  {
    alert("请选择信息二类!");
	document.dataform.xiaolei.focus();
	return false;
  }
  if (document.dataform.proname.value.length==0)
  {
    alert("请填写信息名称!");
	document.dataform.proname.focus();
	return false;
  }
  
  return true;
}
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<title>添加产品</title>
<link rel="stylesheet" type="text/css" href="../news/style.css">

<form method="POST" name="dataform" action="pud_add.asp?action=save">
<INPUT name=upfile onchange=return(OnUpFile()) type=hidden>
<INPUT name=upfile2 onchange=return(OnUpFile2()) type=hidden>
  <TABLE cellSpacing=1 cellPadding=0 width="550" 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="100%" height="30" valign="bottom" bgcolor="#FFCC00" id=maintitle>产品添加 -&gt;<b>所有选项都必须填写</b></TD>
            </TR>
          </TBODY>
        </TABLE>
        </TD>
    </TR>
    <TR> 
      <TD id=mainbg> 
	  
	    <TABLE cellSpacing=1 cellPadding=4 width="100%" border=0 height="187">
            <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></label>
                  <font color=#333333>
                  <input type="text" name="title">
                  </font>
                <div align="center"></div> </TD>
              </TR>
              <TR>
                <TD bgColor=#ffffff height="30">产品大类</TD>
                <TD height="30" bgColor=#ffffff><select name="dalei" id="dalei" onChange="changelocation(document.dataform.dalei.options[document.dataform.dalei.selectedIndex].value)" >
<option value="">选择一类</option>
<%set rs1=server.CreateObject("adodb.recordset")
sql1="Select * from nbigarea order by num" 
rs1.open sql1,conn,1,1
if rs1.eof and rs1.bof then
response.write "没有大类"
else
do while not rs1.eof 


%>
<option value="<%=rs1("id")%>"><%=rs1("nbigarea")%></option>
<%
rs1.movenext
loop
end if
rs1.close
set rs1=nothing

%>
</select> </TD>
              </TR>
              <TR>
                <TD bgColor=#ffffff height="30">产品小类</TD>
                <TD height="30" bgColor=#ffffff><select name="xiaolei" id="xiaolei">
                  <option selected>选择二类</option>
                </select></TD>
              </TR>
              <TR> 
                <TD bgColor=#ffffff height="30"> 
                  <div align="center" style="color: #000000">产品简介</div></TD>
                <TD height="30" align=center bgColor=#ffffff><input type="hidden" name="hw_content">
                  <iframe id="eWebEditor1" src="../eWebEditor/ewebeditor.asp?id=hw_content&style=s_blue" frameborder="0" scrolling="no" width="550" height="350"></iframe>
                  <font color=#ff6600> *</font></TD>
              </TR>
              <TR> 
                <TD height="30" colspan="2" bgColor=#ffffff> <div align="center"></div></TD>
              </TR>
              <TR> 
                <TD id=mainfoot colSpan=2 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/s_button000.gif" alt=进入 align=absMiddle width="45" height="20" cache tppabs="" >
                          </div></td>
                        <td> <div align="center"> 
                            <input type="reset" value="全部重写" name="B22" class=input>
                          </div></td>
                      </tr>
                    </table>
                  </div></TD>
              </TR>
            </TBODY>
          </TABLE>
		</TD>
    </TR>
  </TBODY>
</TABLE></form>  
</body>


⌨️ 快捷键说明

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