<!--<?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>

<div class="nav3 mb10">
	<ul class="cc">
		<li class="current"><a href="$basename">版塊附件記錄</a></li>
		<li><a href="$basename&action=files">版塊附件文件</a></li>
		<li><a href="$basename&action=msgList">消息中心附件</a></li>
	</ul>
</div>

<script type="text/javascript" src="js/date.js"></script>
<form action="$basename&" method=post name="form1">
<h3 class="h1">搜索附件記錄</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" value="$username"></td>
        </tr>
        <tr class="tr1 vt">
        	<td class="td1">文件名包含</td>
        	<td class="td2"><input type="text" class="input input_wa" name="filename" value="$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" value="$hits">
                <ul class="list_A list_80 fl">
                	<li><input type="radio" name="ifmore" value='1' $hitsLessThan>小于</li>
                	<li><input type="radio" name="ifmore" value='0' $hitsMoreThan>大于</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" value="$filesize">
                <ul class="list_A list_80 fl">
                	<li><input type="radio" name="ifless" value='1' $downloadLessThan>小于</li>
                	<li><input type="radio" name="ifless" value='0' $downloadMoreThan>大于</li>
                </ul>
            </td>
        </tr>
        <tr class="tr1 vt">
        	<td class="td1">上傳時間 </td>
            <td class="td2">
            	<div class="input_img fl"><i class="input_time" onclick="this.nextSibling.onclick()" title="選擇時間">選擇時間</i><input id="startdate" name="postdate1" type="text" value="$postdate1" onclick="ShowCalendar(this.id)" /></div>
                <span class="p_lr_10 fl">-</span>
            	<div class="input_img fl"><i class="input_time" onclick="this.nextSibling.onclick()" 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">
                $orderwaySelection
                <ul class="list_A list_80 fl">
                	<li><input type="radio" name="asc" value='ASC' $ascChecked>正序</li>
                	<li><input type="radio" name="asc" value='DESC' $descChecked>倒序</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="$pernum">
            </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="FORM">
<input type="hidden" name="action" value="delete">
<input type="hidden" name="fid" value="$fid">
<input type="hidden" name="uid" value="$uid">
<input type="hidden" name="filename" value="$filename">
<input type="hidden" name="ifmore" value='$ifmore'>
<input type="hidden" name="ifless" value='$ifless'>
<input type="hidden" name="postdate1" value="$postdate1">
<input type="hidden" name="postdate2" value="$postdate2">
<input type="hidden" name="asc" value='$asc'>
<input type="hidden" name="pernum" value="$pernum">
<input type="hidden" name="hits" value="$hits">
<input type="hidden" name="filesize" value="$filesize">
<input type="hidden" name="orderway" value='$orderway'>
<input type="hidden" name="page" value='$page'>
<h2 class="h1">附件記錄列表</h2>
<div class="admin_table mb10">
    <table cellspacing="0" cellpadding="0" width="100%">
        <tr class="tr2">
            <td width="40"><span onclick="CheckAll(document.FORM)" class="cp">全選</span></td>
            <td>附件名</td>
            <td width="15%">附件大小</td>
            <td width="15%">上傳時間</td>
            <td width="20%">所在主題</td>
            <td width="20%">所屬版塊</td>
        </tr>
<!--
EOT;
	if (!empty($attachdb)) {
		foreach($attachdb as $key=>$value){
			$view_topic=$value[tid]?"<a href='read.php?tid=$value[tid]' target='_blank'>$value[subject]</a>":'-';
print <<<EOT
-->
        <tr class="tr1 vt">
            <td class="td2"><input type='checkbox' name='aidarray[]' value="$value[aid]"></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>
        </tr>
<!--
EOT;
		}
	}else{print <<<EOT
-->
<tr><td class="p10" colspan="6"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
	}print <<<EOT
-->
    </table>
</div>
<div class="cc mb10">$pages</div>
<div class="mb10 tac">
	<span class="bt"><span><button type="button" onclick="CheckAll(document.FORM);">全 選</button></span></span>
	<span class="btn"><span><button type="submit" name="hello" onfocus="blur();" onclick="return Checkdel();">刪  除</button></span></span>
</div>
</form>

<!--
EOT;
}elseif($action=='msgList'){print <<<EOT
-->

<div class="nav3 mb10">
	<ul class="cc">
		<li><a href="$basename">版塊附件記錄</a></li>
		<li><a href="$basename&action=files">版塊附件文件</a></li>
		<li class="current"><a href="$basename&action=msgList">消息中心附件</a></li>
	</ul>
</div>

<form action="$basename&" method="post" name="MESSAGE">
	<input type="hidden" name="action" value="msgDel" />
	<h2 class="h1">消息中心附件</h2>
	<div class="admin_table mb10">
		<table cellpadding="0" cellspacing="0" width="100%">
			<tr class="tr2">
				<td width="40"><span onclick="CheckAll(document.MESSAGE)" class="cp">全選</span></td>
				<td>附件名</td>
				<td>附件大小(k)</td>
				<td>上傳時間</td>
			</tr>
<!--
EOT;
if (!empty($attachList)) {
foreach($attachList as $key => $value){
$value['created_time'] = get_date($value['created_time']);
print <<<EOT
-->
				<tr>
					<td class="td2"><input type="checkbox" name="mids[]" value="{$value[mid]}"></td>
					<td class="td2">{$value[name]}</td>
					<td class="td2">{$value[size]}</td>
					<td class="td2">{$value[created_time]}</td>
				</tr>
<!--
EOT;
		}
	}else{print <<<EOT
-->
<tr><td class="p10" colspan="4"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
	}print <<<EOT
-->
		</table>
	</div>
<div class="cc mb10">$pages</div>
<div class="mb10 tac">
	<span class="bt"><span><button type="button" onclick="CheckAll(document.MESSAGE);">全 選</button></span></span>
	<span class="btn"><span><button type="submit" name="hello" onfocus="blur();" onclick="return Checkdel();">刪  除</button></span></span>
</div>
</form>	
<!--
EOT;
}elseif($action=='files'){print <<<EOT
-->

<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>

<div class="nav3 mb10">
	<ul class="cc">
		<li><a href="$basename">版塊附件記錄</a></li>
		<li class="current"><a href="$basename&action=files">版塊附件文件</a></li>
		<li><a href="$basename&action=msgList">消息中心附件</a></li>
	</ul>
</div>

<script type="text/javascript" src="js/date.js"></script>
<form action="$basename&" method="post" name="form2">
<input type="hidden" name="action" value="schdir">
<h3 class="h1"><span class="mr20">搜索附件文件</span><a href="$basename&action=files" 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" value="$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" value="$filesize">
                <ul class="list_A list_80 fl">
                	<li><input type="radio" name="ifless" value='1' $sizeLessThan>小于</li>
                	<li><input type="radio" name="ifless" value='0' $sizeMoreThan>大于</li>
                </ul>
            </td>
        </tr>
        <tr class="tr1 vt">
            <td class="td1">最後訪問時間 </td>
            <td class="td2">
                <div class="input_img fl"><i onclick="this.nextSibling.onclick()" class="input_time" title="選擇時間">選擇時間</i><input id="stimess" name="postdate1" type="text" value="$postdate1" onclick="ShowCalendar(this.id)" /></div>
                <span class="p_lr_10 fl">-</span>
                <div class="input_img fl"><i onclick="this.nextSibling.onclick()" 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="$pernum">
            </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="FORM">
<input type="hidden" name="action" value="delfile">
<input type="hidden" name="filename" value="$filename">
<input type="hidden" name="filesize" value="$filesize">
<input type="hidden" name="ifless" value='$ifless'>
<input type="hidden" name="postdate1" value="$postdate1">
<input type="hidden" name="postdate2" value="$postdate2">
<input type="hidden" name="pernum" value="$pernum">
<h2 class="h1">附件文件列表</h2>
<div class="admin_table mb10">
    <table cellspacing="0" cellpadding="0" width="100%">
        <tr class="tr2">
            <td width="40"><span onclick="CheckAll(document.FORM)" class="cp">全選</span></td>
            <td>附件名</td>
            <td>最後訪問時間</td>
            <td>附件大小(k)</td>
        </tr>
<!--
EOT;
	if (!empty($attachdb)) {
		foreach($attachdb as $attach){
print <<<EOT
-->
        <tr class="tr1">
            <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>
            <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>
        </tr>
<!--
EOT;
		}
	}else{print <<<EOT
-->
<tr><td class="p10" colspan="4"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
	}print <<<EOT
-->
    </table>
</div>
<div class="cc mb10">$pages</div>
<div class="mb10 tac">
	<span class="bt"><span><button type="button" onclick="CheckAll(document.FORM);">全 選</button></span></span>
	<span class="btn"><span><button type="submit" name="hello" onfocus="blur();" onclick="return Checkdel();">刪  除</button></span></span>
</div>
</form>
<!--
EOT;
}print <<<EOT
-->
<script>
function Checkdel(){
	if (!confirm("您確定要刪除選中項嗎?")) {
		return false;
	}else{
		return true;
	}
}
</script>
<!--
EOT;
include_once PrintEot('adminbottom');
?>-->