<!--<?php
include_once PrintEot('left');
if(empty($action)){
if($admintype == 'article'){
print <<<EOT
-->
<!-- <h2 class="h1 mb10"><a href="$admin_file?adminjob=app&admintype=appslist">返回基礎應用列表</a></h2> -->
<!--
EOT;
}print<<<EOT
-->
<div class="admin_info mb10">
  <h3 class="h1"><b>提示信息</b></h3>
  <div class="legend">
    <ul>
<!--
EOT;
if($admintype=='article'){print <<<EOT
-->
      <ol><li>刪除符合條件的帖子用于清理站點冗余數據,此操作不可恢復,請謹慎使用！</li><li>用戶組成員根據用戶組權限設置取得相應批量刪除權限</li><li>版主擁有所管轄的版塊（分類）發布的批量刪除的權限<br /><span class="s1">功能說明</span>:<br/>使用<font color=blue>刪除主題</font>功能可刪除某個會員發表的所有主題(包括回復)<br />使用<font color=blue>刪除回復</font>功能可刪除某個會員發表的所有回復</li></ol>
<!--
EOT;
}elseif($admintype=='delmember'){
print <<<EOT
-->
      刪除符合條件的用戶,用于清理站點冗余數據,此操作不可恢復,請謹慎使用！<br />刪除項目中的“其他”，包括評分、收藏、朋友等其他行為記錄。
<!--
EOT;
}elseif($admintype=='message'){
print <<<EOT
-->
      刪除符合條件的消息,用于清理站點冗余數據,此操作不可恢復,請謹慎使用！
<!--
EOT;
}print <<<EOT
-->
    </ul>
  </div>
</div>
<!--
EOT;
}if($admintype=='article'){
if(empty($action)){print <<<EOT
-->
<script type="text/javascript" src="js/date.js"></script>
<form action="$basename&" method=post>
  <input type=hidden name=action value='deltpc'>
  <h2 class="h1"><b>刪除主題</b></h2>
  <div class="admin_table mb10">
	<table cellpadding="0" cellspacing="0" width="100%">
<!--
EOT;
if($db_sphinx['isopen'] == 1){
print <<<EOT
-->
    <script type="text/javascript">
var sphinxControl = {
	num : 8,
	$ : function(id){
		return document.getElementById(id);
	},
	check : function(){
		var checkbox = this.$("sphinxopen");
		if(checkbox.checked == 1){
			this.hidden('none');
		}else{
			this.hidden('');
		}
	},

	hidden : function(show){
		for(var i=0;i<=this.num;i++){
			var obj = this.$("condition_"+i);
			obj ? obj.style.display = show : 0;
		}
	}
}
window.onload = function(){
	if(parent.adminNavClass){
		parent.adminNavClass.initTips();
	}
	sphinxControl.check();
}
</script>
    <tr class="tr1 vt">
      <td class="td1">使用全文索引搜索</td>
      <td class="td2"><input type="checkbox" name="sphinx" id="sphinxopen" value="1" checked onclick="sphinxControl.check();" />開啟 sphinx開啟之後才會顯示該功能,使用全文索引將加快搜索速度.關鍵字如果為空將使用普通搜索方式
      </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">全文索引搜索帖子搜索範圍</td>
      <td class="td2">
        <div class="list_A">
            <ul>
                <li><input type="radio" name="sphinxRange" value="1" checked />主題標題</li>
                <li><input type="radio" name="sphinxRange" value="2"  />主題標題與主題內容</li>
            </ul>
        </div>
      </td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td1">所屬版塊</td>
      <td class="td2"><select name="fid"  class="select_wa mr20 fl">
          <option value='-1'>所有版塊</option>
          $forumcache
        </select>
        <input type="checkbox" name="ifkeep" value="1" checked>
        保留精華置頂
        </td>
    </tr>
<!--
EOT;
if($t_table){ print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td1">分表數據庫</td>
      <td class="td2"><select name="ttable"  class="select_wa">
          $t_table
        </select></td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
    <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 type="text" name="pstarttime" id="pstarttime" onClick="javascript:ShowCalendar(this.id)" /></div><span class="p_lr_10 fl">至</span><div  class="input_img fl mr20"><i onclick="this.nextSibling.onclick()" class="input_time" title="選擇時間">選擇時間</i><input type="text" name="pendtime" id="pendtime" onClick="javascript:ShowCalendar(this.id)" /></div>可只用單個條件
      </td>
    </tr>
    <tr class="tr1 vt" id="condition_0">
      <td class="td1">主題最後被回復時間</td>
      <td class="td2">
      <div class="input_img fl"><i onclick="this.nextSibling.onclick()" class="input_time" title="選擇時間">選擇時間</i><input type="text" name="lstarttime" id="lstarttime" onClick="javascript:ShowCalendar(this.id)" /></div><span class="p_lr_10 fl">至</span><div class="input_img fl mr20"><i onclick="this.nextSibling.onclick()" class="input_time " title="選擇時間">選擇時間</i><input type="text" name="lendtime" id="lendtime" onClick="javascript:ShowCalendar(this.id)" /></div>只可用單個條件
      </td>
    </tr>
    <tr class="tr1 vt" id="condition_1">
      <td class="td1">指定 tid 範圍</td>
      <td class="td2">
      <input type="text" class="input input_wa" name="tstart"><span class="p_lr_10">-</span><input type="text" class="input input_wa mr20" name="tend"> 只可用單個條件
      </td>
    </tr>
    <tr class="tr1 vt" id="condition_2">
      <td class="td1">瀏覽人數小于</td>
      <td class="td2"><input type="text" class="input input_wa mr20" maxlength=14 name="hits"><!-- 的主題 --></td>
    </tr>
    <tr class="tr1 vt" id="condition_4">
      <td class="td1">回復人數小于</td>
      <td class="td2"><input type="text" class="input input_wa mr20" maxlength=14 name="replies"><!-- 的主題 --></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">按主題作者刪除</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="author">可使用通配符 "*"，多個作者用英文半角逗號","分隔</td>
    </tr>
     <tr class="tr1 vt">
      <td class="td1">按作者UID刪除</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="authorid">多個UID用英文半角逗號","分隔</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">關鍵字</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="keyword">可使用通配符 "*"，多個關鍵字用英文半角逗號","分隔</td>
    </tr>
    <tr class="tr1 vt" id="condition_5">
      <td class="td1">內容大于[字節]</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="tcounts"></td>
    </tr>
    <tr class="tr1 vt" id="condition_6">
      <td class="td1">內容少于[字節]</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="counts"></td>
    </tr>
    <tr class="tr1 vt" id="condition_7">
      <td class="td1">根據用戶IP查找</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="userip">可使用通配符 "*"</td>
    </tr>
    <tr class="tr3" id="condition_8">
      <td class="td1"><div id="info1">每頁顯示行數</div></td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="lines" value="30"><input type="checkbox" name="direct" value=1 onclick="deldirect(this.form,'info1','每頁顯示行數');">
    直接刪除(直接刪除符合條件的項目)
        </td>
    </tr>
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
    </div>
</form>
<form action="$basename&" method=post>
  <input type=hidden name=action value='delrpl'>
  <h2 class="h1"><b>刪除回復</b></h2>
  <div class="admin_table mb10">
	<table cellpadding="0" cellspacing="0" width="100%">
<!--
EOT;
if($db_sphinx['isopen'] == 1){
print <<<EOT
-->
    <script type="text/javascript">
var sphinxPostControl = {
	num : 6,
	$ : function(id){
		return document.getElementById(id);
	},
	check : function(){
		var checkbox = this.$("sphinxpostopen");
		if(checkbox.checked == 1){
			this.hidden('none');
		}else{
			this.hidden('');
		}
	},

	hidden : function(show){
		for(var i=0;i<=this.num;i++){
			var obj = this.$("conditionpost_"+i);
			obj ? obj.style.display = show : 0;
		}
	}
}
</script>
    <tr class="tr1 vt">
      <td class="td1">使用全文索引搜索</td>
      <td class="td2"><input type="checkbox" name="sphinx" value="1" onclick="sphinxPostControl.check();" id="sphinxpostopen"/>開啟 sphinx開啟之後才會顯示該功能,使用全文索引將加快搜索速度.關鍵字如果為空將使用普通搜索方式</td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td1">所屬版塊</td>
      <td class="td2"><select name="fid" class="select_wa">
          <option value='-1'>所有版塊</option>
          $forumcache
        </select></td>
    </tr>
<!--
EOT;
if($p_table){ print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td1">分表數據庫</td>
      <td class="td2"><select name="ptable" class="select_wa">
          $p_table
        </select></td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
    <tr class="tr1 vt" id="conditionpost_0">
      <td class="td1">所屬主題ID</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="tid">
        <span class="s1">用于刪除指定主題的所有回復。多個主題ID用英文半角逗號","分隔</span></td>
    </tr>
    <tr class="tr1 vt" id="conditionpost_1">
      <td class="td1">指定 pid 範圍</td>
      <td class="td2"><input type="text" class="input input_wa" name="pstart">
        -
        <input type="text" class="input input_wa mr20" name="pend">只可用于單個條件
      </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">按作者刪除(<font color=blue>回復作者</font>)</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="author">可使用通配符 "*"，多個作者用英文半角逗號","分隔</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">關鍵字</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="keyword">可使用通配符 "*"</td>
    </tr>
    <tr class="tr1 vt" id="conditionpost_2">
      <td class="td1">內容大于[字節]</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="tcounts"></td>
    </tr>
    <tr class="tr1 vt" id="conditionpost_3">
      <td class="td1">內容少于[字節]</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="counts"></td>
    </tr>
    <tr class="tr1 vt" id="conditionpost_4">
      <td class="td1">根據用戶IP查找</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="userip">可使用通配符 "*"</td>
    </tr>
    <tr class="tr1 vt" id="conditionpost_5">
      <td class="td1">每批處理的個數</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="nums" value="30"><input type="checkbox" name="direct" value=1 onclick="deldirect(this.form,'info2','每批處理的個數');">
        直接刪除(直接刪除符合條件的項目)</td>
    </tr>
  </table>
  </div>
  	<div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
    </div>
</form>
<!--
EOT;
} elseif($action=='deltpc' && empty($step)){print <<<EOT
-->
<form action="$basename&" method="post" name="del_tpc_form"  id="del_tpc_form">
  <input type="hidden" name="action" value="$action">
  <input type="hidden" name="ttable" value="$ttable">
  <input type="hidden" name="fid" value="$fid">
  <input type="hidden" name="ifkeep" value="$ifkeep">
  <input type="hidden" name="pstarttime" value="$pstarttime">
  <input type="hidden" name="pendtime" value="$pendtime">
  <input type="hidden" name="lstarttime" value="$lstarttime">
  <input type="hidden" name="lendtime" value="$lendtime">
  <input type="hidden" name="tstart" value="$tstart">
  <input type="hidden" name="tend" value="$tend">
  <input type="hidden" name="hits" value="$hits">
  <input type="hidden" name="replies" value="$replies">
  <input type="hidden" name="author" value="$author">
  <input type="hidden" name="authorid" value="$authorid">
  <input type="hidden" name="keyword" value="$keyword">
  <input type="hidden" name="userip" value="$userip">
  <input type="hidden" name="lines" value="$lines">
  <input type="hidden" name="tcounts" value="$tcounts">
  <input type="hidden" name="counts" value="$counts">
  <input type="hidden" name="page" value="$page">
  <input type="hidden" name="sphinx" value="$sphinx">
  <input type="hidden" name="sphinxRange" value="$sphinxRange">
  <input type="hidden" name="step" value="2">
   <!--  <h2 class="h1 mb10"><a href="$admin_file?adminjob=app&admintype=appslist">返回基礎應用列表</a></h2> -->
    <h3 class="h1"><b>主題列表</b></h3>
    <div class="admin_table mb10">
		<table cellpadding="0" cellspacing="0" width="100%">
          <tr class="tr2">
			<td width="50"><span onclick="CheckAll(document.del_tpc_form);" class="cp">全選</span></td>
            <td width="*">標題</td>
            <td width="70">作者</td>
            <td width="100">發表時間</td>
            <td width="95">IP</td>
            <td>版塊</td>
            <td width="30">回復</td>
            <td width="30">人氣</td>
          </tr>
<!--
EOT;
if ($topicdb) {
foreach($topicdb as $key=>$topic){
if(!$topic[subject])continue;
print <<<EOT
-->
          <tr class="tr1">
            <td class="td2"><input type="checkbox" name="delid[$topic[tid]]" value="$topic[fid]"></td>
            <td class="td2"><p class="lh_18"><a href="read.php?fid=$topic[fid]&tid=$topic[tid]" target="_blank" title="$topic[subject]">$topic[subject]</a></p></td>
            <td class="td2"><a href="{$db_userurl}$topic[authorid]" target=_blank>$topic[author]</a></td>
            <td class="td2">$topic[postdate]</td>
            <td class="td2">$topic[userip]</td>
            <td class="td2"><p class="lh_18">$topic[forumname]</p></td>
            <td class="td2">$topic[replies]</td>
            <td class="td2">$topic[hits]</td>
          </tr>
<!--
EOT;
}}else{
print <<<EOT
-->
		<tr><td class="p10" colspan="8"><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.del_tpc_form);">全 選</button></span></span>
    <span class="btn"><span><button type="submit">刪除</button></span></span>
   </div>
</form>
<!--
EOT;
} elseif($action=='delrpl' && empty($step)){print <<<EOT
-->
<form action="$basename&" name="del_rpl_form" method="post" id="del_rpl_form">
  <input type="hidden" name=action value="$action">
  <input type="hidden" name="step" value="2">
  <input type="hidden" name="ptable" value="$ptable">
  <input type="hidden" name="fid" value="$fid">
  <input type="hidden" name="tid" value="$tid">
  <input type="hidden" name="pstart" value="$pstart">
  <input type="hidden" name="pend" value="$pend">
  <input type="hidden" name="author" value="$author">
  <input type="hidden" name="keyword" value="$keyword">
  <input type="hidden" name="userip" value="$userip">
  <input type="hidden" name="nums" value="$nums">
  <input type="hidden" name="tcounts" value="$tcounts">
  <input type="hidden" name="counts" value="$counts">
  <input type="hidden" name="page" value="$page">
  <input type="hidden" name="sphinx" value="$sphinx">
  <input type="hidden" name="sphinxRange" value="$sphinxRange">
  <!-- <h2 class="h1 mb10"><a href="$admin_file?adminjob=app&admintype=appslist">返回基礎應用列表</a></h2> -->
  <h3 class="h1"><b>主題列表</b></h3>
  <div class="admin_table mb10">
    <table cellpadding="0" cellspacing="0" width="100%">
    <tr class="tr2 vt td_bgB">
	  <td width="50"><span class="cp" onclick="CheckAll(document.del_rpl_form)">全選</span></td>
      <td>作者</td>
      <td>IP</td>
      <td>發表時間</td>
      <td>版塊</td>
      <td>內容</td>
    </tr>
<!--
EOT;
if (!empty($postdb)) {
foreach($postdb as $key=>$post){
if(!$post[content])continue;
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2"><input type="checkbox" name="delid[$post[pid]]" value="$post[delid]" /></td>
      <td class="td2"><a href="{$db_userurl}$post[authorid]" target=_blank>$post[author]</a></td>
      <td class="td2">$post[userip]</td>
      <td class="td2">$post[postdate]</td>
      <td class="td2">$post[forumname]</td>
      <td class="td2"><a href="$basename&action=view&tid=$post[tid]&pid=$post[pid]" target=_blank>$post[content]</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.del_rpl_form);">全 選</button></span></span>
    <span class="btn"><span><button type="submit">刪除</button></span></span>
  </div>
</form>
<!--
EOT;
}}elseif($admintype=='message'){
if(empty($action)){print <<<EOT
-->
<script src="js/date.js" type="text/javascript"></script>
<form action="$basename&" method="post">
  <h2 class="h1">按搜索條件刪除</h2>
  <div class="admin_table mb10">
      <table width="100%" cellspacing="0" cellpadding="0">
        <tr class="tr1 vt">
          <td class="td1">消息時間</td>
          <td class="td2">
          	<div class="input_img fl"><i title="選擇時間" onclick="this.nextSibling.onclick()" class="input_time">選擇時間</i><input type="text" onclick="ShowCalendar(this.id,1);" value="" id="starttime" name="stime"></div>
          	<span class="p_lr_10 fl">-</span>
          	<div class="input_img fl mr20"><i title="選擇時間" onclick="this.nextSibling.onclick()" class="input_time">選擇時間</i><input type="text" onclick="ShowCalendar(this.id,1);" value="" id="endtime" name="etime"></div>
          	搜索設定時間內的消息
          </td>
        </tr>
        <tr class="tr1 vt">
          <td class="td1">發件人</td>
          <td class="td2"><input type="text" class="input input_wa mr20" name="fromuser" /></td>
        </tr>
        <tr class="tr1 vt">
          <td class="td1">關鍵字</td>
          <td class="td2"><input type="text" class="input input_wa mr20" name="keyword" /></td>
        </tr>
        <tr class="tr1 vt">
          <td class="td1">每頁顯示行數</td>
          <td class="td2">
          <input type="text" class="input input_wa mr20 fl" name="lines" value="30" />
            	<ul class="list_A">
                	<li><input type="checkbox" name="direct" value="1" />直接刪除(直接刪除符合條件的項目)</li>
              </ul>
             </td>
        </tr>
      </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
   </div>
  <input type="hidden" name="action" value="del"/>
</form>
<form action="$basename&" method="post" onsubmit=" return confirm('確定要刪除選中消息嗎？')">
  <input type="hidden" name="action" value="msglog" />
  <h3 class="h1">按消息類型刪除</h3>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
   <tr class="tr1 vt">
      <td class="td1">消息類型</td>
      <td class="td2">
      	<select name="smstype">
      		<option value="history">歷史消息</option>
      		<option value="sms">站內信</option>
      		<option value="notice">通知</option>
      		<option value="request">請求</option>
      		<option value="groupsms">群消息</option>
      	</select>&nbsp;&nbsp;<input type="checkbox" name="keepunread" value="1" checked="checked"/>
      	(保留未讀消息)
      </td>
      <!-- <td class="td2"><input type="checkbox" name="direct" value="1" />直接刪除(直接刪除符合條件的項目)</td> -->
    </tr>
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
   </div>
</form>
<!--
EOT;
}if(($action == 'del' || $action == 'msglog') && empty($step)){
print <<<EOT
-->
<form action="$basename&" method="post" name="FORM"  onsubmit=" return confirm('確定要刪除選中消息嗎？')">
  <input type="hidden" name="action" value="$action">
  <input type="hidden" name="step" value="2">

  <input type="hidden" name="smstype" value="$smstype">
  <input type="hidden" name="keepunread" value="$keepunread">

  <input type="hidden" name="etime" value="$etime">
  <input type="hidden" name="stime" value="$stime">
  <input type="hidden" name="fromuser" value="$fromuser">
  <input type="hidden" name="lines" value="$lines">
  <input type="hidden" name="page" value="$page">
  <h2 class="h1"><span class="mr10"><b>消息列表</b></span><a href="$basename" class="linka">返回上一級<span class="f9">▲</span></a></h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0" style="table-layout:auto;">
    <tr class="tr2 vt td_bgB">
	  <td width="50"><span class="cp" onclick="CheckAll(document.FORM)">全選</span></td>
      <td width="200">標題</td>
      <td width="100">發件人</td>
      <td>內容</td>
      <td width="120">時間</td>
    </tr>
<!--
EOT;
if (!empty($searchList)) {
foreach($searchList as $key=>$message){
$message[modified_time] = get_date($message[modified_time]);
$message['content'] = strip_tags($message['content']);
$message['create_username'] = in_array($message['create_username'],array('system')) ? $message['create_username'] :'<a href="u.php?username='.$message[create_username].'" target="_blank">'.$message['create_username'].'</a>';
if(!$message[title])continue;
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2"><input type="checkbox" name="delid[]" value="$message[mid]"></td>
      <td class="td2">$message[title]</td>

      <td class="td2">$message[create_username]</td>
      <td class="td2"><p class="lh_18">$message[content]</p></td>
      <td class="td2">$message[modified_time]</td>
    </tr>
<!--
EOT;
}}else{print <<<EOT
-->
<tr><td class="p10" colspan="5"><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" value="刪除">刪除</button></span></span>
  </div>
</form>
<!--
EOT;
}}include_once PrintEot('adminbottom');
?>-->
<script type="text/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>
