<!--<?php
include_once PrintEot('left');
print <<<EOT
-->
<div class="nav3 mb10 ta">
    <ul class="cc">
<!--
EOT;
if ($type == 'topic'){print <<<EOT
-->
      <li class="current"><a href="$basename&type=topic">主題回收站</a></li>
      <li><a href="$basename&type=reply">回復回收站</a></li>
<!--
EOT;
}else{print <<<EOT
-->
      <li><a href="$basename&type=topic">主題回收站</a></li>
      <li class="current"><a href="$basename&type=reply">回復回收站</a></li>
<!--
EOT;
}print <<<EOT
-->
    </ul>
</div>
<div class="admin_info mb10">
    <h3 class="h1"><b>提示信息</b></h3>
    <div class="legend">
      <ol>
      <li>還原:可將被刪除的帖子主題或回復還原到原來的版塊帖子中。</li><li>刪除:將帖子主題或回復從回收站中徹底刪除,不可恢復</li><li>清空:刪除所有回收站帖子</li><li>刪除記錄:刪除回收站的記錄,但並沒有徹底刪除帖子內容,不可恢復</li>
      </ol>
    </div>
 </div>
<!--
EOT;
if ($type == 'topic'){print <<<EOT
-->
<form action="$basename&type=topic&" method=post>
  <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">
				<input type="text" class="input input_wa mr20" name="keyword">（可使用通配符*）
		   </td>
		</tr>
		<tr class="tr1 vt">
           <td class="td1"> 來源 </td>
		   <td class="td2">
				<select name="from" class="select_wa mr20" onchange="changeFrom(this.value);">
					<option value="0" {$fromSelect[0]}>所有來源</option>
					<option value="1" {$fromSelect[1]}>版塊</option>
					<option value="2" {$fromSelect[2]}>群組</option>
				</select>
		   </td>
		</tr>
		<tr class="tr1 vt" style="display:none;" id="fromforum">
          <td class="td1">所屬版塊 </td>
		  <td class="td2">
            <select name="fid" class="select_wa mr20">
              <option>選擇分類</option>
              $forumcache
            </select>
		  </td>
	    </tr>
		<tr class="tr1 vt" style="display:none;" id="fromcolony">
          <td class="td1">群組名稱</td>
		  <td class="td2">
            <input type="text" class="input input_wa mr20" name="cname">
		  </td>
	    </tr>
		<tr class="tr1 vt">
           <td class="td1">用戶名</td>
		   <td class="td2">
				<input type="text" class="input input_wa mr20" name="username">
		   </td>
		</tr>
		<tr class="tr1 vt">
            <td class="td1">刪除人</td>
			<td class="td2">
				<input type="text" class="input input_wa mr20" name="admin">
			</td>
        </tr>
				<tr class="tr1 vt">
            <td class="td1">&nbsp;</td>
			<td class="td2">
				<span class="btn2"><span><button type="submit">提 交</button></span></span>
			</td>
        </tr>
      </table>
  </div>
</form>
<script type="text/javascript">
var typefrom = '$from';
function changeFrom(value) {
	var fromforum = getObj('fromforum');
	var fromcolony = getObj('fromcolony');
	if(value == 1) {
		fromforum.style.display = '';
		fromcolony.style.display = 'none';
	} else if (value == 2){
		fromforum.style.display = 'none';
		fromcolony.style.display = '';
	} else {
		fromforum.style.display = 'none';
		fromcolony.style.display = 'none';
	}
}
window.onload = function(){
	changeFrom(typefrom);
}
</script>
<form action="$basename&type=topic&" method="post" name="form1">
  <h3 class="h1">帖子列表</h3>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
	  <tr class="tr2"><td width="30"><span onclick="CheckAll(document.form1)" class="cp">全選</span></td>
      <td>標題</td>
<!--
EOT;
if ($from == 2) {print<<<EOT
-->
	 <td>群組名稱</td>
<!--
EOT;
} elseif ($from == 1) {print<<<EOT
-->
	 <td>版塊</td>
<!--
EOT;
}else{print<<<EOT
-->
	<td>來源</td>
<!--
EOT;
}print<<<EOT
-->

      <td>用戶名</td>
      <td>發帖時間</td>
      <td>刪除人</td>
      <td>刪除時間</td>
    </tr>
<!--
EOT;
if (empty($recycledb)) {print <<<EOT
-->
<tr><td class="p10" colspan="6"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
foreach($recycledb as $key => $value){
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2"><input type='checkbox' name='selid[$value[tid]]' value="$value[fid]"></td>
      <td class="td2" onclick="content('$value[tid]');">$value[subject]</td>
      <td class="td2">
<!--
EOT;
if ($from == 2) {print<<<EOT
-->
	 <a href="apps.php?q=group&cyid=$value[cyid]" target="_blank">$value[cname]</a>
<!--
EOT;
} elseif ($from == 1) {print<<<EOT
-->
	  <a href="thread.php?fid=$value[fid]" target="_blank">$value[fname]</a>
<!--
EOT;
}else{
if($value[cyid]){print<<<EOT
-->
	[群組]<a href="apps.php?q=group&cyid=$value[cyid]" target="_blank">$value[cname]</a>
<!--
EOT;
}if ($value[fid]) {print<<<EOT
-->
	[版塊]<a href="thread.php?fid=$value[fid]" target="_blank">$value[fname]</a>
<!--
EOT;
}}print<<<EOT
-->
	  </td>
      <td class="td2"><a href="u.php?uid=$value[authorid]" target="_blank">$value[author]</a></td>
      <td class="td2">$value[postdate]</td>
      <td class="td2">$value[admin]</td>
      <td class="td2">$value[deltime]</td>
    </tr>
    <tr id="content_$value[tid]" style="display:none;" class="tr1 vt">
      <td class="td2" colspan="7">$value[content]</td>
    </tr>
<!--
EOT;
}}print <<<EOT
-->
  </table>
  </div>
  <div class="fr"><span class="bt2"><span><button type="button" value="清空草稿箱" onclick="Recycle.Confirm('topic');">清空回收站</button></span></span>
  </div>
  <div class="cc mb10">$pages</div>
  <div class="mb10 tac">
  	<p><input type="radio" name="action" value="revert" checked> 還原帖子&nbsp;
        <input type="radio" name="action" value="del" > 刪除帖子&nbsp;
        <input type="radio" name="action" value="clear"> 刪除記錄</p>
  </div>
<div class="tac mb10">
	<span class="bt"><span><button type="button" onclick="CheckAll(document.form1)">全 選</button></span></span>
    <span class="btn"><span><button type="submit" name="hello" onclick="return confirm('您確認要進行此操作嗎?');">提 交</button></span></span>
</div>
</form>
<!--
EOT;
}else{print <<<EOT
-->
<form action="$basename&type=reply&" method=post>
<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">
				<input type="text" class="input input_wa mr20" name="keyword">（可使用通配符*）
		   </td>
		</tr>
		<tr class="tr1 vt">
           <td class="td1"> 來源 </td>
		   <td class="td2">
				<select name="from" class="select_wa mr20" onchange="changeFrom(this.value);">
					<option value="0">所有來源</option>
					<option value="1">版塊</option>
					<option value="2">群組</option>
				</select>
		   </td>
		</tr>
		<tr class="tr1 vt" style="display:none;" id="fromforum">
          <td class="td1">所屬版塊 </td>
		  <td class="td2">
            <select name="fid" class="select_wa mr20">
              <option>選擇分類</option>
              $forumcache
            </select>
		  </td>
	    </tr>
		<tr class="tr1 vt" style="display:none;" id="fromcolony">
          <td class="td1">群組名稱</td>
		  <td class="td2">
            <input type="text" class="input input_wa mr20" name="cname">
		  </td>
	    </tr>
		<tr class="tr1 vt">
           <td class="td1">用戶名</td>
		   <td class="td2">
				<input type="text" class="input input_wa mr20" name="username">
		   </td>
		</tr>
		<tr class="tr1 vt">
            <td class="td1">刪除人</td>
			<td class="td2">
				<input type="text" class="input input_wa mr20" name="admin">
			</td>
        </tr>
				<tr class="tr1 vt">
            <td class="td1">&nbsp;</td>
			<td class="td2">
				<span class="btn2"><span><button type="submit">提 交</button></span></span>
			</td>
        </tr>
      </table>
  </div>
<input type="hidden" name="ptable" id="ptable" value="">
</form>
<script type="text/javascript">
var typefrom = '$from';
function changeFrom(value) {
	var fromforum = getObj('fromforum');
	var fromcolony = getObj('fromcolony');
	if(value == 1) {
		fromforum.style.display = '';
		fromcolony.style.display = 'none';
	} else if (value == 2){
		fromforum.style.display = 'none';
		fromcolony.style.display = '';
	} else {
		fromforum.style.display = 'none';
		fromcolony.style.display = 'none';
	}
}
window.onload = function(){
	if (getObj('select_ptable')) {
		var ptable = getObj('select_ptable').value;
		getObj('ptable').value = ptable;
	}
	changeFrom(typefrom);
}
</script>
<form action="$basename&type=reply&" method="post" name="form1">
<h3 class="h1"><span class="mr10">回復列表</span>
<!--
EOT;
if($db_plist && count($db_plist)>1){print <<<EOT
-->
        <select onchange="window.location=('$basename&type=reply&ptable='+this.value);" name="select_ptable" id="select_ptable" class="f12">
          $p_table
        </select>
<!--
EOT;
}print <<<EOT
-->
        </h3>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
	  <tr class="tr2"><td width="30"><span onclick="CheckAll(document.form1)" class="cp">全選</span></td>
      <td>標題</td>
<!--
EOT;
if ($from == 2) {print<<<EOT
-->
	 <td>群組名稱</td>
<!--
EOT;
} elseif ($from == 1) {print<<<EOT
-->
	 <td>版塊</td>
<!--
EOT;
}else{print<<<EOT
-->
	<td>來源</td>
<!--
EOT;
}print<<<EOT
-->
      <td>用戶名</td>
      <td>發帖時間</td>
      <td>刪除人</td>
      <td>刪除時間</td>
    </tr>
<!--
EOT;
if (empty($recycledb)) {print <<<EOT
-->
<tr><td class="p10" colspan="6"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
foreach($recycledb as $key => $value){
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2"><input type='checkbox' name='selid[$value[pid]]' value="$value[fid]"></td>
      <td class="td2" onclick="content('$value[pid]');">$value[subject](<a href="read.php?tid=$value[tid]" target="_blank">查看主題帖</a>)</td>
	  <td class="td2">
<!--
EOT;
if ($from == 2) {print<<<EOT
-->
	  <a href="apps.php?q=group&cyid=$value[cyid]" target="_blank">{$colonydb[$value[tid]][cname]}</a>
<!--
EOT;
} elseif ($from == 1) {print<<<EOT
-->
	  <a href="thread.php?fid=$value[fid]" target="_blank">$value[fname]</a>
<!--
EOT;
}else{
if($colonydb[$key][cyid]){print<<<EOT
-->
	[群組]<a href="apps.php?q=group&cyid={$colonydb[$key][cyid]}" target="_blank">{$colonydb[$value[tid]][cname]}</a>
<!--
EOT;
}if ($value[fid]) {print<<<EOT
-->
	[版塊]<a href="thread.php?fid=$value[fid]" target="_blank">$value[fname]</a>
<!--
EOT;
}}print<<<EOT
-->
      </td>
      <td class="td2"><a href="u.php?uid=$value[authorid]" target="_blank">$value[author]</a></td>
      <td class="td2">$value[postdate]</td>   
      <td class="td2">$value[admin]</td>
      <td class="td2">$value[deltime]</td>
    </tr>
    <tr id="content_$value[pid]" class="tr1 vt" style="display:none;">
      <td class="td2" colspan="7"><div style="border:1px solid #ccc;background:#f7f7f7;margin-left:35px;padding:3px 11px;">$value[content]</div></td>
    </tr>
<!--
EOT;
}}print <<<EOT
-->
  </table>
  </div>
  <div class="fr"><span class="bt2"><span><button type="button" value="清空回收站" onclick="Recycle.Confirm('reply');">清空回收站</button></span></span></div>
  <div class="cc mb10">$pages</div>
  <div class="mb10 tac">
  	<p><input type="radio" name="action" value="revert"> 還原回復&nbsp;
        <input type="radio" name="action" value="del" checked> 刪除回復&nbsp;
        <input type="radio" name="action" value="clear"> 刪除記錄</p>
  </div>
  <div class="tac mb10">
	<span class="bt"><span><button type="button" onclick="CheckAll(document.form1)">全 選</button></span></span>
    <span class="btn"><span><button type="submit" name="hello" onclick="return confirm('您確認要進行此操作嗎?');">提 交</button></span></span>
 </div>
</form>
<!--
EOT;
}print <<<EOT
-->
<script type="text/javascript">
function content(id){
	var o = getObj('content_'+id);
	o.style.display = o.style.display == 'none' ? '' : 'none';
}

var Recycle = {
	Confirm : function (type){
		if(confirm("清空後回收站內所有數據將不能被恢復！確認要清空回收站麼？")){
			var form = document.form1;
			for(var i=0;i<form.elements.length;i++){
				if(form.elements[i].type == "radio" && form.elements[i].checked){
					form.elements[i].value = "empty";
				}
			}
			form.submit();
		}
		return false;
	}
}

</script>
<!--
EOT;
include_once PrintEot('adminbottom');
?>-->