<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html   xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta   http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta   name="robots" content="noindex, nofollow" />
<meta   http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>短消息 - <jcms:site.name/></title>
<script type="text/javascript" src="../_libs/jquery.tools.pack.js"></script>
<script type="text/javascript" src="../_data/jcmsV4.x.js"></script>
<link   type="text/css" rel="stylesheet" href="../_data/jcmsV4.x.css" />
<style type="text/css">
@import url(../style/member/style.css);
</style>
<script type="text/javascript">
var id = "";
var mode = joinValue('mode');
var pagesize=5;
var page=thispage();
(function(){
	$(document).ready(function() {
		if(q("mode")=="")
			aLoad('inbox');
		else
			aLoad(q("mode"));
	});
})();
function aLoad(s) {
	page = "1";
	if(s == "new")
		mode = "&mode=new";
	else if(s == "inbox")
		mode = "&mode=inbox";
	else if(s == "outbox")
		mode = "&mode=outbox";
	else
		mode = "";
	ajaxList(page);
}
function ajaxList(currentpage)
{
	//设置选项卡
	for(i=1; i<4; i++)
	{
		$OBJ("tab"+i).className = "";
        
	}
	if(mode == "&mode=new")
		$OBJ("tab1").className = "current";
	else if(mode == "&mode=inbox")
		$OBJ("tab2").className = "current";
	else if(mode == "&mode=outbox")
		$OBJ("tab3").className = "current";
	if(currentpage!=null) page=currentpage;
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"page="+currentpage+"&pagesize="+pagesize+"&time="+(new Date().getTime())+id,
		url:		"pmlist_ajax.aspx?oper=ajaxGetList"+mode,
		error:		function(XmlHttpRequest,textStatus, errorThrown){if(XmlHttpRequest.responseText!=""){alert(XmlHttpRequest.responseText);}},
		success:	function(d){
			switch (d.result)
			{
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				$("#ajaxList").setTemplateElement("tplList", null, {filter_data: false});
				$("#ajaxList").processTemplate(d);
				$("#ajaxPageBar").html(d.pagerbar);
				break;
			}
		}
	});
}
function ajaxRead(id)
{
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"id="+id,
		url:		"pmlist_ajax.aspx?oper=check&time="+(new Date().getTime()),
		success:	function(d){
			switch (d.result)
			{
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				ajaxList(page);
				break;
			}
		}
	});
}
function ajaxDel(id)
{
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"id="+id,
		url:		"pmlist_ajax.aspx?oper=ajaxDel&time="+(new Date().getTime()),
		success:	function(d){
			switch (d.result)
			{
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				ajaxList(page);
				break;
			}
		}
	});
}
</script>
</head>
<body>
<iframe frameborder="0" scrolling="no" src="../user/index_default.aspx?do=header" width="100%" height="76" marginwidth="0" marginheight="0" hspace="0" vspace="0" id="ifheader"></iframe>
<!--顶部结束,中框架开始-->
<div id="wrap">
	<div id="main">
		<div id="app_sidebar">
			<ul class="app_list" id="default_userapp">
				<li class="currently"><img src="../style/member/ico_home.gif"><a href="../user/index_default.aspx">个人中心首页</a></li>
			</ul>
			<ul class="app_list" id="my_userapp">
				<li class="hr"></li>
				<li><img src="../style/member/ico_contribute.gif"><a href="../user/contribute_default.aspx" target="_blank">我的投稿</a><em></em></li>
				<li><img src="../style/app/message.gif"><a href="../user/pmlist_default.aspx">短信</a><em><a href="../user/pmsend_default.aspx">发送</a></em></li>
				<li><img src="../style/app/friend.gif"><a href="../user/friendlist_default.aspx">好友</a><em><a href="../user/friendadd_default.aspx">添加</a></em></li>
				<li><img src="../style/app/mtag.gif"><a href="../mtag/index_default.aspx">群组</a><em><a href="../mtag/threadlist_default.aspx">话题</a></em></li>
				<li><img src="../style/app/favorite.gif"><a href="../user/favorite_default.aspx">收藏夹</a></li>
				
			</ul>
		</div>
<div id="mainarea">
			<h2 class="title"><img src="../style/app/pm.gif">消息</h2>
			<div class="tabs_header">
				<ul class="tabs">
					<li class="active"><a href="../user/pmlist_default.aspx"><span>短消息</span></a></li>
					<li><a href="notice_default.aspx"><span>通知</span></a></li>
					<li class="null"><a href="../user/pmsend_default.aspx">发短消息</a></li>
				</ul>
			</div>
			<div id="content" style="width:640px;">
            <textarea id="tplList" style="display:none">{#foreach $T.table as record}
<li>
	<div class="avatar48"> <a><img src="../_data/avatar/{$T.record.senduserid}_m.jpg" onerror="this.src='../_data/avatar/0_m.jpg'" width="48" height="48" /></a> </div>
	<div class="pm_body">
		<div class="pm_h">
			<div class="pm_f">
				<p><a>{$T.record.sendusername}</a> <span class="time">{$T.record.adddate}</span></p>
				<div class="pm_c"> {$T.record.title}<br>
					<p><a href="pmread_default.aspx?id={$T.record.id}">详细情况</a></p>
				</div>
				<a href="javascript:;" class="float_del" onclick="ajaxDel({$T.record.id})">删除</a>
			</div>
		</div>
	</div>
</li>
{#/for}</textarea>
				<ol class="pm_list" id="ajaxList"></ol>
				<div class="page" id="ajaxPageBar"></div>
			</div>
			<div id="sidebar" style="width:150px;">
				<div class="cat">
					<h3>文件夹</h3>
					<ul class="post_list line_list">
						<li id="tab1"><a href="javascript:;" onclick="aLoad('new')">未读消息</a></li>
						<li id="tab2"><a href="javascript:;" onclick="aLoad('inbox')">收件箱</a></li>
						<li id="tab3" style="display:none;"><a href="javascript:;" onclick="aLoad('outbox')">发件箱</a></li>
					</ul>
				</div>
			</div>
		</div>
		<div id="bottom"></div>
	</div>
	<div id="footer" title=""> </div>
</div>
<iframe frameborder="0" scrolling="no" src="../user/index_default.aspx?do=footer" width="100%" height="50" marginwidth="0" marginheight="0" hspace="0" vspace="0" id="iffooter"></iframe>
</body>
</html>
