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

📄 smlclass.asp

📁 windowsCE 串口
💻 ASP
字号:
<!--#include file=check.asp-->
<!--#include file=conn.asp-->

<title>主题管理</title>
<link href=../style.css rel=stylesheet type=text/css>

<body topmargin="0" leftmargin="0" style="cursor:url(../images/2.gif)">

<table width="100%"  border="0" cellspacing="0" cellpadding="0">

<form method=post action=smlclass.asp>
  <tr>
    <td height="22" bgcolor="#9AFF9A">当前管理:<font color="#FF0000">新闻主题</font>
      <input name="add" type="submit" id="add" value="增加" class="button">
      <input name="del" type="submit" id="del" value="删除" class="button">
      <input name="edit" type="submit" id="edit" value="修改" class="button"></td>
  </tr>
</form>
  
  <%if request("add")="增加" then%>
  <tr><td height=20></td></tr>
    <tr>
    <td>
	<%if request("add2")="添加" then
	smlclsname=trim(request("smlclsname"))
	bigclsname=trim(request("bigclsname"))
	if smlclsname="" then
	response.write"<script>alert('主题名称不能为空!');window.navigate('smlclass.asp?add=增加');</script>"
	elseif bigclsname="" then
	response.write"<script>alert('主题名称不能为空!');window.navigate('smlclass.asp?add=增加');</script>"
	else
	rs.open"select * from class where clsname='"&bigclsname&"' and parent=0",conn,1,1
	rs2.open"select * from class where clsname='"&smlclsname&"' and parent="&rs("id"),conn,1,3
	if not rs2.eof then
    response.write"<script>alert('该主题已经存在!');window.navigate('smlclass.asp?add=增加');</script>"
	else
	rs2.addnew
	rs2("clsname")=smlclsname
	rs2("parent")=rs("id")
	rs2.update
	response.write"<script>alert('该主题添加成功!');window.navigate('smlclass.asp?add=增加');</script>"
	end if
	rs.close
	rs2.close
    end if
	end if%>
	<form method=post action=smlclass.asp?add=增加><table width="40%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#99CC99">
      <tr align="center" bgcolor="eeeeee">
        <td height="25" colspan="2"><span class="style1">添加主题</span></td>
        </tr>
		<%rs2.open"select * from class where parent=0",conn,1,1%>
	<tr>
        <td height="22" align="center">项目名称:</td>
        <td><select size=1 name="bigclsname">
		<%while not rs2.eof%><option value=<%=rs2("clsname")%>><%=rs2("clsname")%></option>
		<%rs2.movenext
		wend%>
		</select></td>
      </tr><%rs2.close%>
      <tr>
        <td height="22" align="center">主题名称:</td>
        <td><input type=text size=12 name="smlclsname" class="style2"></td>
      </tr>
      <tr align="center" bgcolor="eeeeee">
        <td height="25" colspan="2"><input name="add2" type="submit" id="add2" value="添加"class="button">
          <input name="clear" type="reset" id="clear" value="清除"class="button"></td>
        </tr>
    </table></form></td>
  </tr>
  
  <%elseif request("del")="删除" then%>
  <tr><td height=20></td></tr>
  
  <tr>
    <td>
	<%if request("del2")="删除" then
	id=cint(request("id"))
	rs.open"select * from class where id="&id,conn,1,3
	rs2.open"select * from article where smlclsid="&id,conn,1,3
	while not rs2.eof
	rs2.delete
	rs2.movenext
	wend
	rs2.close
	rs.delete
	rs.close
	response.write"<script>alert('该主题以及相关文章删除成功!');window.navigate('smlclass.asp?del=删除');</script>"
	end if%>
	<table width="60%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#eeeeee">
      <tr align="center" bgcolor="#9AFF9A">
        <td height="22">主题ID</td>
        <td>主题名称</td>
        <td>操作</td>
      </tr>
	  <%rs.open"select * from class where parent<>0",conn,1,1
	  while not rs.eof%>
	  <form method=post action=smlclass.asp?del=删除&id=<%=rs("id")%>>
      <tr>
        <td align="center"><%=rs("id")%></td>
        <td align="center"><%=rs("clsname")%></td>
        <td align="center"><input type=submit name="del2" value="删除"class="button"></td>
      </tr></form>
	  <%rs.movenext
	  wend
	  rs.close%>
     </table>
	</td>
  </tr>
  
  
  <%elseif request("edit")="修改" then%>
    <tr><td height=20></td></tr>
	
    <tr>
     <td>
	<%if request("edit3")="修改" then
	id=cint(request("id"))
	smlclsname=trim(request("smlclsname"))
	
	if smlclsname="" then
	response.write"<script>alert('主题不能为空!');window.navigate('smlclass.asp?edit=修改&id="&id&"&edit2=修改');</script>"
	else
	rs.open"select * from class where id="&id,conn,1,1
	rs2.open"select * from class where id<>"&id&" and parent="&rs("parent"),conn,1,1
    while not rs2.eof
	if rs2("clsname")=smlclsname then
	response.write"<script>alert('主题已经存在!');window.navigate('smlclass.asp?edit=修改&id="&id&"&edit2=修改');</script>"
	end if
	rs2.movenext
	wend
	rs2.close
	rs2.open"select * from class where id="&id,conn,1,3
	rs2("clsname")=smlclsname
	rs2("parent")=rs("parent")
	rs2.update
	rs2.close
	response.write"<script>alert('该主题修改成功!');window.navigate('smlclass.asp?edit=修改');</script>"

	rs.close
	end if
	end if %>
	<%if request("edit2")="修改" then
	id=cint(request("id"))
	rs.open"select * from class where id="&id,conn,1,3
	%><form method=post action=smlclass.asp?edit=修改&id=<%=id%>>
	<table width="60%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#eeeeee">
      <tr align="center" bgcolor="99cc99"><td colspan="2" height="22">修改主题</td></tr>
	  
	  <tr><td>主题名称:</td><td><input type=text class="style2" name="smlclsname" value=<%=rs("clsname")%>></td></tr>
	  
	  <tr align="center" bgcolor="99cc99"><td colspan="2">
	  <input type=submit name="edit3" value="修改"class="button">
	  <input type=reset name="clear" value="清除"class="button"></td></tr>
	</form><%
	response.end
	end if%>
	
	<table width="60%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#eeeeee">
      <tr align="center" bgcolor="#9AFF9A">
        <td height="22">主题ID</td>
        <td>主题名称</td>
        <td>操作</td>
      </tr>
	  
     <%rs.open"select * from class where parent<>0",conn,1,1
	  while not rs.eof %>
	 
	 <form method=post action=smlclass.asp?edit=修改&id=<%=rs("id")%>>
      <tr>              
		<td align="center"><%=rs("id")%></td>
        <td align="center"><%=rs("clsname")%></td>
        <td align="center"><input type=submit name="edit2" value="修改"class="button"></td>
      </tr></form>
	  <%rs.movenext
	  wend
	  rs.close%>
    </table></td>
  </tr>
<%end if%>

</table>

⌨️ 快捷键说明

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