<div class="hint"><h3>{?if $uid==0?}系统消息{?else?}与{?$uname?}的通信记录{?/if?}</h3></div>
<div class="msg-wrap">
	<ul class="bubble-wrap">
		{?section name=i loop=$messagerows?}{?if $messagerows[i].my==1?}
		<li>
			<div class="bubble-main fr my">
				<p class="bubble-content" style="color:#666;white-space:pre-wrap"><span class="tips">{?$messagerows[i].postdate|date:'Y/m/d H:i'?}</span>{?$messagerows[i].content|nl2br?}</p>
				<div class="arrow-right"></div>
			</div>
		</li>
		{?else?}{?if $messagerows[i].history==1?}<li class="history">--------------------&nbsp;以下是历史消息&nbsp;--------------------</li>{?/if?}
		<li>
			<div class="bubble-main fl{?if $messagerows[i].toid==0?} all{?/if?}">
				<p class="bubble-content"><span class="tips">{?$messagerows[i].postdate|date:'Y/m/d H:i'?}</span>{?$messagerows[i].content|nl2br?}</p>
				<div class="arrow-left"></div>
			</div>
		</li>
		{?/if?}{?/section?}
	</ul>
</div>
{?if $uid>0?}
<div class="msg-wrap clearfix">
<form action="newmessage.php" name="frmmsg" id="frmmsg" method="post">
<input type="hidden" name="toid" value="{?$uid?}">
<input type="hidden" name="toname" value="{?$uname?}">
	<div class="dataedit">
		<textarea name="content" id="content"></textarea><br>
		<input type="submit" value="回复" class="subbtn" name="save" />
	</div>
</form>
</div>
<script id="postScript" type="text/javascript">
$(function(){
	$("#frmmsg").ajaxForm({
		beforeSubmit : function(){
			if($('#content').val()=='') {
				alert('内容不能为空');
				$('#content').focus();
				return false;
			}
		},
        dataType: "json",
        success : function(data){
			if(data.flag == 0){
				alert(data.msg);
			}else{
				alert('回复成功');
				$('#content').val('');
				location.reload();
			}
        }
    });
})
</script>
{?/if?}