{template 'phpcms','header'}
<table cellspacing="0" cellpadding="0" class="member">
<tr>
<td valign="top" class="left">
{template 'member','left'}
</td>
<td width="10">
</td>
<td class="right" valign="top">
{template 'message','message_catlist'}
<div class="memberborder_1">
<div class="memberborder_2">
  <h1>消息搜索</h1>
{if isset($messages)}
<form action="{$PHP_SELF}" method="post" onsubmit="return frmChk();">
<table cellpadding="0" cellspacing="0" class="righttable">
  <tbody>
	<tr>
		<td width="8%" class="td_center">删除</td>
		<td width="57%" class="td_center">标题</td>
		<td width="15%" class="td_center">{if $aim=='outbox'}发送到{else}来自{/if}</td>
		<td width="20%" class="td_center">时间</td>
	</tr>
{loop $messages $value}
	<tr onmouseover="this.className='mrowbg2';" onmouseout="this.className='mrowbg1';">
		<td class="td_center"><input id="mid" type="checkbox" name="mid[]" value="{$value[0]}{if isset($value[4])}|{$value[4]}{/if}" onclick="delCheck();"></td>
		<td class="td_left"><a href="{$MOD[linkurl]}show.php?folder={$aim}&mid={$value[0]}&types={$value[4]}" target="_self" title="查看消息内容">{$value[2]}</a></td>
		<td class="td_center">{$value[1]}</td>
		<td class="td_center">{date('Y-m-d H:i:s', $value[3])}</td>
	</tr>
{/loop}
  </tbody>
</table>
<script src="{PHPCMS_PATH}templates/default/message/mutexbtn.js" language="javascript" type="text/javascript"></script>
<table cellpadding="0" cellspacing="0" class="righttable">
  <tbody>
	<tr>
	  <td width="50%" class="td_center"><input id="checkAll" type="button" value="全选" onclick="selectAll();">&nbsp;<input id="checkOther" type="button" value="反选" disabled onclick="selOther();">&nbsp;<input id="cancel" type="button" value="取消选择" disabled onclick="noCheck();"></td>
	  <td width="50%" class="td_center"><span style="display:none"><input id="quite" type="checkbox" name="quite" value="1" disabled>彻底删除&nbsp;&nbsp;</span><input type="hidden" name="aim" value="{$aim}"><input id="subBtn" type="submit" name="dosubmit" value="删除消息" disabled title="彻底删除消息"></td>
	</tr>
  </tbody>
</table>
</form>
{else}
<script language="javascript" type="text/javascript">
<!--
function formChk() {
	//var strUser = document.getElementById("username").value;
	if (document.getElementById("keyword").value == "") {
		alert("请输入搜索关键词！");
		document.getElementById("keyword").focus();
		return false;
	} else if (strUser != "" && /^\w+$/i.test(strUser) == false) {
		alert("输入的用户名无效，请重新输入！");
		document.getElementById("username").value = "";
		document.getElementById("username").focus();
		return false;
	} else {
		return true;
	}
}
//-->
</script>
<h1>搜索短消息</h1>
<form action="{$PHP_SELF}" method="post" onsubmit="return formChk();">
<table cellpadding="0" cellspacing="0" class="righttable">
  <tbody>
	<tr>
		<td class="td_right">关&nbsp;键&nbsp;词:</td>
		<td class="td_left"><input id="keyword" type="text" name="keyword" style="width:30%"></td>
	</tr>
	<tr>
		<td class="td_right">搜索范围:</td>
		<td class="td_left"><select name="aim">
			<option value="inbox">收&nbsp;件&nbsp;箱</option>
			<option value="outbox">发&nbsp;件&nbsp;箱</option>
			<option value="track">消息跟踪</option>
		</select>&nbsp;&nbsp;<input type="radio" name="range" value="title" checked>标题搜索&nbsp;&nbsp;<input type="radio" name="range" value="content">内容搜索&nbsp;&nbsp;<input type="checkbox" name="sighted" value="1" checked>已读短消息&nbsp;&nbsp;<input type="checkbox" name="sight" value="1" checked>未读短消息</td>
	</tr>
	<tr>
		<td width="15%" class="td_right">搜索时间:</td>
		<td width="85%" class="td_left"><select name="days">
			<option value="0">全部</option>
			<option value="1">1&nbsp;天</option>
			<option value="2">2 天</option>
			<option value="7">1&nbsp;周</option>
			<option value="30">1&nbsp;月</option>
			<option value="90">3&nbsp;月</option>
			<option value="180">6&nbsp;月</option>
			<option value="365">1&nbsp;年</option>
		</select>&nbsp;&nbsp;<input type="radio" name="term" value="after" checked>之后&nbsp;&nbsp;<input type="radio" name="term" value="before">之前</td>
	</tr>
	<tr>
		<td width="15%" class="td_right">排序方式:</td>
		<td width="85%" class="td_left"><select name="orderby">
			<option value="sendtime">按&nbsp;时&nbsp;间</option>
			<option value="username">按用户名</option>
		</select>&nbsp;&nbsp;<input type="radio" name="ordermethod" value="asc">升序&nbsp;&nbsp;<input type="radio" name="ordermethod" value="desc" checked>降序</td>
	</tr>
	<tr>
	    <td></td>
		<td class="td_center"><input type="hidden" name="find" value="submitted"><input type="submit" name="dosubmit" value="提 交"></td>
	</tr>
  </tbody>
</table>
</form>
{/if}
</div></div>
    </td>
	</tr>
  </table>
		</div></td>
	</tr>
</tbody></table>
{template 'phpcms','footer'}