<%qx="05"%>
<!--#include file="../login/0.asp"-->
<!--#include file="../../mycartconn/conn.asp"-->
<!--#include file="../../mycartconn/page.asp"-->
<TABLE>
 <TR>
 	<TD height=5></TD>
 </TR>
 </TABLE> 
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr valign="middle"> 
    <td width="100%" height="45"><b>站内短信</b>　|　<a href="guanli_1.asp">系统提示</a>　|　<a href="guanli_2.asp">网站公告</a></td>
  </tr>
</table>
<%
Dim pageSet
pageSet=request("pageSet")
If pageSet="" Then pageSet=10
If Not IsNumeric(pageSet) Then pageSet=10
s=" where lx=1"
if request("key")<>"" and request("lx")<>"" then
	if request("lx")<>"0" then
		s = s & "and name1 like '%"&request("key")&"%'"
	else
		s = s & "and name2 like '%"&request("key")&"%'"
	end if
else
	s=" where lx=1"
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="Select * From duanxin "&s&" Order By id DESC"
rs.open sql,conn,3,1 
page1(pageSet)
%><html>
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../../mycartconn/admin.css" type="text/css">
<script>
var IMGBaseURL		="http://www.hongdou999.com/webim/i/";
var GuaGuaURLs			="<a href='#'><u style='color:red'>";
var GuaGuaURLe			="</u></a>";
var BTP					="浏览器上无法查阅具体内容.想获得更多的信息与功能,请下载使用HD挂挂软件.";
var GGPicNotAllow	 	="您的好友正在使用HD挂挂给您发送截图,"+BTP;
var GGFileNotAllow	 	="[I:7:"+IMGBaseURL+"alert.gif]您的好友正在使用HD挂挂给您发送文件,"+BTP;
var GGSoundNotAllow 	="[I:7:"+IMGBaseURL+"alert.gif]您的好友正在使用HD挂挂给您发送音频请求,"+BTP;
var GGVedioNotAllow		="[I:7:"+IMGBaseURL+"alert.gif]您的好友正在使用HD挂挂给您发送视频请求,"+BTP;
function checkURL(obj){
	if(obj.href.indexOf("hongdou999.com")<0) return;
	if(obj.href.indexOf("http://www.hongdou999.com/webim/")==0){
		obj.href	=obj.href.replace(/http:\/\/webim\.hongdou999\.com\/webim\//ig,'http://');
	}
	if(obj.href.indexOf("http://www.hongdou999.com/my/")==0){
		obj.href	=obj.href.replace(/http:\/\/my\.hongdou999\.com\/inbox\//ig,'http://');
	}	
	return true;
}
function message_str_filter(memo){
	memo = memo.replace(/\r\n/g,"<br>");
	memo = memo.replace(/</g,"&lt;");
	memo = memo.replace(/>/g,"&gt;");
	memo = memo.replace(/&lt;br&gt;/g,"<br>");
	var ss=/\[I:0:(\d{1,3})\]/ig;
	memo = memo.replace(ss,"<img src='http://www.hongdou999.com/bbs/faces/standard/$1.gif'>");
	var s=/\[I:7:http:\/\/(.*?)\.hongdou999\.com\/(.*?)\]/ig;
	memo = memo.replace(s,"<img src='http://$1.hongdou999.com/$2'>");
	var s=/\[I:7:http:\/\/(.*?)\.hongdou999\.cn\/(.*?)\]/ig;
	memo = memo.replace(s,"<img src='http://$1.hongdou999.cn/$2'>");
	var s=/\[I:7:(.*?)\]/ig;
	memo = memo.replace(s,"<img src='"+IMGBaseURL+"noallow.gif'>");
	//var bb=/\[I:(\d):(.*?)\]/ig;
	//memo = memo.replace(bb,"<img src='"+IMGBaseURL+"alert.gif'>"+GGPicNotAllow+"<br><br>");
	var cc= /\[A\:0\:([^\]]+)?\]/ig;
	memo=memo.replace(cc,"<a target='_blank' href='$1' onclick=\"return checkURL(this)\"><u>$1</u></a>");
	memo=memo.replace(/使用HD挂挂给/ig,"使用"+GuaGuaURLs+"HD挂挂"+GuaGuaURLe+"给");
	memo=memo.replace(/下载使用HD挂挂软件/ig,GuaGuaURLs+"下载使用HD挂挂软件"+GuaGuaURLe);
	memo = memo.replace(/\|\|/g,"|");
	return memo;
}
function webImShowMessage(m,t,f){
		try{
			m=decodeURIComponent(m);
		}catch(e){}
		var tmpArr	=m.match(/\[font=(.*?),(.*?),(.*?),(.*?),(.*?),(.*?),(.*?)\](.*)\[\/font\]/);
		if(!tmpArr){
			tmpArr	=m.match(/\[font=(.*?),(.*?),(.*?),(.*?),(\d)\](.*)\[\/font\]/);
			if(!tmpArr) return m;
			var fstyle		=parseInt(tmpArr[5]);
			var fw 	= new Array('normal','bold');
			var fi  = new Array('normal','italic');
			var ul 	= new Array('normal', 'underline');
			var flag   =fstyle.toString(2);
			if(flag.length<3){
				if(flag.length<2)
					flag	="00"+flag;
				else
					flag	="0"+flag;
			}
			var underline 	= ul[parseInt(flag.substr(0,1))];
			var fontstyle 	= fi[parseInt(flag.substr(1,1))];
			var fontweight 	= fw[parseInt(flag.substr(2,1))];			
			var memo		=message_str_filter(tmpArr[6]);
		}else{
			var fontweight	=tmpArr[5].replace(/expression/ig,'');
			var fontstyle	=tmpArr[6].replace(/expression/ig,'');
			var underline	=tmpArr[7].replace(/expression/ig,'');	
			var memo		=message_str_filter(tmpArr[8]);
		}		
		var fc	=tmpArr[3].replace(/expression/ig,'');
		var ff	=tmpArr[1].replace(/expression/ig,'');
		var fs	=parseInt(tmpArr[2].replace(/expression/ig,''));
		if(fs>12) fs=12;
		if(t==9) var tag="div"; else var tag="p";
		if(memo.substring(0,8)=="[GETGIF]"){
			if(f!=Account && f!=undefined)
				memo	="<font color=red>提示:对方赠送给您一朵玫瑰，希望和你聊天!&nbsp;&nbsp;<a href=\"javascript:addFriends('"+f+"')\">加"+f+"为好友</a></font><br>"+memo.substring(8);
			else
				memo	=memo.substring(8);
		}
		return "<"+tag+" align='left' style='background-color:white;color:"+fc+";font-family:"+ff+";font-weight:"+fontweight+";font-style:"+fontstyle+";font-size:"+fs+"pt;text-decoration:"+underline+";padding-left:20px;'>"+memo+"</"+tag+">"
}
function filterMessage(memo,mid,from,type){
	var filterText	="";
	if(filterText=="")	return memo;
	if(filterText.indexOf("~")>=0)
		filterText	=decodeURIComponent(filterText.replace(/~/ig,"%"));
	else
		filterText	=decodeURIComponent(filterText);
	if(type==0){
		memo	=memo.replace(/<p(.*?)>(.*?)<\/p>/ig,"$2");
		memo	=memo.replace(/<img.*?>/ig,'[图片]');
		memo	=memo.replace(/<a .*?>(.*?)<\/a>/ig,'$1');
	}
	//if(filterText!="")
		memo	=replaceText(memo,filterText,"<font color=black style='background-color:yellow'>"+filterText+"</font>");
	if(from!="")
		return "<a href='?action=list&user=&from="+from+"&id="+mid+"&memo='>"+memo+"</a>";
	else
		return memo;
}
function ParseMsgBody(mid,msg,t,from,type){
	try{
		document.all("msg_body_"+mid).innerHTML	=filterMessage(webImShowMessage(msg,t),mid,from,type);
	}
	catch(e){
		document.all("msg_body_"+mid).innerHTML	="正在解析消息...";
		setTimeout("ParseMsgBody("+mid+",'"+msg+"',"+t+",'"+from+"',"+type+")",1000);
	}
}
</script>
<script>
function dokeydown(key,lx,num){
  self.location.href="?key=" + key + "&lx=" + lx + "&pageSet=" + num;
}
</script>
<table width="600" border="0" align="center" cellpadding="2" cellspacing="0">
  <form action="?" method="post" name="form" id="form"><tr>
    <td>
        <input name="key" type="text" class="wenbenkuang" id="key">
        <select name="lx" class="wenbenkuang" id="lx">
          <option value="0" selected>发信人</option>
          <option value="1">收信人</option>
        </select>
        <input name="Submit" type="submit" class="go-wenbenkuang" value="OK,查询显示">
		　　　　　每页显示&nbsp;<input name="pageSet" type="text" class="wenbenkuang" id="pageSet" onkeydown="javascript:if(event.keyCode==13)dokeydown('<%=request("key")%>','<%=request("lx")%>',this.value);" value="<%=pageSet%>" size="3" maxlength="4">&nbsp;条
      </td>
  </tr></form>
</table>
<table width="650" align="center" style="TABLE-LAYOUT: fixed">
  <tr valign="middle"> 
    <td width="70" height="25" align="center" bgcolor="#CCCCCC">ID</td>
    <td width="230" height="25" align="center" bgcolor="#CCCCCC">发信人</td>
    <td width="130" height="25" align="center" bgcolor="#CCCCCC">收信人</td>
    <td width="120" align="center" bgcolor="#CCCCCC">发送时间</td>
    <td width="50" align="center" bgcolor="#CCCCCC">状态</td>
    <td width="50" height="25" align="center" bgcolor="#CCCCCC">删除</td>
  </tr>
<%i=1
do while not rs.eof and i<=rs.pagesize%>
  <tr valign="middle"> 
    <td height="25" align="center" bgcolor="#f1f1f1"><font color="#FF0000">NO:<%=rs("id")%></font></td>
    <td height="25" bgcolor="#f1f1f1"><a href="huiyuan.asp?abc=xs&page=1&id=<%=conn.execute("select id from huiyuan where huiyuan='"&rs("name2")&"'")(0)%>"><%=rs("name2")%></a></td>
    <td height="25" align="center" bgcolor="#f1f1f1"><a href="huiyuan.asp?abc=xs&page=1&id=<%=conn.execute("select id from huiyuan where huiyuan='"&rs("name1")&"'")(0)%>"><%=rs("name1")%></a></td>
    <td align="center" bgcolor="#f1f1f1"><font color="#666666"><%=rs("sj")%></font></td>
    <td align="center" bgcolor="#f1f1f1"><%If rs("zt") Then Response.Write("已读") else Response.Write("<font color=red>未读</font>")%></td>
    <td height="25" align="center" bgcolor="#f1f1f1"><a href="del.asp?del=a&id=<%=rs("id")%>&page=<%=page%>&home=guanli.asp">删除</a></td>
  </tr>
  <tr valign="middle"> 
    <td colspan="6" bgcolor="#f1f1f1" style="WORD-WRAP: break-word"><div style="padding-left:30px" id="msg_body_<%=rs("id")%>"><script>ParseMsgBody(<%=rs("id")%>,'<%=rs("nr")%>',8,'',1);</script></div></td>
  </tr>
<%i=i+1
rs.MoveNext                                              
loop%>
  <tr align="center" valign="middle"> 
      <td height="25" colspan="6" bgcolor="#f1f1f1">
<%page2("key="&request("key")&"&lx="&request("lx")&"&pageSet="&pageSet&"&")
rs.close
set rs=nothing
conn.close
set conn=nothing
%> </td>
  </tr>
  <tr valign="middle" bgcolor="#CCCCCC"> 
    <form name="del" method="post" action="del.asp?del=b">
      <td height="25" colspan="2" align="center"> <script language=javascript>
function onlyNum()
{
  if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105)))
//考虑小键盘上的数字键
    event.returnValue=false;
}
</script>
        批量删除 
        <input name="sj" type="text" class="wenbenkuang" id="sj" size="5" maxlength="3" onkeydown="onlyNum();">
        天以前短信 
        <input name="2" type="submit" class="go-wenbenkuang" id="22" value="确定">
        &nbsp;&nbsp;</td>
    </form><form name="del" method="post" action="del.asp?del=c&home=guanli.asp">
      <td height="25" colspan="4" align="center">批量删除 
        <input name="huiyuan" type="text" class="wenbenkuang" id="huiyuan" size="15" maxlength="16">
        发送的短信 
        <input name="2" type="submit" class="go-wenbenkuang" id="22" value="确定"></td>
    </form>
  </tr>
</table>
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>提示：系统会自动删除大于15天数据</td>
  </tr>
</table>
</body>
</html>