<table width="100%" class="topmenu">
	<tr><td>
		<a href="attachs.php" class="on"><em>数据库模式</em></a><span>|</span>
		<a href="attachs_file.php?server=local"><em>本地服务器</em></a><span>|</span>
		<a href="attachs_file.php?server=oss"><em>OSS服务器</em></a><span>|</span>
		<a href="attachs_file.php?server=ftp"><em>FTP服务器</em></a>
	</td></tr>
</table>
<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 width="100%" align="center" class="sgrid">
    <tr>
        <td>
			<select name="savein"><option value="">所在服务器</option>{?section name=i loop=$savein?}<option value="{?$i['key']?}"{?if $i['key']==$Saxue.request.savein?} selected{?/if?}>{?$i['value']?}</option>{?/section?}</select>&nbsp;文章ID：
			<input name="aid" type="text" class="text" size="15" value="{?$Saxue.request.aid?}">&nbsp;
            <input type="submit" name="btnsearch" class="button" value="搜 索">
        </td>
    </tr>
</table>
</form>
<br>
<form method="post" name="frmpost">
<input name="jumpurl" type="hidden" value="{?$saxue_thisurl?}">
<table width="100%" class="grid" id="imgPreview">
	<tr>
		<th><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>文章ID</th>
		<th>文章标题</th>
		<th>所在服务器</th>
		<th>附件路径</th>
	</tr>
	<tbody>
	{?section name=i loop=$rows?}
	<tr class="rowbg">
		<td><input type="checkbox" name="ids[]" value="{?$rows[i].attachid?}"/></td>
		<td>{?if $rows[i].aid == 0?}<span class="red">{?$rows[i].aid?}</span>{?else?}<span class="green">{?$rows[i].aid?}</span>{?/if?}</td>
		<td>{?if $rows[i].isarticle == 0?}<span class="gray">文章不存在</span>{?else?}<a href="{?$rows[i]['article'].url?}" target="_blank">{?$rows[i]['article'].title|cutstr:40:'...'?}</a>{?/if?}</td>
		<td>{?$rows[i].savein?}</td>
		<td><a rel="{?$rows[i].fileurl?}" href="{?$rows[i].fileurl?}" target="_blank">{?$rows[i].filepath?}</a></td>
	</tr>
	{?/section?}
	<tr>
		<td colspan="12" class="foot">
			<select name="action" id="batchaction">
				<option value="">请选择批量操作</option>
				<option value="delete">删除记录（保留附件）</option>
				<option value="delattachs">删除图片和记录</option>
				<option value="clearzero">清空多余附件（文章ID=0）</option>
			</select>&nbsp;
			<input type="button" value="批量操作" class="button" onclick="batchctrl();">&nbsp;&nbsp;
		</td>
	</tr>
	</tbody>
</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==20?} class="selected"{?/if?}><a href="javascript:void(0)" onclick="setPage(20)">20</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"><ul>{?$url_jumppage?}</ul></div>
</td></tr></table>
<script type="text/javascript" src="{?$saxue_skin_server?}/lib/jquery.imgpreview.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		var obj=$("#imgPreview a[rel]");
		if(obj.length>0) {
			$('#imgPreview a[rel]').imgPreview({
				srcAttr: 'rel',
				imgCSS: { border: '1px solid #ccc', padding: '2px' }
			});
		}
	});	
</script>