<!--#include file="../setting/conn.asp"--><%:SoonBiz.chkadmin:act=SoonBiz.ract():Select Case act:Case "" : soonhostlist:Case "list" : soonhostlist:Case "clean" : clean:Case "doclean" : doclean:Case "recycle" : recycle:Case "remove" : remove :Case "removeall" : removeall :Case "batchsend" : batchsend :Case "Dobatchsend" : Dobatchsend:Case "del":SoonBiz.execute("update "& sheethead &"_shortmessage set isdel=1 where id in ("&SoonBiz.rids&")"):SoonBiz.ok:End Select:SoonBiz.adfoot:setallnothing:Sub listfilter():Response.Write "<form method=get action=""?"">":Response.Write "<input type=""hidden"" name=""act"" value=""list"" />":Response.Write "<table class=tableborder1 cellspacing='1'>":Response.Write " <tr>":Response.Write " <th colspan=n>短消息管理</th>":Response.Write " </tr>":Response.Write " <tr>":Response.Write " <td>":Response.Write " <input type=""text"" name=""keyword"" id=""keyword"">":Response.Write " <select name=""myfield"" id=""myfield"">":Response.Write " <option value=""content"">按内容搜索</option>":Response.Write " <option value=""snickname"">发信息人</option>":Response.Write " <option value=""rnickname"">收信息人</option>":Response.Write " </select>":Response.Write " <select name=""readed"" id=""readed"">":Response.Write " <option value="""">显示全部消息</option>":Response.Write " <option value=""0"">显示未读消息</option>":Response.Write " <option value=""1"">显示已读消息</option>":Response.Write " </select>":Response.Write " <input type=""submit"" value=""搜索"" class=""submit"">":Response.Write " </td>":Response.Write " </tr>":Response.Write "</table>":Response.Write "</form>":Response.Write "<br />":End Sub:Sub soonhostlist():Dim readed:Dim sql,astr:Dim shujun:readed=SoonBiz.rid("readed"):sql="select * from ["& sheethead &"_shortmessage] where isdel=0 ":astr=SoonBiz.PlusSQL(sql,"?act="&act)
If readed > 0 Then 
astr(0)=astr(0) & " and readed="&readed:astr(1)=astr(1) & "&readed="&readed:astr(2)=astr(2) & "CheckSel(""readed"","& readed &");"
End If:astr(0)=astr(0) & " order by id desc ":SoonBiz.title="短消息管理":SoonBiz.adhead:SoonBiz.nstate("短消息管理"):listfilter:shujun="<tr onmouseover=""this.style.backgroundcolor='#e2e8f4'"" onmouseout=""this.style.backgroundcolor=''"" align='center'> <td>{$id}</td> <td>{$snickname}</td> <td>{$rnickname}</td> <td align='left'>{$content}</td> <td>{$stime_short}</td> <td><script type=""text/javascript"">isright({$readed});</script></td> <td><input type='checkbox' name='id' value='{$id}'></td> </tr>":Response.Write "<form method=post name='myform' action='' id='myform'>":Response.Write " <table class=tableborder1 cellspacing='1'>":Response.Write " <tr>":Response.Write " <th width=40>ID</th>":Response.Write " <th width=80>发送人</th>":Response.Write " <th width=80>接收人</th>":Response.Write " <th width=*>内容</th>":Response.Write " <th width=60>时间</th>":Response.Write " <th width=60>已读</th>":Response.Write " <th width=30>选择</th>":Response.Write " </tr>":Response.Write SoonBiz.ReplaceMdb("",astr(0),shujun,"",0):Response.write "</table>":Response.write SoonBiz.PageList(""):Response.Write "<div class=""operate"">":Response.Write " <input type=""button"" onClick=""CheckAll(myform)"" value=""全选"">":Response.Write " <input type=""button"" onClick=""ContraSel(myform)"" value=""反选"">":Response.Write " <input type=""button"" onClick=""Csubmit('myform','?act=del','确定要删除选择的消息么?')"" value=""删除"">":Response.Write "</div>":Response.Write "</form>":Response.Write "<script type=""text/javascript"">"& astr(2) &"</script>":End Sub:Sub clean():SoonBiz.title="清理短消息":SoonBiz.adhead:SoonBiz.Nstate("清理短消息"):Response.Write " <form method=post action=""?act=doclean"">":Response.Write " <table class=tableborder1 cellspacing='1'>":Response.Write " <tr>":Response.Write " <th colspan=2>清理短消息</th>":Response.Write " </tr>":Response.Write " <tr>":Response.Write " <td width=""150"">日期条件</td>":Response.Write " <td><input type=""text"" name=""days"" size=""3"" maxlength=""3"">&nbsp;天前发送的短消息</td>":Response.Write " </tr>":Response.Write " <tr>":Response.Write " <td>消息状态</td>":Response.Write " <td><input type=""checkbox"" name=""readed"" value=1>包括未读信息</td>":Response.Write " </tr>":Response.Write " <tr>":Response.Write " <td>发送人昵称</td>":Response.Write " <td><input type=""text"" name=""snickname"" id=""snickname"" size=""16"" maxlength=""16"" /></td>":Response.Write " </tr>":Response.Write " </table>":Response.Write " <div class=""operate""><input type=""submit"" value=""清理""></div>":Response.Write " </form>":End Sub:Sub doclean():Dim days,readed,snickname:Dim sql:days=SoonBiz.rid("days"):readed=SoonBiz.rid("readed"):snickname=SoonBiz.RequestStr("发信息人","snickname","post",1,1,16,60,0):ShowErr(""):sql="update "& sheethead &"_shortmessage set isdel=1 where isdel=0 "
If days>0 Then
sql=sql & " and datediff("& SoonBiz.mdbtime("d") &",stime,"& soonbizcom &") > " & days
End If
If readed <1 Then 
sql=sql & " and readed=1 " 
Else 
End If
If snickname<>"" Then
sql=sql & " and snickname='"& snickname &"'"''ofhisan:"^"&:them:hadthanstill:"':
End If:SoonBiz.execute(sql):SoonBiz.AdSuccess("删除成功"):End Sub:Sub Batchsend():Dim jintong:SoonBiz.title="批量发送短消息":SoonBiz.adhead:SoonBiz.nstate("批量发送短消息"):Response.Write "<form method=""post"" name=""myform"" id=""myform"" action=""?act=Dobatchsend"" >":Response.Write "<table cellspacing=1 class=tableborder1>":Response.Write "<tr>":Response.Write "<th colspan=2>批量发送短消息</th>":Response.Write "</tr>":Response.Write "<tr>":Response.Write "<td width=100>用户组:</td>":Response.Write "<td>":Response.Write SoonBiz.ReplaceXml(""& sheethead &"_group","group","<input type=""checkbox"" name=""id"" id=""id{$id}"" value=""{$id}"" />{$title} ",""):Response.Write "</td>":Response.Write "</tr>":Response.Write "<td>消息内容:</td>":Response.Write "<td><textarea name=""content"" rows=""5"" class=""inputtext""></textarea></td>":Response.Write "</tr>":Response.Write "</table>":Response.Write "<div class=""operate""><input type=""submit"" value=""发送""></div>":Response.Write "</form>":Response.Write "<script type=""text/javascript"">getobj(""id4"").disabled=true;</script>":Response.Write "":SoonBiz.ostate("<li>批量发送的短消息直接放入发送者的回收站</li><li>批量发送会占用大量服务器资源,请选择好发送时间.</li>"):End Sub:Sub Dobatchsend():Dim content:Dim sql:Dim rs,arrs,i,jinfang :Dim thisfield(9),thisvalue(9):content=SoonBiz.RequestStr("内容","content","post",1,2,5000,0,1) :ShowErr(""):Set rs=SoonBiz.execute("select id,user_nickname from "& sheethead &"_user where user_gid in("& SoonBiz.rids &")")
If rs.eof Then
arrs=""
Else:arrs=rs.getrows(-1)
End If:Rs.Close:Set Rs=Nothing
If isarray(arrs) Then'getthenmyall::but::afterhere:':our*mymight'
jinfang=ubound(arrs,2):Server.ScriptTimeOut=999999:For i=0 To jinfang:thisfield(0)="suid" : thisvalue(0)=SoonBiz.user_id:thisfield(1)="snickname" : thisvalue(1)="'"& SoonBiz.user_nickname &"'":thisfield(2)="ruid" : thisvalue(2)=arrs(0,i):thisfield(3)="rnickname" : thisvalue(3)="'"& arrs(1,i) &"'":thisfield(4)="content" : thisvalue(4)="'"& SoonBiz.Checkstr(content) &"'":thisfield(5)="del_s" : thisvalue(5)=1:thisfield(6)="del_r" : thisvalue(6)=0:thisfield(7)="stime" : thisvalue(7)=soonbizcom:thisfield(8)="readed" : thisvalue(8)=0:thisfield(9)="isdel" : thisvalue(9)=0:sql="insert into "& sheethead &"_shortmessage ("& join(thisfield,",") &") values ("& join(thisvalue,",") &")":SoonBiz.execute(sql):Next
End If:SoonBiz.adsuccess("发送成功"):End Sub:Sub recycle():Dim sql,url:Dim tr:sql="select * from ["& sheethead &"_shortmessage] where isdel=1 ":url="?page={$page}&act="&act:sql=sql & " order by id desc ":SoonBiz.title="用户短消息回收站":SoonBiz.adhead:SoonBiz.nstate("用户短消息回收站"):Response.Write "<form method=post id=""myform"" name=""myform"" action="""">":Response.Write "<table class=tableborder1 cellspacing='1'>":Response.Write "<tr>":Response.Write "<th width=40>ID</th>":Response.Write "<th width=80>发送人</th>":Response.Write "<th width=80>接收人</th>":Response.Write "<th width=*>内容</th>":Response.Write "<th width=60>时间</th>":Response.Write "<th width=40>读</th>":Response.Write "<th width=30>选择</th>":Response.Write "</tr>":tr="<tr onmouseover=""this.style.backgroundcolor='#e2e8f4'"" onmouseout=""this.style.backgroundcolor=''"" align='center'> <td>{$id}</td> <td>{$snickname}</td> <td>{$rnickname}</td> <td align='left'>{$content}</td> <td>{$stime_short}</td> <td>{$readed}</td> <td><input type='checkbox' name='id' value='{$id}'></td> </tr>":Response.Write SoonBiz.ReplaceMdb("",sql,tr,"",0):Response.write "</table>":Response.write SoonBiz.PageList(""):Response.Write "<br />":Response.Write "<div class=""operate"">":Response.Write " <input type=""button"" onClick=""CheckAll(myform)"" value=""全选"">":Response.Write " <input type=""button"" onClick=""ContraSel(myform)"" value=""反选"">":Response.Write " <input type=""button"" onClick=""Csubmit('myform','?act=remove','确定要删除选择的消息么?\n删除后不可恢复')"" value=""从回收站删除"">":Response.Write " <input type=""button"" onClick=""Csubmit('myform','?act=removeall','确定要清空回收站吗?\n清除后不可恢复')"" value=""清空回收站"">":Response.Write "</div>":Response.Write "</form>":End Sub:Sub remove():Dim sql:id=SoonBiz.rids:sql="delete from "& sheethead &"_shortmessage where isdel=1 and id in("& id &")":SoonBiz.execute(sql):SoonBiz.ok:End Sub:Sub RemoveAll():Dim sql:sql="delete from "& sheethead &"_shortmessage where isdel=1":SoonBiz.execute(sql):SoonBiz.ok:End Sub
%>