<!--<?php
include_once PrintEot('left');
if(!empty($sub)){
print <<<EOT
-->
<div class="nav3 mb10">
  <ul class="cc">
    <li><a href="$basename">帖子索引設置</a></li>
    <li class="current"><a href="$basename&sub=y">添加帖子索引</a></li>
  </ul>
</div>
<h3 class="h1">按回復數查詢帖子</h3>
<form method="post" action="{$basename}&sub=y&action=search">
  <div class="admin_table mb10">
    <table cellpadding="0" cellspacing="0" width="100%">
      <tr class="tr1 vt">
        <td class="td1">根據回復數</td>
        <td class="td2"><ul class="cc list_A list_80 mr10 fl">
<!--
EOT;
!$replies && $replies = $repliesArray[0];
foreach ($repliesArray as $value) {
$checked = $value == $replies ? 'checked' : '';
print <<< EOT
-->
		<li><input type="radio" value="$value" name="replies" $checked/>大于$value</li>
<!--
EOT;
}print <<< EOT
-->
          </ul>
          
          <span class="bt2"><span>
          <button type="submit" value="查 詢"  name="submit">查 詢</button>
          </span></span>
          </td>
      </tr><tr class="tr1 vt">
        <td class="td1">根據帖子ID查找︰</td>
        <td class="td2">
          <input type="text"  value="$tid" name="tid" class=" input_wa mr5"/>
          <span class="bt2"><span>
          <button type="submit" value="查 詢"  name="submit">查 詢</button>
          </span></span></td>
      </tr>
    </table>
  </div>
</form>
<form action="{$basename}&sub=y&action=update" method="post">
  <h2 class="h1">帖子列表</h2>
  <div class="admin_table mb10">
    <table width="100%" cellspacing="0" cellpadding="0">
      <tr class="tr2 vt td_bgB">
        <td>ID</td>
        <td>主題</td>
        <td>回復數</td>
        <td>發帖日期</td>
        <td>選擇</td>
      </tr>
<!--
EOT;
$num=0;
foreach ($threads[data] as $key => $value) {
$_disable = $value['replies'] > 0 ? "" : "disabled";
$num++;
print <<< EOT
-->
      <tr class="tr1 vt">
        <td class="td2">$num</td>
        <td class="td2"><a href="read.php?fid=$value[fid]&tid=$value[tid]" target="_blank">$value[subject]</a></td>
        <td class="td2">$value[replies]</td>
        <td class="td2">$value[postdate]</td>
        <td class="td2"><input type="checkbox" name="threads[]" value="$value[tid]" $_disable/>
        </td>
      </tr>
<!--
EOT;
}
print <<< EOT
-->
    </table>
  </div>
  <input type="hidden" name="page" value="$page"/>
  <input type="hidden" name="replies" value="$replies"/>
  <input type="hidden" name="tid" value="$tid"/>
  $threads[pages]
  <div class="mb10 tac"> <span class="btn"><span>
    <button type="submit" value="添加索引" name="submit">添加索引</button>
    </span></span></div>
</form>
</div>
<!--
EOT;
}else{
print <<< EOT
-->
<div class="nav3 mb10">
  <ul class="cc">
    <li class="current"><a href="$basename">帖子索引設置</a></li>
    <li><a href="$basename&sub=y">添加帖子索引</a></li>
  </ul>
</div>
<form action="{$basename}&action=delete" method="post" name="postIndex" id="postIndex" onsubmit="if(!confirm('真的要刪除嗎？')){return false;}">
  <h2 class="h1">帖子列表</h2>
  <div class="admin_table mb10">
    <table width="100%" cellspacing="0" cellpadding="0">
      <tr class="tr2 vt td_bgB">
      	<td width="24"><span onclick="CheckAll(document.postIndex)" class="cp">全選</span></td>
        <td>ID</td>
        <td>主題</td>
        <td>回復數</td>
        <td>發帖日期</td>
        <td>&nbsp;</td>
      </tr>
<!--
EOT;
foreach($threads['data'] as $key => $value){
$num++;
print <<< EOT
-->
      <tr class="tr1 vt">
        <td class="td2"><input type="checkbox" value="$value[tid]" name="tids[]"/></td>
        <td class="td2">$num</td>
        <td class="td2"><a href="read.php?fid=$value[fid]&tid=$value[tid]" target="_blank">$value[subject]</a></td>
        <td class="td2">$value[replies]</td>
        <td class="td2">$value[postdate]</td>
        <td class="td2"><input type="button" name="resest" value="重新建立索引" onclick="location.href='{$basename}&action=reset&tid=$value[tid]&page=$page'" class="btn" $disable/>
        </td>
      </tr>
<!--
EOT;
}print <<< EOT
-->
    </table>
  </div>
  $threads[pages]
  </center>
  <div class="mb10 tac"> <span class="btn"><span>
    <button type="submit" value="刪除選中" name="submit">刪除選中</button>
    </span></span></div>
</form>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->
