<!--<?php
$smsTypeName = $smstype ? $messageServer->getReverseConst($smstype) : $action;
${'smsTypeSelect_'.$smsTypeName} = 'selected';
print <<<EOT
-->
<div id='hiddenMessage' style="display:none"></div>
<div class="contUser" id="content">
<table width="100%"><tr><td height="600" valign="top">
	<div class="p15">
        <a href="{$baseUrl}?type=search" class="fr mr5">消息搜索</a>
        <h4 class="site mb5"><span>站内信</span>(共{$smsAllCount}条，<a href="$normalUrl&action=unread" class="s2"><b>{$notReadCount}</b>条未读消息</a>)</h4>
<!--
EOT;
if($percent == '100%'){
print <<<EOT
-->
<script type="text/javascript" src="js/global.js"></script>
<script type="text/javascript">
	showDialog('warning', '您的消息已满，您将不能正常收发消息，请及时<a href="message.php?type=clear">清理</a>');
</script>
		<div class="wrongTip mb15">您的消息已满，您将不能正常收发消息，请及时<a href="message.php?type=clear">清理</a>！</div>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if ($action == 'info' || $action == 'next' || $action == 'previous') {
$map = array(
	$messageServer->getConst('sms_message')=>'message',
	$messageServer->getConst('sms_rate')=>'rate',
	$messageServer->getConst('sms_comment')=>'comment',
	$messageServer->getConst('sms_guestbook')=>'guestbook'
);
$upaction=$map[$smstype];
$deltype = $redirect ? '' : $upaction;
print <<<EOT
-->
 		<div class="cc mb10">
			<a href="$normalUrl&type=sms&action={$itype}&boxname={$boxname}&smstype={$smstype}&itype={$itype}" class="mr20">&lt;&lt;返回</a>
			<a href="javascript:;" onclick="getpage('previous')">上一条</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:;" onclick="getpage('next')">下一条</a>
		</div>
    <div id="showmessageTip"></div>
<script type="text/javascript">
function getpage(act){
	ajax.send("$normalUrl&action=checkover&boxname={$boxname}&rid={$message[rid]}&itype={$itype}&smstype={$smstype}&redirect=$redirect&dir="+act,'',function(){
		 var rText = ajax.request.responseText.split('\t');
		 if (rText[0] == 'success'){
			 location.href = "$normalUrl&action="+ act +"&boxname={$boxname}&rid={$message[rid]}&itype={$itype}&smstype={$smstype}&redirect=$redirect";
		 }else{
			 showDialog('warning',(act == "next") ? "已经是最后一条！" : "已经是第一条！",3);return false;
		 }
		 return false;
	});
	return false;
}
var db_bbsurl = '$db_bbsurl';
var db_urlcheck = '$db_urlcheck';
</script>
<script type="text/javascript" src="js/pw_lwd.js"></script>
<!--
EOT;
if($smstype == $messageServer->getConst('sms_rate')){
	require messageEot('sms_rateinfo');
}elseif($smstype == $messageServer->getConst('sms_comment')){
	require messageEot('sms_cominfo');
}elseif($smstype == $messageServer->getConst('sms_guestbook')){
	require messageEot('sms_guestinfo');
}else{
	require messageEot('sms_smsinfo');
}
//列表页
} else { print <<<EOT
-->
<script type="text/javascript">
function getSmsList(rType){
	location.href='$normalUrl&action='+rType+'&smstype=$smstype&itype='+rType;
}
</script>
<div class="navC mb10">
    	<ul>
        	<li {$currentBoxs[inbox]}><a href="$normalUrl&action=inbox">收件箱</a></li>
            <li {$currentBoxs[outbox]}><a href="$normalUrl&action=outbox">发件箱</a></li>
        </ul>
 
    </div>
<form action="$normalUrl" method="post" name="FORM">
<input type="hidden" name="ajax" value="1"/>
				<div class="cc mb10">
				<span class="mr5"><label><input id="checkall" name="checkall" type="checkbox" value="" onclick="MC.CheckAll(this.form,this)">&nbsp;全选</label></span>
				<span class="bt2"><span><button onclick="MC.mSubmit(this.form,'mark','sms','$action','$page','showmessageTip')" type="button">标记已读</button></span></span>
				<span class="bt2"><span><button onclick="MC.mSubmit(document.FORM,'del','sms','$action','$page','showmessageTip')"  type="button">删除</button></span></span>
				<span style="margin:0 3px 0 6px;">筛选：<span class="dropdown"><select id="alltype" onchange="selectSmsType(this.value)">
					<option value="{$boxname}">全部</option>
					<option $smsTypeSelect_sms_message  value="message">短消息</option>
					<option $smsTypeSelect_sms_rate value="rate">评分</option>
					<option $smsTypeSelect_sms_reply value="reply">帖子回复</option>
				</select></span></span>
		 </div>
       <div id="showmessageTip"></div>
       <table width="100%" class="mb10">
<!--
EOT;
if($emptyListTip){
print <<<EOT
-->
			<tr><td class="tac p15 f14">{$emptyListTip}</td></tr>
<!--
EOT;
}else{
$_unReadCol = getUnReadHtml();
print <<<EOT
-->
			{$_unReadCol}
<!--
EOT;
}foreach($smsList as $key => $value){
list($_img,$_b,$_tip) = getMessageIconByStatus($value);
$_col = getSubListHtml($value);
$value[modified_time] = get_date($value[modified_time]);
$value['content'] = strip_tags($value['content']);
$_title = getMessageIconTips($value['typeid'],$value['create_uid']);
$_sendtype = $winduid == $value['create_uid'] ? '发给' : '来自';
print <<<EOT
-->			
			{$_col}		
			<tr class="tr3" id="sms_{$value[rid]}">
      	<td class="pick"><input name="rids" type="checkbox" value="{$value[rid]}"></td>
				<td class="icon"><img src="u/images/message/{$_img}" title="{$_title}"/></td>
				<td class="face"><a href="{$db_userurl}{$value[uid]}" class="img_30"><img src="{$value[face]}" width="30" height="30" /></a></td>
				 <td class="name"><p>{$_sendtype}:
<!--
EOT;
if($winduid == $value['create_uid']) {print<<<EOT
-->
				 <a href="u.php?username={$value[extra][0]}">{$value[extra][0]}</a>
<!--
EOT;
}else{print<<<EOT
-->
				<a href="{$db_userurl}{$value[uid]}">{$value[create_username]}</a>
<!--
EOT;
}print<<<EOT
-->
				 </p><em><span title="$value[modified_time]">{$value[modified_time_format]}</span></em></td>
				 <td class="value">
				 	<h4 $_b><a href="$normalUrl&action=info&boxname={$boxname}&page=$page&rid={$value[rid]}&itype={$itype}&smstype={$smstype}&mid={$value[mid]}&redirect=$redirect">{$value[title]}</a></h4>
				 	<p class="lh_18">{$value[content]}</p>
					<em class="s2">{$_tip}</em>
				</td>
				<td class="del"><a id="del_{$value[rid]}" href="javascript:;" onclick="MC.del('$value[rid]','sms','$action','$page','showmessageTip')" class="adel">删除</a></td>
			</tr>
<!--
EOT;
}print <<<EOT
-->           	
		</table>
		<div id="showmessage"></div>
		<div class="mb10 cc">
			<div class="fr" style="_width:500px;">{$pages}</div>
<!--
EOT;
if(count($smsList) >= $perpage){
print <<<EOT
-->
      <span class="mr5"><label><input id="checkall" name="checkall"  type="checkbox" value="" onclick="MC.CheckAll(this.form,this)">&nbsp;全选</label></span>
	   	<span class="bt2"><span><button onclick="MC.mSubmit(this.form,'mark','sms','$smstype','$action','$page','showmessage')" type="button">标记已读</button></span></span>
      <span class="bt2"><span><button onclick="MC.mSubmit(document.FORM,'del','sms','$smstype','$action','$page','showmessage')"  type="button">删除</button></span></span>
<!--
EOT;
}print <<<EOT
-->
			</div>  
</form>                               
<!--
EOT;
}print <<<EOT
-->    
	</div>
</td></tr></table>
</div>
<script type="text/javascript" src="js/select.js"></script>
<script type="text/javascript">
var ld=window.onload;
window.onReady(function(){
	new sSelect(getObj('alltype'));
});
(function(){
	try{
	var sms_line=getObj('smsListTable').getElementsByTagName('tr');
	var l = sms_line.length;
	for(var i=0;i<l;i++)
	{
		sms_line[i].onmouseover=function(){
			var a = getElementsByClassName('send_message',this);
			a.length&&(a[0].style.display = '');
		};
		sms_line[i].onmouseout=function(){
			var a=getElementsByClassName('send_message',this);
			a.length&&(a[0].style.display = 'none');
		};
	}
	}catch(e){};
})();

function selectSmsType(type) {
	if(type) {
		window.location.href = '{$normalUrl}&action='+type+'&boxname={$boxname}';
	} else {
		window.location.href = '{$normalUrl}&boxname={$boxname}';
	}
}
</script>
<!--
EOT;
if(!defined('AJAX')){
	require_once(uTemplate::printEot('footer'));
}
?>-->