<!-- $Id: forum_list.htm 14216 2008-03-10 02:27:21Z testyang $ -->

{if $full_page}

{include file="pageheader.htm"}

{insert_scripts files="../js/utils.js,listtable.js"}

<div class="form-div">
  <form action="javascript:searchforum()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
    {$lang.search_forum} <input type="text" name="keyword" /> 
    <select name="cid" onchange="change_forum(false)">
      <option value="-1">{$lang.forum_public}</option>
  <option value="0">{$lang.allforum}</option>
<!-- {foreach from=$cat_list item=cat} -->
<option value="{$cat.cid}">{$cat.class_name}</option>
<!-- {/foreach} -->
</select>&nbsp;&nbsp;&nbsp;&nbsp;
<select name="city_id" style="border:1px solid #ccc;" onchange="change_forum(true)">
<option value="-1">{$lang.forum_city}</option>
  <option value="0">{$lang.allforum}</option>
<!-- {foreach from=$city_list item=city} -->
<option value="{$city.city_id}">{$city.city_name}</option>
<!-- {/foreach} -->
</select>
<select name="forum_type" style="border:1px solid #ccc;" onchange="change_forum(true)">
<option value="0">话题</option>
<option value="1">求购</option>
<option value="2">转让</option>
</select>

    <input type="submit" class="Button" value="{$lang.button_search}" />
  </form>
</div>
<form method="POST" action="forum_manage.php?act=batch_drop" name="listForm" onsubmit="return confirm_bath()">
<!-- start forum list -->
<div class="list-div" id="listDiv">
{/if}
<table cellpadding="3" cellspacing="1">
  <tr>
    <th style="padding-left:10px;" align="left">
      <input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox">
      <a href="javascript:listTable.sort('forum_id'); ">{$lang.record_id}</a> {$sort_forum_id}</th>
    <th>{$lang.forum_title}</th>
    <th>{$lang.reply_view}</th>
    <th><a href="javascript:listTable.sort('add_time'); ">{$lang.forum_time}</a>{$sort_add_time}</th>
    <th>{$lang.forum_name}</th>
    <th>{$lang.forum_class}</th>
    <th><a href="javascript:listTable.sort('user_name'); ">{$lang.user_name}</a>{$sort_user_name}</th>
     <th><a href="javascript:listTable.sort('forum_sort'); ">{$lang.forum_sort}</a></th>
    <th>{$lang.forum_flag}</th>
    <th>{$lang.handler}</th>
  </tr>
  {foreach from=$forum_list item=forum}
  <tr>
    <td width="65"><input value="{$forum.forum_id}" name="checkboxes[]" type="checkbox">{$forum.forum_id}</td>
   <td align="center" width="120">{$forum.forum_title}</td>
   <td align="center" width="120">{$forum.replay_num}/{$forum.click_num}</td>
    <td align="center" width="120">{$forum.add_time}</td>
    <td align="center" width="120">{if $forum.city_id eq '0'}{$lang.forum_public}{else}{$forum.city_name}{/if}</td>
    <td align="center" width="120">{$forum.class_name|default:$lang.forum_public}</td>
    <td width="100" align="center">{if $forum.user_name}{$forum.user_name}{else}{$lang.anonymous}{/if}</td>
    <td width="100" align="center"><span onclick="listTable.edit(this, 'edit_sort_order', {$forum.forum_id})">{$forum.forum_sort}</span></td>
    <td align="center" width="40" style="color:#3A6EA5;">    <img src="images/{if $forum.forum_status}yes{else}no{/if}.gif" onclick="listTable.toggle(this, 'set_show', {$forum.forum_id})" />
</td>

    <td align="center" width="50">

      <a href="forum_manage.php?act=reply&amp;id={$forum.forum_id}">{$lang.view_content}</a><br />

      <a href="javascript:" onclick="listTable.remove({$forum.forum_id}, '{$lang.drop_confirm}')">{$lang.remove}</a>

    </td>

  </tr>

    {foreachelse}

    <tr><td class="no-records" colspan="10">{$lang.no_records}</td></tr>

    {/foreach}

  </table>

  <table cellpadding="4" cellspacing="0">

    <tr>

      <td>

      <div>

      <select name="sel_action">

        <option value="remove">{$lang.drop_select}</option>

        <option value="allow">{$lang.allow}</option>

        <option value="deny">{$lang.forbid}</option>

      </select>

      <input type="hidden" name="act" value="batch" />

      <input type="submit" name="drop" id="btnSubmit" value="{$lang.button_submit}" class="button" disabled="true" /></div></td>

      <td align="right">{include file="page.htm"}</td>

    </tr>

  </table>

{if $full_page}

</div>

<!-- end forum list -->

</form>

<script type="text/javascript" language="JavaScript">
<!--
  listTable.recordCount = {$record_count};
  listTable.pageCount = {$page_count};
  cfm = new Object();
  cfm['allow'] = '{$lang.cfm_allow}';
  cfm['remove'] = '{$lang.cfm_remove}';
  cfm['deny'] = '{$lang.cfm_deny}';
  {foreach from=$filter item=item key=key}
  listTable.filter.{$key} = '{$item}';
  {/foreach}
  {literal}
  onload = function()
  {
      document.forms['searchForm'].elements['keyword'].focus();
      // 开始检查订单
      startCheckOrder();
  }
  /**
   * 搜索
   */
  function searchforum()
  {
      listTable.filter['keywords'] = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
	  listTable.filter['cid'] = document.forms['searchForm'].elements['cid'].value;
      listTable.filter['city_id'] = document.forms['searchForm'].elements['city_id'].value;
	  listTable.filter['forum_type'] = document.forms['searchForm'].elements['forum_type'].value;

      listTable.filter.page = 1;
      listTable.loadList();
  }
  {/literal}
  function confirm_bath()
  {
    var action = document.forms['listForm'].elements['sel_action'].value;
    return confirm(cfm[action]);
  }
  function change_forum(is_city)
  {
    if(is_city == true)
	{  
      document.forms['searchForm'].elements['cid'].value = -1;
	}
	else
	{
	  document.forms['searchForm'].elements['city_id'].value = -1;
	}
  }
//-->
</script>

{include file="pagefooter.htm"}

{/if}