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

📄 bigclass.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=bigclass.asp>
  <tr>
    <td height="22" bgcolor="#9AFF9A">&nbsp;&nbsp;当前管理:<font color="red">新闻项目</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
	bigclsname=trim(request("bigclsname"))
	if bigclsname="" then
	response.write"<script>alert('项目名称不能为空!');window.navigate('bigclass.asp?add=增加');</script>"
	else
	rs.open"select * from class where clsname='"&bigclsname&"' and parent=0",conn,1,3
	if not rs.eof then
    response.write"<script>alert('该项目已经存在!');window.navigate('bigclass.asp?add=增加');</script>"
	else
	rs.addnew
	rs("clsname")=bigclsname
	rs("parent")=0
	rs.update
	response.write"<script>alert('该项目添加成功!');window.navigate('bigclass.asp?add=增加');</script>"
	end if
	rs.close
	set rs=nothing
    end if
	end if%>
	
	<form method=post action=bigclass.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>
      <tr>
        <td height="22" align="center">项目名称:</td>
        <td><input type=text size=12 name="bigclsname" 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 class where parent="&id,conn,1,3
	while not rs2.eof
	rs2.delete
	rs2.movenext
	wend
	rs2.close
	rs2.open"select * from article where bigclsid="&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('bigclass.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=bigclass.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"))
	bigclsname=trim(request("bigclsname"))
	
	if bigclsname="" then
	response.write"<script>alert('项目名称不能为空!');window.navigate('bigclass.asp?edit=修改&id="&id&"&edit2=修改');</script>"
	else
	rs.open"select * from class where id<>"&id&" and parent=0",conn,1,1
    while not rs.eof
	if rs("clsname")=bigclsname then
	response.write"<script>alert('该项目已经存在!');window.navigate('bigclass.asp?edit=修改&id="&id&"&edit2=修改');</script>"
	end if
	rs.movenext
	wend
	rs.close
	rs.open"select * from class where id="&id,conn,1,3
	rs("clsname")=bigclsname
	rs.update
	response.write"<script>alert('该项目修改成功!');window.navigate('bigclass.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=bigclass.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="bigclsname" 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=bigclass.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 + -