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

📄 adminpm.asp

📁 一个不错的论坛原代码
💻 ASP
字号:
<!--#include file="Connections.asp" -->
<!--#include file="adminaccess.asp" -->

<body  <%=background%> >
 <% if Request.QueryString("action")="do" then
q_receive=chktopic(request.form("q_receive"))
q_title=chktopic(request.form("q_title"))
q_content=chktopic(request.form("q_content"))
if q_title="" or q_content="" then
Errormsg=Errormsg+"<br>"+"<li>标题和内容不能为空"
	call error(errormsg)
response.end 
end if

if  q_receive=0 then
sql6="select username from user"
set rs6=conn.execute(sql6)
do while not rs6.eof
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send,q_time) values('"&rs6("username")&"','"&q_title&"','"&q_content&"','admin','"&nowtime&"')"
conn.Execute(sqlpm)
rs6.movenext
loop

elseif  q_receive=1 then
sql6="select username from user where grade='"&q_receive&"'"
set rs6=conn.execute(sql6)
do while not rs6.eof
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send,q_time) values('"&rs6("username")&"','"&q_title&"','"&q_content&"','admin','"&nowtime&"')"
conn.Execute(sqlpm)
rs6.movenext
loop


elseif  q_receive=3 then
sql6="select username from user where grade='0'"
set rs6=conn.execute(sql6)
do while not rs6.eof
sqlpm="insert into pm (q_receive,q_title,q_content,q_send,q_time) values('"&rs6("username")&"','"&q_title&"','"&q_content&"','admin','"&nowtime&"')"
conn.Execute(sqlpm)
rs6.movenext
loop

elseif  q_receive=4 then
sql6="select o_username from [online] where o_username<>'客人'"    
set rs6=conn.execute(sql6)
do while not rs6.eof
sqlpm="insert into pm (q_receive,q_title,q_content,q_send,q_time) values('"&rs6("o_username")&"','"&q_title&"','"&q_content&"','admin','"&nowtime&"')"
conn.Execute(sqlpm)
rs6.movenext
loop

elseif  q_receive=5 then
sql6="select username from [user] where grade='0' or grade='1' or grade='2'"             
set rs6=conn.execute(sql6)
do while not rs6.eof
sqlpm="insert into pm (q_receive,q_title,q_content,q_send,q_time) values('"&rs6("username")&"','"&q_title&"','"&q_content&"','admin','"&nowtime&"')"
conn.Execute(sqlpm)
rs6.movenext
loop

elseif  q_receive=6 then
sql6="select username from [user] where  grade='3'"             
set rs6=conn.execute(sql6)
do while not rs6.eof
sqlpm="insert into pm (q_receive,q_title,q_content,q_send,q_time) values('"&rs6("username")&"','"&q_title&"','"&q_content&"','admin','"&nowtime&"')"
conn.Execute(sqlpm)
rs6.movenext
loop




elseif  q_receive=2 then
sql6="select username from user where grade='2'"
set rs6=conn.execute(sql6)
do while not rs6.eof
sqlpm="insert into pm (q_receive,q_title,q_content,q_send,q_time) values('"&rs6("username")&"','"&q_title&"','"&q_content&"','admin','"&nowtime&"')"
conn.Execute(sqlpm)
rs6.movenext
loop



end if
response.write "<script>alert(""短信发送成功"");</script>"
end if
if Request.QueryString("action")="del" then
q_send=chktopic(request.form("q_send"))
sql="delete q_send from pm where q_send='"&q_send&"'"
conn.execute(sql)
response.write "<script>alert(""批量删除完毕"");</script>"
end if
if Request.QueryString("action")="deladmin" then
q_read=request.form("q_read")
if q_read=1 then
sql="delete q_send from pm where q_send='admin'"
else
sql="delete q_send from pm where q_send='admin' and q_read=1"
end if
conn.execute(sql)
response.write "<script>alert(""批量删除完毕"");</script>"
end if
if Request.QueryString("action")="deluser" then
q_read=chktopic(request.form("q_read"))
if q_read=1 then
sql="delete q_send from pm"
else
sql="delete q_send from pm where q_read=1"
end if
conn.execute(sql)
response.write "<script>alert(""批量删除完毕"");</script>"
end if

%>


<script language="JavaScript">
function CheckForm()
{
	
	if (document.form1.q_title.value.length == 0) 
{
		alert("为了方便,请输入标题.");
		document.form1.q_title.focus();
		return false;
	}
	if (document.form1.q_content.value.length == 0) 
{
		alert("请输入内容.");
		document.form1.q_content.focus();
		return false;
	}
		return true;
}
 </script>

<form name="form1" method="POST" action="?action=do" onSubmit="return CheckForm();">
 
<table  border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >
    <tr align="center"> 
      <td colspan="2" <%=tColor%> class=tdc1 height=22>群发短信设置</td>
    </tr>
    <tr> 
      <td align="right" width="20%" bgcolor=<%=tColor2%> class=tdc>短信主题:</td>
      <td bgcolor=<%=tColor2%> class=tdc> 
        <input type="text" name="q_title" class=tdc size="30" >
      </td>
    </tr>
    <tr>
      <td align="right" width="20%" bgcolor=<%=tColor2%> class=tdc>接收人:</td>
      <td bgcolor=<%=tColor2%> class=tdc> 
        <select size="1" name="q_receive">
        <option selected value="0">所有用户</option>
<option value="6">认证会员</option>
        <option value="2">所有版主</option>
        <option value="1">所有总版主</option>
         <option value="3">所有管理员</option>
<option value="4">在线会员</option>
<option value="5">管理员/总版主/版主</option>
        </select>
      </td>
    </tr>
    <tr> 
      <td align="right" width="20%" bgcolor=<%=tColor2%> class=tdc>短信内容:</td>
      <td bgcolor=<%=tColor2%> class=tdc> 
        <textarea rows="4" name="q_content" cols="50"></textarea>
      </td>
    </tr>
    <tr> 
      <td width="20%" align="right" bgcolor=<%=tColor2%> class=tdc> </td>
      <td bgcolor=<%=tColor2%> class=tdc> 
        <input type="submit" name="Submit" value="提交" class=bdtj>
        <input type="reset" name="Submit2" value="重置" class=bdtj>
      </td>
    </tr>
  </table>
  </div>
  </form>
 

<table  border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >

 <form name="form2" method="POST" action="?action=del" >
    <tr>
      <td colspan="2" class=tdc1 height=24 <%=hColor%>>
      <p align="center">批量删除短信</td>
    </tr>
    <tr align="center"> 
      <td colspan="2" <%=tColor%> class=tdc1 height=22>删除由某用户发出的短信</td>
    </tr>
    <tr> 
      <td align="center" width="50%" bgcolor=<%=tColor2%> class=tdc><div align="center">
        <input name="q_send" class=tdc size="25" ></div></td>
      <td bgcolor=<%=tColor2%> class=tdc> 
        &nbsp;<input type="submit" name="Submit" value="提交" class=bdtj onclick="{if(confirm('确定删除纪录吗?')){this.document.recycle.submit();return true;}return false;}"></td>
    </tr>
  </form>
    </table>
  </div>

 
 <table  border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >

   <form name="form2" method="POST" action="?action=deladmin" >
    <tr align="center"> 
      <td colspan="2" <%=tColor%> class=tdc1 height=22>删除由管理员发出的短信</td>
    </tr>
    <tr> 
      <td align="right" width="10%" bgcolor=<%=tColor2%> class=tdc> 
        <p align="center"><input type="checkbox" name="q_read" value="1">包括未读的(默认只删除已读的)</td>
      <td align="right" width="10%" bgcolor=<%=tColor2%> class=tdc>
      <p align="left">&nbsp;<input type="submit" name="Submit" value="提交" class=bdtj onclick="{if(confirm('确定删除纪录吗?')){this.document.recycle.submit();return true;}return false;}"> 
         </td>
    </tr>
 </form>
    </table>
  </div>
 
   
<table  border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >

   <form name="form2" method="POST" action="?action=deluser" >
    <tr align="center"> 
      <td colspan="2" <%=tColor%> class=tdc1 height=22>删除论坛所有短信</td>
    </tr>
    <tr> 
      <td align="right" width="10%" bgcolor=<%=tColor2%> class=tdc> 
        <p align="center"><input type="checkbox" name="q_read" value="1">包括未读的(默认只删除已读的)</td>
      <td align="right" width="10%" bgcolor=<%=tColor2%> class=tdc>
      <p align="left">&nbsp;<input type="submit" name="Submit" value="提交" class=bdtj onclick="{if(confirm('确定删除纪录吗?')){this.document.recycle.submit();return true;}return false;}"> 
         </td>
    </tr>
  </form>
  <%dim sqlpm,rspm,pmid
  sqlpm="select count(q_send) as pmid from pm"
  set rspm=conn.execute(sqlpm)
  pmid=rspm("pmid")
  set rspm=nothing%>
      <tr> 
      <td align="center" width="20%" bgcolor=<%=tColor2%> class=tdc colspan="2">当前论坛总共有 <%=pmid%> 条短信 
         </td>
    </tr>
    </table>
  </div>





<%
 conn.close
set conn=nothing%>





⌨️ 快捷键说明

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