{if $full_page}
<!-- $Id: users_list.htm 17053 2010-03-15 06:50:26Z sxc_shop $ -->
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}
<div class="form-div">
  <form action="javascript:searchUser()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
	&nbsp;狀態 <select name="status">
    <option value="-1">{$lang.select_all}</option>
    <option value="0">上架</option>
    <option value="1">下架</option>
    </select>
	&nbsp;{$lang.label_user_name} &nbsp;<input type="text" name="keyword" placeholder="會員帳號/名稱/電話"/>
	  <input type="submit" value="{$lang.button_search}" />
  </form>
</div>

<form method="POST" action="" name="listForm" onsubmit="return confirm_bath()">

<!-- start users list -->
<div class="list-div" id="listDiv">
{/if}
<!--用户列表部分-->
<table cellpadding="3" cellspacing="1">
  <tr>
    <th>
<!--      <input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox"> -->
      <a href="javascript:listTable.sort('user_id'); ">{$lang.record_id}</a>{$sort_user_id}
    </th>
    <th><a href="javascript:listTable.sort('user_name'); ">{$lang.username}</a>{$sort_user_name}</th>
    <th>名稱</th>
    <th>電話</th>
    <th>Email</th>
<!--		<th>地址</th>-->
    <th><a href="javascript:listTable.sort('reg_time'); ">建立日期</a>{$sort_reg_time}</th>
    <th><a href="javascript:listTable.sort('last_time'); ">更新日期</a>{$sort_last_time}</th>
		<th>是否上架</th>
		<th>{$lang.handler}</th>
  <tr>
  {foreach from=$user_list item=user}
  <tr>
    <td>
    	<!--<input type="checkbox" name="checkboxes[]" value="{$user.user_id}" notice="{if $user.user_money ne 0}1{else}0{/if}"/>-->
    	{$user.user_id}</td>
    <td class="first-cell">
					<span style="margin-bottom: 2px; line-height: 14px; display: block;">{$user.user_name|escape}</span>
						<!-- {if $user.rank_name != null} -->
						<!-- {if $user.is_special == 0} -->
						<span style="border: 1px #6DD26A solid; background-color: #6DD26A; padding: 1px 2px 0px 2px; color: white; display: inline; border-radius: 2px;"> {$user.rank_name} </span>
						<!-- {else} -->
						<span style="border: 1px #FBB24E solid; background-color: #FBB24E; padding: 1px 2px 0px 2px; color: white; display: inline; border-radius: 2px;"> {$user.name} </span>
						<!-- {/if} -->
						<!-- {/if} -->
					<!-- {if $user.enable eq 1} -->
						&nbsp;&nbsp;<span style="border: 1px #d6bd07 solid; background-color: #d6bd07; padding: 1px 2px 0px 2px; color: white; display: inline; border-radius: 2px;"> {$lang.enable_value_1} </span>
					<!-- {elseif $user.enable eq 2} -->
						&nbsp;&nbsp;<span style="border: 1px #fd6017 solid; background-color: #fd6017; padding: 1px 2px 0px 2px; color: white; display: inline; border-radius: 2px;"> {$lang.enable_value_2} </span>
					<!-- {elseif $user.enable eq 3} -->						
						&nbsp;&nbsp;<span style="border: 1px #b53c04 solid; background-color: #b53c04; padding: 1px 2px 0px 2px; color: white; display: inline; border-radius: 2px;"> {$lang.enable_value_3} </span>
					<!-- {/if} -->

    </td>
    <td>{$user.name}</td>
    <td>{$user.tel}</td>
    <td>{$user.email}</td>
<!--    <td>{$user.address}</td>-->
	<td align="center">{$user.reg_time}</td>
	<td align="center">{$user.last_time}</td>
	<td align="center">
		<img src="images/{if $user.status eq '0'}yes{else}no{/if}.gif" onclick="listTable.toggle(this, 'toggle_status', {$user.id})" />
		</td>
		<td align="center">
	 {if $user.web}		
      <a href="http://{$user.web}" target="_blank" title="網站前台">
      	網站前台
      </a>
	  {/if}
      <a href="users.php?act=user_ad&id={$user.user_id}" title="{$lang.view}">
      	廣告
      </a>
      <a href="../back/privilege.php?act=rsignin&uid={$user.user_id}" target="_blank" title="網站後台">
      	網站後台
      </a>
      <a href="users.php?act=edit&id={$user.user_id}" title="{$lang.edit}">
      	編輯
      </a>
      <a href="javascript:confirm_redirect('{if $user.user_money ne 0}{$lang.still_accounts}{/if}{$lang.remove_confirm}', 'users.php?act=remove&id={$user.user_id}')" title="{$lang.remove}">
      	刪除
      </a>
	</td>
  </tr>
  {foreachelse}
  <tr><td class="no-records" colspan="14">{$lang.no_records}</td></tr>
  {/foreach}
  <tr>
      <td align="right" nowrap="true" colspan="15">
      {include file="page.htm"}
      </td>
  </tr>
</table>

{if $full_page}
</div>
<!-- end users list -->
</form>
<script type="text/javascript" language="JavaScript">
<!--
listTable.recordCount = {$record_count};
listTable.pageCount = {$page_count};

{foreach from=$filter item=item key=key}
listTable.filter.{$key} = '{$item}';
{/foreach}

{literal}
onload = function()
{
    document.forms['searchForm'].elements['keyword'].focus();
    // 开始检查订单
}

/**
 * 搜索用户
 */
function searchUser()
{
    listTable.filter['keywords'] = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
    listTable.filter['status'] = document.forms['searchForm'].elements['status'].value;;
    listTable.filter['page'] = 1;
    listTable.loadList();
}

function confirm_bath()
{
  userItems = document.getElementsByName('checkboxes[]');

  cfm = '{$lang.list_remove_confirm}';

  for (i=0; userItems[i]; i++)
  {
    if (userItems[i].checked && userItems[i].notice == 1)
    {
      cfm = '{$lang.list_still_accounts}' + '{$lang.list_remove_confirm}';
      break;
    }
  }

  return confirm(cfm);
}
//-->
</script>
{/literal}
{include file="pagefooter.htm"}
{/if}