<script language="javascript">
function showmsg(id){
	var msg = document.getElementById('messageArea'+id);
	if(msg.style.display == 'none') msg.style.display='';
	else msg.style.display = 'none';
}
</script>
<form name="frmsearch" method="post">
<input name="page" id="page" type="hidden" value="1">
<input name="pagesize" id="pagesize" type="hidden" value="{?$Saxue.request.pagesize?}">
<table class="sgrid" width="100%">
    <tr>
        <td>
			<select name="keytype">
				<option value="fromname"{?if $Saxue.request.keytype=='fromname'?} selected{?/if?}>发件人</option>
				<option value="toname"{?if $Saxue.request.keytype=='toname'?} selected{?/if?}>收件人</option>
				<option value="title"{?if $Saxue.request.keytype=='title'?} selected{?/if?}>标题</option>
			</select>&nbsp;
            <input name="keyword" type="text" class="text" id="keyword" size="20" maxlength="50" value="{?$Saxue.request.keyword?}">&nbsp;
			<label><input type="checkbox" name="issystem" value="1"{?if '1'==$Saxue.request.issystem?} checked{?/if?}>&nbsp;系统消息</label>&nbsp;&nbsp;
            <input type="submit" name="Submit" value="搜 索" class="button">
		</td>
    </tr>
</table>
</form>
<br />
<form method="post" name="frmpost">
<input name="jumpurl" type="hidden" value="{?$saxue_thisurl?}">
<table class="grid" width="100%" align="center">
	<tr>
		<th width="5%"><input type="checkbox" id="checkall" name="checkall" value="checkall" onclick="javascript: for (var i=0;i<this.form.elements.length;i++){ if (this.form.elements[i].name != 'checkkall') this.form.elements[i].checked = form.checkall.checked; }"></th>
		<th>标题</th>
		<th>发件人</th>
		<th>收件人</th>
		<th>日期</th>
	</tr>
	{?section name=i loop=$rows?}
	<tr class="rowbg">
		<td><input type="checkbox" name="ids[]" value="{?$rows[i].messageid?}"></td>
		<td><a href="javascript:showmsg({?$rows[i].messageid?})">{?$rows[i].title?}</a></td>
		<td>{?if $rows[i].fromid > 0?}<a href="javascript:viewuser({?$rows[i].fromid?})">{?$rows[i].fromname?}</a>{?else?}<span class="red">系统消息</span>{?/if?}</td>
		<td>{?if $rows[i].toid > 0?}<a href="javascript:viewuser({?$rows[i].toid?})">{?$rows[i].toname?}</a>{?else?}<span class="blue">全站用户</span>{?/if?}</td>
		<td>{?$rows[i].postdate|date:"Y-m-d H:i"?}</td>
	</tr>
	<tr id="messageArea{?$rows[i].messageid?}" class="message_content" style="display:none">
		<td></td>
		<td colspan="4"><div>{?$rows[i].content|nl2br?}</div></td>
	</tr>
	{?/section?}
	<tr>
		<td colspan="12" class="foot">
			<select name="action" id="batchaction">
				<option value="">请选择批量操作</option>
				<option value="delete">批量删除</option>
			</select>&nbsp;
			<input type="button" value="批量操作" class="button" onclick="batchctrl();">
		</td>
	</tr>
</table>
</form>
<table width="100%"><tr><td width="100%">
	<div class="fl pages">
		<ul>
			<li><span class="fl">每页显示:</span></li>
			<li{?if $Saxue.request.pagesize==10?} class="selected"{?/if?}><a href="javascript:void(0)" onclick="setPage(10)">10</a></li>
			<li{?if $Saxue.request.pagesize==30?} class="selected"{?/if?}><a href="javascript:void(0)" onclick="setPage(30)">30</a></li>
			<li{?if $Saxue.request.pagesize==50?} class="selected"{?/if?}><a href="javascript:void(0)" onclick="setPage(50)">50</a></li>
			<li{?if $Saxue.request.pagesize==100?} class="selected"{?/if?}><a href="javascript:void(0)" onclick="setPage(100)">100</a></li>
		</ul>
	</div>
	<div class="fr pages">{?$url_jumppage?}</div>
</td></tr></table>