<table bgcolor="#fff" width="100%" align="center" style="padding:10px">
	{?section name=i loop=$messagerows?}{?if $messagerows[i].my==1?}
	<tr><td><span class="blue">{?$saxue_uname?}&nbsp;&nbsp;{?$messagerows[i].postdate|date:'Y/m/d H:i'?}</span><br>{?$messagerows[i].content|nl2br?}</td></tr>
	{?else?}{?if $messagerows[i].history==1?}<tr><td align="center" class="gray">----------&nbsp;以下是历史消息&nbsp;----------</td></tr>{?/if?}
	<tr><td><span class="blue">{?if $uid==0?}系统通知{?else?}{?$uname?}{?/if?}&nbsp;&nbsp;{?$messagerows[i].postdate|date:'Y/m/d H:i'?}</span><br>{?$messagerows[i].content|nl2br?}</td></tr>
	{?/if?}{?/section?}
</table>
<div class="clear10"></div>
<form name="frmedit" id="frmedit" method="post">
<input type="hidden" name="toid" value="{?$uid?}">
<input type="hidden" name="toname" value="{?$uname?}">
<table bgcolor="#fff" width="100%" align="center" style="padding:10px">
	<tr><td>标　题：<input type="text" class="text" name="title" id="title" size="25" value="" /></td></tr>
	<tr><td valign="top">内　容：<textarea class="textarea" name="content" id="content" style="height:50px;width:160px;"></textarea></td></tr>
	<tr><td><button type="button" class="btn btn-primary" id="clksave" name="submit">回　复</button></td></tr>
</table>
</form>
<script>
$(function(){
	var dosave = false;
	$("#clksave").tap(function () {
		if(dosave) return;
		dosave = true;
		$.post('newmessage.php', $('#frmedit').serialize(), function(res){
			if(res.flag==0) {
				dosave = false;
				popTip(res.msg);
			} else {
				popTip('回复成功');
				$('#title').val('');
				$('#content').val('');
				setTimeout(function(){window.location.reload()}, 1000);
			}
		}, 'json')
    })
})
</script>