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

📄 add_news_class_di3.asp

📁 一套企业全站
💻 ASP
字号:
<!--#include file=inc/conn.asp-->
<!--#include file=../../inc/checkadmin.asp-->




<!--#include file=../../../ajaxLIB/ajaxLIB.asp-->


<link rel="stylesheet" href="../../css/mycss1.css" type="text/css">




<%
AJAXshowLoader()
AJAXshowSweetTitles2()
%>



<%


set rsq=server.createobject("adodb.recordset")
sql = "select * from sys_data_aboutus_di2cen_class"
rsq.open sql,conn,1,1
%>
<script language="javascript">
var onecount;
subcat = new Array();
        <%
        count = 0
        do while not rsq.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rsq("class_name"))%>","<%= trim(rsq("di1_parent_id"))%>","<%= trim(rsq("ID"))%>");
        <%
        count = count + 1
        rsq.movenext
        loop
        rsq.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.SmallClassName.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
var dd=0;
            if (subcat[i][1] == locationid)
            { 
dd=dd+1;
 document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
            }     



        }


if( dd==0)  {

document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option("请先添加第二级分类","" );
           


} 
    }  



</script>





























<%

self="add_news_class_di3.asp"
admin_page="admin_news_class_di3.asp"


ClassName=request("title")
ParentId=request("BigClass")
if ClassName<>"" then





if request("BigClassName")="" then
%>


<script language=javascript>alert("请选择第一级分类,第一级分类不能为空");self.location="<%=self%>";</script>

<%
response.end
end if



if request("SmallClassName")="" then
%>


<script language=javascript>alert("请选择第二级分类,第二级分类不能为空");self.location="<%=self%>";</script>

<%
response.end
end if






set rs2=server.CreateObject("adodb.recordset")
rs2.open "select * from sys_data_aboutus_di3cen_class",conn,1,3


rs2.addnew
rs2("class_name")=ClassName
rs2("parent_id_of_di1")=request("BigClassName")

rs2("parent_id_of_di2")=request("SmallClassName")



rs2.update
rs2.close
set rs2=nothing
%>
<script language=javascript>alert("添加成功");self.location="<%=admin_page%>";</script>
<%
end if
%>

















<div  id="nnn" style="filter:blendTrans(duration=1); position:absolute;visibility:hidden; width:774px; z-index:-1; left: 3px; top: 20px; height: 121px;">







<form method="POST" name="myform" action="<%=self%>" target="_self">
<table width="650" border="0" align="center" cellpadding="0" cellspacing="1">
  <tr align="center">
    <th height="30" colspan="2"><strong>添加第三级分类</strong>&nbsp;      </th>
  </tr>




  <tr bgcolor="#FFFFFF">
    
    <td width=200>&nbsp;属于哪个第一级分类</td>





<td>
<% 		openconn()
set rs=server.createobject("adodb.recordset")



        sql = "select * from sys_data_aboutus_class"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加一级分类"
		else
		%>
                    <select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
                      <option selected value="<%=trim(rs("ID"))%>"><%=trim(rs("news_type_name"))%></option>
                      <%
			dim selclass
		    selclass=rs("ID")
        	rs.movenext
		    do while not rs.eof
			%>
                      <option value="<%=trim(rs("ID"))%>"><%=trim(rs("news_type_name"))%></option>
                      <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%></select>


</td></tr>

  <tr bgcolor="#FFFFFF">
    
    <td>&nbsp;属于哪个第二级分类</td>


<td>
    <select name="SmallClassName">
      <option value="" selected>请选择二级分类</option>
                      <%
			sql="select * from sys_data_aboutus_di2cen_class where  di1_parent_id='" & selclass & "'"
			rs.open sql,conn,1,1
			if not(rs.eof and rs.bof) then
			%>
                      <option value="<%=rs("ID")%>"><%=rs("class_name")%></option>
                      <% rs.movenext
				do while not rs.eof%>
                      <option value="<%=rs("ID")%>"><%=rs("class_name")%></option>
                      <%
			    	rs.movenext
				loop
else

%>

  <option value="">请先添加第二级分类</option>


<%
			end if
	        rs.close
			%>
    </select></td>
  </tr>












    <tr bgcolor="#FFFFFF">
    <td width="87" height="30" align="right">分类名:</td>
    <td width="560">&nbsp;&nbsp;<input name="title" type="text" id="title"></td>
  </tr>
    


  <tr bgcolor="#FFFFFF">
    <td height="30" align="right"></td>
    <td>&nbsp;&nbsp;
    <input type="submit" name="Submit" value=" 添 加 "></td>
  </tr>
</table>
</form>


</div>




<script language=javascript>
AJAXfade(1,'nnn')
</script>



<%
AJAXcloseLoader()
%>

⌨️ 快捷键说明

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