<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<tpl>$nc_charset</tpl>" />
<title><tpl> $admin_header_provider_manage </tpl> - <tpl> $admin_provider_list </tpl><!-- 供应商管理 - 供应商列表 --></title>
<link type="text/css" rel="stylesheet" href="<tpl>$Site_Url</tpl>/admin/templates/css/toolbox.css" />
<link type="text/css" rel="stylesheet" href="<tpl>$Site_Url</tpl>/admin/templates/css/main.css" />
<script type="text/javascript" src="<tpl>$Site_Url</tpl>/js/jquery/jquery.js"></script>
<script type="text/javascript" src="<tpl>$Site_Url</tpl>/admin/templates/global.js"></script>
</head>

<body>
<div id="content">
	<h2><tpl> $admin_header_provider_manage </tpl><!-- 供应商管理 --> >> <tpl> $admin_provider_list </tpl><!-- 供应商列表 -->
    	<span class="alignRight"><a href="admin_provider.php?action=add_provider" target="_self">{<tpl> $admin_provider_add </tpl><!-- 添加供应商 -->}</a></span>    
    </h2>
    <div class="entry-body" id="p-list-div">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" id="pListTab" class="stripeMe">
          <tr>
            <td colspan="7" class="searchbar">
            	<div class="alignRight">
                	<form id="provider_search" name="provider_search" method="get">
							<input type="hidden" name="action" value="provider_list" />
                          <input type="text" name="provider_keywords" id="provider_keywords" value="<tpl>$smarty.get.provider_keywords</tpl>" />
                          <input type="submit" name="button" id="button" value="<tpl> $admin_provider_list_search </tpl>" class="btnInput" /><!-- 提交 -->
                    </form>
                </div>
      <form id="form1" name="form1" method="post" action="admin_provider.php">
	  <input type="hidden" name="action" value="del_provider" />
              <input type="submit" value="<tpl> $admin_provider_list_del </tpl>" class="delBtnInput" /><!-- 删除 -->
            </td>
          </tr>
          <tr>
            <th><label>
            <input type="checkbox" name="all" id="all" />
            </label></th>
            <th><tpl> $admin_provider_list_id </tpl><!-- 供应商帐号 --></th>
            <th><tpl> $admin_provider_list_name </tpl><!-- 供应商名称 --></th>
            <th><tpl> $admin_provider_list_email </tpl><!-- 电子邮箱 --></th>
            <th><tpl> $admin_provider_list_state </tpl><!-- 供应商状态 --></th>
            <th><tpl> $admin_provider_list_time </tpl><!-- 发布时间 --></th>
            <th><tpl> $admin_provider_list_oper </tpl><!-- 操作 --></th>
          </tr>
		  <tpl> section name=i loop=$provider_array </tpl>
          <tr>
            <td><label>
              <input type="checkbox" name="pid[]" id="pid[]" value="<tpl> $provider_array[i].provider_id </tpl>" class="cb" />
            </label></td>
            <td><tpl> $provider_array[i].provider_name </tpl><!-- 供应商帐号 --></td>
            <td><tpl> $provider_array[i].provider_pname </tpl><!-- 供应商名称 --></td>
            <td><tpl> $provider_array[i].provider_email </tpl><!-- 电子邮件 --></td>
            <td>
			<span id="state_<tpl> $provider_array[i].provider_id</tpl>"><a onclick="nc_state_update('<tpl> $provider_array[i].provider_id</tpl>','provider_state','<tpl> $provider_array[i].provider_state </tpl>','state_<tpl> $provider_array[i].provider_id</tpl>');"><img src="<tpl>$Site_Url</tpl>/admin/templates/images/icon_<tpl>if $provider_array[i].provider_state == 1 </tpl>1<tpl>else</tpl>0<tpl>/if</tpl>.gif" alt="<tpl>$admin_provider_list_edit_state</tpl>" /></a></span></td>
            <td><tpl>$provider_array[i].provider_time|date_format:"%Y-%m-%d %H:%M:%S"</tpl><!-- 时间 --></td>
            <td>
            	<a href="admin_provider.php?action=add_provider&provider_id=<tpl> $provider_array[i].provider_id </tpl>"><img src="<tpl>$Site_Url</tpl>/admin/templates/images/icon_edit.gif" title="<tpl> $admin_provider_list_edit </tpl>" alt="<tpl> $admin_provider_list_edit </tpl>" /><!-- 编辑 --></a> 
                <a href="admin_provider.php?action=del_provider&pid=<tpl> $provider_array[i].provider_id </tpl>" onclick="return confirm('<tpl>$admin_provider_list_del_conf</tpl>');"><img src="<tpl>$Site_Url</tpl>/admin/templates/images/icon_cancel.gif" title="<tpl> $admin_provider_list_del </tpl>" alt="<tpl> $admin_provider_list_del </tpl>" /><!-- 删除 --></a></td>
          </tr>
		  <tpl> /section </tpl>
          <tr>
            <td colspan="7" class="searchbar">
              <input type="submit" value="<tpl> $admin_provider_list_del </tpl>" class="delBtnInput" /><!-- 删除 -->
              <div class="pagebar"><tpl> $provider_page </tpl></div></td>
          </tr>
        </table>
      </form>
    </div>
    <!--  end of entry-body  -->
<tpl>include_php file ='admin_footer.php'</tpl><!-- 底部版权信息 -->
</div><!--  end of content  -->
<script language="javascript">
<!--
/* ajax修改状态 */
function nc_state_update(provider_id,ajax_type,old_state,id) {
	$.get('admin_provider.php',{'action':'provider_ajax','ajax_type':ajax_type,'old_state':old_state,'provider_id':provider_id,'css_id':id},function(data){
		$("#"+id).html(data);
	});
}
//-->
</script>
</body>
</html>
