<!--<?php
if (!defined('AJAX')){
include_once PrintEot('left');
}
if (empty($action)) {print <<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
      <li class="current"><a href="$admin_file?adminjob=tpccheck">主題審核</a></li>
      <li><a href="$admin_file?adminjob=tpccheck&action=postcheck">回復審核</a></li>
    </ul>
</div>
<div class="admin_info mb10">
    <h3 class="h1"><b>提示信息</b></h3>
    <div class="legend">版塊開啟 "主題審核" 功能時，只有經過管理員審核的主題才會在前台顯示</div>
</div>
<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="td2">所屬版塊 :
        <select name="fid" class="select_wa mr20">
          <option>選擇分類</option>
          $forumcache
        </select>
        作者 :
        <input type="text" class="input input_wa mr20" name="username" value="$username">
        <span class="bt2"><span><button type="submit" value="提 交">提 交</button></span></span></td>
    </tr>
  </table>
  </div>
</form>
<script> 	
  	
  	function makeOneChceck(obj){
  		var el = document.forms['FORM'].elements;
		var j = 0;
		var cls = {'pass':'tr1 vt td_bgD','dels':'tr1 vt td_bgC','here':'tr1 vt'};
		
		arr = obj.name.split("[");
		arr[1] = arr[1].split("]")[0];
		getObj('TR_'+arr[1]).setAttribute('class',cls[arr[0]]);
		
		for(var i=0; i<el.length; i++){
			if(obj.value == el[i].value && 'INPUT' == el[i].tagName && "radio" == el[i].type){
					el[i].checked = false;
			}		
		}
		obj.checked = true;
	};
		
	function allCheck(ttype){
		var el = document.forms['FORM'].elements;
		var regs = {'pass':/^pass\[(\d+)\]$/,'dels':/^dels\[(\d+)\]$/,'here':/^here\[(\d+)\]$/};
		for(var i=0; i<el.length; i++){	  				
			if('INPUT' == el[i].tagName && "radio" == el[i].type){						
					if(regs[ttype].test(el[i].name)){
							makeOneChceck(el[i]);
					}
			}
		}
	}  	
  			
  </script>
<form action="$basename&" method="post" name="FORM">
  <input type=hidden name=job value=search>
  <input type=hidden name=step value=2>
  <h2 class="h1">帖子列表</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <!--<tr class="tr2">
	  <td width="100"><span>操作</span></td>
      <td>標題</td>
      <td>作者</td>
      <td>所屬版塊</td>
      <td>發表時間</td>
    </tr>-->
<!--
EOT;
if (empty($checkdb)) {print <<<EOT
-->
<tr><td class="p10" colspan="5"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
foreach($checkdb as $check){
print <<<EOT
--><!--td_bgD為通過 td_bgC為刪除 -->
    <tr class="tr1 vt" id="TR_$check[tid]">
      <td class="td1">
				<ul class="list_A">
					<li><label><input type="radio" onclick="makeOneChceck(this)" name="pass[$check[tid]]" value="$check[tid]"> 通過</label></li>
					<li><label><input type="radio" onclick="makeOneChceck(this)" name="dels[$check[tid]]" value="$check[tid]"> 刪除</label></li>
					<li><label><input type="radio" onclick="makeOneChceck(this)" name="here[$check[tid]]" checked="true" value="$check[tid]"> 暫不處理</label></li>
				</ul>
      	
      	<!--<input type="checkbox" name="selid[]" value="$check[tid]" onclick="pwJsCheck(this)" />-->
      	
      	</td>
      	
      <td class="td2">
      	
      	<a href="thread.php?fid=$check[fid]" target="_blank">$check[name]</a>
      	
      	<span>>></span>
      	
      	<!--<a href="$admin_file?adminjob=content&type=tpc&id=$check[tid]">$check[subject]</a>-->
      	
      	<a href="read.php?tid=$check[tid]" target="_blank">$check[subject]</a>
      	<br/>
      	
      	作者︰<a href="{$db_userurl}$check[authorid]" target="_blank" class="mr10">$check[author]</a>
      	<span class="mr10">發表時間︰$check[postdate]</span>
				<a href="post.php?action=modify&fid=$check[fid]&tid=$check[tid]&pic=tpc&article=0" target="_blank" class="mr5">[編輯]</a>
      	<a id="move" href="javascript:;" onclick="sendmsg('$admin_file?adminjob=tpccheck&action=moveThread&fid=$check[fid]&tid=$check[tid]','',this.id);" title="移動主題">[移動]</a>
      	
      	<br/>
      	<div class="p10" style="line-height:1.5;border:1px solid #ccc;background:#fff;max-height:140px;overflow-y:auto;">$check[content]</div>

      	
      	</td>
      <!--<td class="td2"><a href="{$db_userurl}$check[authorid]" target="_blank">$check[author]</a></td>
      <td class="td2"><a href="thread.php?fid=$check[fid]" target="_blank">$check[name]</a></td>
      <td class="td2">$check[postdate]</td>-->
    </tr>
<!--
EOT;
}}print <<<EOT
-->
  </table>
  
  
  </div>
  <div class="cc mb10">$pages</div>
  <div class="tac mb10" style="float:left">
  	<span class="bt2"><span><button type="button" onclick="allCheck('pass')">全部通過</button></span></span>
		<span class="bt2"><span><button type="button" onclick="allCheck('dels')">全部刪除</button></span></span>
		<span class="bt2"><span><button type="button" onclick="allCheck('here')">全部暫不處理</button></span></span>
		<!--<input type="radio" name="type" value="del"> 刪除&nbsp;
    <input type="radio" name="type" checked='checked' value="pass"> 通過-->
        
  </div>
    <div class="tac mb10">
        <span class="btn"><span><button type="submit">提 交</button></span></span>
    </div>
</form>
<!--
EOT;
} if ($action == 'moveThread'){print<<<EOT
-->
<form action="$basename&ajax=1" method="post" onsubmit="return false;" name="ajaxfm">
<input type="hidden" name="step" value="2" />
<input type="hidden" name="tidarray[]" value="$tid" />
<input type="hidden" name="fid" value="$fid" />
<h2 class="h1" style="cursor:move" onmousedown="read.move(event);">移動帖子</h2>
<div class="p10" style="width:250px;">
	<div class="mb10">目的版塊:<select name="to_id" id="to_id" onchange="getThreadCates(this.value)">$forumcache</select></div>
	<div class="cc"><span class="fl" style="padding-top:4px;">主題分類:</span><div id="innerselect" class="fl mr10"><select name="to_threadcate" id="to_threadcate" onchange="getSubType(this.value)"><option value="">無主題分類</option></select></div><div id="subtypeselect" class="fl"></div></div>
</div>
<div class="popBottom">
<span class="btn2"><span><button type="button" name="ajaxsubmit"   onclick="ajax.submit(this.form)">提 交</button></span></span>
<span class="bt2"><span><button type="button" onclick="closep();">取消</button></span></span>
</div>
</form>
<script>
function getThreadCates(fid){
	var selobj = getObj('to_threadcate');
	selobj.options.length=0;
	selobj.options.add(new Option("不分類","0"));
	var t_typedb = JSONParse('$t_typedb');
	for (var temp in t_typedb) {
		if (temp == fid) {
			for (var temp2 in t_typedb[temp]) {
				if(temp2 != 0) {
					selobj.options.add(new Option(t_typedb[temp][temp2],temp2));
				}
			}
		}
	}
	//getObj('to_threadcate').appendChild(selobj);
	getObj('subtypeselect').innerHTML = '';
}
function getSubType(id){
	var ishave = 0;
	var fid = getObj('to_id').value;
	var selobj = elementBind('select');
	selobj.setAttribute('name','to_subtype');
	selobj.options.add(new Option("不分類","0"));
	var t_subtypedb = JSONParse('$t_subtypedb');
	for (var temp in t_subtypedb) {
		if (temp == fid) {
			for (var temp2 in t_subtypedb[temp]) {
				if (temp2 == id) {
					for (var temp3 in t_subtypedb[temp][temp2]) {
						ishave++;
						selobj.options.add(new Option(t_subtypedb[temp][temp2][temp3],temp3));
					}
				}
			}
		}
	}
	if (ishave > 0) {
		getObj('subtypeselect').innerHTML = '';
		getObj('subtypeselect').appendChild(selobj);
	} else {
		getObj('subtypeselect').innerHTML = '';
	}
}
</script>
<!--
EOT;
}if (!defined('AJAX')) {
include_once PrintEot('adminbottom');
}
?>-->
