<!--<?php
include_once PrintEot('left');
if(empty($action)){print <<<EOT
-->
<div class="admin_info mb10">
    <h2 class="h1"><b>提示信息</b></h2>
    <div class="legend">
    为了保证空间的可持续发展,请及时清理!附件保存目录为:<span class="xia">$attachpath</span><br /><b class="s2">功能说明</b>: 本功能根据数据库中的附件记录搜索,  删除符合条件的附件和附件记录, 释放更多的数据库空间和服务器空间<br />
    </div>
</div>
<script language="JavaScript" src="js/date.js"></script>
<form action="$basename&" method=post name="form1">
<input type=hidden name=action value=search>
<h3 class="h1"><b>附件编辑</b></h3>
<div class="admin_table mb10">
    <table cellspacing="0" cellpadding="0" width="100%">
        <tr class="tr1 vt">
        	<td class="td1">所属版块</td>
        	<td class="td2"><select name="fid" class="select_wa"><option value=all>所有版块</option>$forumcache</select></td>
        </tr>
        <tr class="tr1 vt">
        	<td class="td1">用户名</td>
        	<td class="td2"><input type="text" class="input input_wa" name="username"></td>
        </tr>
        <tr class="tr1 vt">
        	<td class="td1">文件名包含</td>
        	<td class="td2"><input type="text" class="input input_wa" name="filename"></td>
        </tr>
        <tr class="tr1 vt">
        	<td class="td1">下载次数</td>
            <td class="td2">
                <input type="text" class="input input_wa fl mr20" name="hits">
                <ul class="list_A list_80 fl">
                	<li><input type="radio" name="ifmore" value='1' checked>小于</li>
                	<li><input type="radio" name="ifmore" value='0'>大于</li>
                </ul>
            </td>
        </tr>
        <tr class="tr1 vt">
        	<td class="td1">附件大小(K) </td>
            <td class="td2">
                <input type="text" class="input input_wa fl mr20" name="filesize">
                <ul class="list_A list_80 fl">
                	<li><input type="radio" name="ifless" value='1' checked>小于</li>
                	<li><input type="radio" name="ifless" value='0'>大于</li>
                </ul>
            </td>
        </tr>
        <tr class="tr1 vt">
        	<td class="td1">上传时间 </td>
            <td class="td2">
            	<div class="input_img fl"><i class="input_time" title="选择时间">选择时间</i><input id="startdate" name="postdate1" type="text" value="2008-08-08" onclick="ShowCalendar(this.id)" /></div>
                <span class="p_lr_10 fl">-</span>
            	<div class="input_img fl"><i class="input_time" title="选择时间">选择时间</i><input id="enddate" name="postdate2" type="text" value="$postdate2" onclick="ShowCalendar(this.id)" /></div>
            </td>
        </tr>
        <tr class="tr1 vt">
        	<td class="td1">排序</td>
            <td class="td2">
                <select name="orderway" class="select_wa mr20 fl">
                    <option value="uploadtime">上传时间</option>
                    <option value="size">附件大小</option>
                    <option value="rvrc">所需{$db_rvrcname}</option>
                    <option value="name">附件名</option>
                    <option value="hits">下载次数</option>
                </select>
                <ul class="list_A list_80 fl">
                	<li><input type="radio" name="asc" value=''>正序</li>
                	<li><input type="radio" name="asc" value='DESC' checked>倒序</li>
                </ul>
            </td>
        </tr>
        <tr class="tr1 vt">
            <td class="td1"><div id="info1">每页显示个数</div></td>
            <td class="td2">
                <input type="text" class="input input_wa mr20" name="pernum" value="20">
                <input type="checkbox" id="direct" name="direct" value=1 onclick="deldirect(this.form,'info1','每页显示个数');"> 直接删除符合条件的附件
            </td>
        </tr>
    </table>
</div>
<div class="mb10 tac">
	<span class="btn"><span><button type="submit" onfocus="blur();">提 交</button></span></span>
</div>
</form>
<div class="admin_info mb10">
	<h2 class="h1"><b>提示信息</b></h2>
    <div class="legend">
    <b class="s1">功能说明</b>:本功能可根据附件最后被访问时间搜索整个站点的附件, 选择删除长时间没人访问的附件, 可有效清理站点中冗余附件, 从而释放更多的服务器空间.<br /><b class="s2">注</b>:如果你要删除的附件比较多,可以使用直接删除功能, 直接删除符合搜索条件的附件
    </div>
</div>
<form action="$basename&" method="post" name="form2">
<input type="hidden" name="action" value="schdir">
<h3 class="h1"><span class="mr20"><b>附件编辑</b></span><a href="$basename&action=list" class="linka">查看上次搜索结果</a></h3>
<div class="admin_table mb10">
    <table cellspacing="0" cellpadding="0" width="100%">
        <tr class="tr1 vt">
            <td class="td1">文件名包含</td>
            <td class="td2"><input type="text" class="input input_wa" name="filename"></td>
        </tr>
        <tr class="tr1 vt">
            <td class="td1">附件大小[K]</td>
            <td class="td2">
                <input type="text" class="input input_wa fl mr20" name="filesize">
                <ul class="list_A list_80 fl">
                	<li><input type="radio" name="ifless" value='1' checked>小于</li>
                	<li><input type="radio" name="ifless" value='0'>大于</li>
                </ul>
            </td>
        </tr>
        <tr class="tr1 vt">
            <td class="td1">最后访问时间 </td>
            <td class="td2">
                <div class="input_img fl"><i class="input_time" title="选择时间">选择时间</i><input id="stimess" name="postdate1" type="text" value="2008-08-08" onclick="ShowCalendar(this.id)" /></div>
                <span class="p_lr_10 fl">-</span>
                <div class="input_img fl"><i class="input_time" title="选择时间">选择时间</i><input id="etimess" name="postdate2" type="text" value="$postdate2" onclick="ShowCalendar(this.id)" /></div>
            </td>
        </tr>
        <tr class="tr1 vt">
            <td class="td1"><div id="info2">每次跳转处理个数</div></td>
            <td class="td2">
                <input type="text" class="input input_wa mr20" name="pernum" value="1000">
                <input type=checkbox id="direct" name="direct" value="1" onclick="deldirect(this.form,'info2','每次跳转处理个数');"> 直接删除符合条件的附件
            </td>
        </tr>
    </table>
</div>
<div class="mb10 tac">
	<span class="btn"><span><button type="submit" onfocus="blur();">提 交</button></span></span>
</div>
</form>
<form action="$basename&" method="post" name="form2">
<input type="hidden" name="action" value="delattach">
<h2 class="h1"><span class="mr20"><b>附件编辑</b></span><span class="linka">本功能将搜索整个站点的附件，删除数据库中没有记录而实际存在的附件，可有效清理站点中冗余附件, 从而释放更多的服务器空间.</span></h2>
<div class="admin_table mb10">
    <table cellspacing="0" cellpadding="0" width="100%">
        <tr class="tr1 vt">
            <td class="td1">每次跳转处理个数</td>
            <td class="td2"><input type="text" class="input input_wa" name="pernum" value="1000"></td>
        </tr>
    </table>
</div>
<div class="mb10 tac">
	<span class="btn"><span><button type="submit" onfocus="blur();">提 交</button></span></span>
</div>
</form>
<script language="JavaScript">
function deldirect(form,tar,msg){
	if (form.direct.checked == true){
		document.getElementById(tar).innerHTML = '<b><font color=blue>删除个数</font></b>';
	}else{
		document.getElementById(tar).innerHTML = msg;
	}
}
</script>
<!--
EOT;
}elseif($action=='list'){print <<<EOT
-->
<form action="$basename&" method="post">
<input type="hidden" name="action" value="delfile">
<h2 class="h1"><b>站点附件</b></h2>
<div class="admin_table mb10">
    <table cellspacing="0" cellpadding="0" width="100%">
        <tr class="tr2">
            <td>ID</td>
            <td>附件名</td>
            <td>最后访问时间</td>
            <td>附件大小(k)</td>
            <td width="4%">删</td>
        </tr>
<!--
EOT;
$id=($page-1)*$db_perpage;
foreach($attachdb as $attach){
$id++;
print <<<EOT
-->
        <tr class="tr1">
            <td class="td2">$id</td>
            <td class="td2"><a href="$attachpath/$attach[name]" target="_blank">$attach[name]</a></td>
            <td class="td2">$attach[time]</td>
            <td class="td2">$attach[size]</td>
            <td class="td2">
<!--
EOT;
if($attach[exists]){print <<<EOT
-->
            <input type="checkbox" name="delfile[]" value="$attach[name]">
<!--
EOT;
}else{print <<<EOT
-->
            <span class="s1">已删</span>
<!--
EOT;
}print <<<EOT
-->
            </td>
        </tr>
<!--
EOT;
}print <<<EOT
-->
    </table>
</div>
<div class="cc mb10">$pages</div>
<div class="mb10 tac">
	<span class="bt"><span><button type="button" name="chkall" onclick="CheckAll(this.form)">全 选</button></span></span>
	<span class="btn"><span><button type="submit" name="hello" onfocus="blur();">提 交</button></span></span>
</div>
</form>
<!--
EOT;
}else{print <<<EOT
-->
<form action="$basename&" method="post">
<input type="hidden" name="action" value="delete">
<h2 class="h1"><b>站点附件</b></h2>
<div class="admin_table mb10">
    <table cellspacing="0" cellpadding="0" width="100%">
        <tr class="tr2">
            <td>ID</td>
            <td width="20%">附件名</td>
            <td width="15%">附件大小</td>
            <td width="15%">上传时间</td>
            <td width="20%">所在主题</td>
            <td width="20%">所属版块</td>
            <td width=4%>删</td>
        </tr>
<!--
EOT;
$id=($page-1)*$pernum;
foreach($attachdb as $key=>$value){
$view_topic=$value[tid]?"<a href='read.php?tid=$value[tid]' target='_blank'>所在主题</a>":'-';
$id++;
print <<<EOT
-->
        <tr class="tr1 vt">
            <td class="td2">$id</td>
            <td class="td2">
<!--
EOT;
if ('' != $value['imgurl']) {
print <<<EOT
-->
        		<a href="$value[imgurl]" target="_blank">$value[name]</a>
<!--
EOT;
    } else {
print <<<EOT
-->
        		<a href="javascript:void(0);" onclick="alert('附件不存在');">$value[name]</a>
<!--
EOT;
    }
print <<<EOT
-->
            </td>
            <td class="td2">$value[filezie]</td>
            <td class="td2">$value[uploadtime]</td>
            <td class="td2">$view_topic</td>
            <td class="td2"><a href="$value[where]" target="_blank">$value[forum]</a></td>
            <td class="td2"><input type='checkbox' name='aidarray[]' value="$value[aid]"></td>
        </tr>
<!--
EOT;
}print <<<EOT
-->
    </table>
</div>
<div class="cc mb10">$pages</div>
<div class="mb10 tac">
	<span class="bt"><span><button type="button" name="chkall" onclick="CheckAll(this.form)">全 选</button></span></span>
	<span class="btn"><span><button type="submit" name="hello" onfocus="blur();">提 交</button></span></span>
</div>
</form>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->