<?php if($vd['table']==0){ ?>
<?php widget("head");include($path_cache.DS."mod_b2b_Shared_head.php"); ?>
<body>
<div class="titleDiv" id="titleList">
<div style="float:left"><a href="index.php?a=Home"><img src="<?php echo $vd['sc']; ?>images/home.png" style="vertical-align:middle" border="0"/></a></div><div style="float:left;padding-top:8px;padding-left:3px;"><a href="index.php?a=Home" title="回到后台首页"><font color="#000">桌面</font></a> <span style="font-size:7px;">>></span> 管理员设置
<strong onmouseover="showhide(this);" onmouseout="showhide(this);" style="cursor:pointer">[?]</strong><p style="display:none">
    注意事项:<br/>
    如果不想修改密码的话，提交的时候留空即可  
  </p>
</div>
<div style="float:right"><a href="index.php?m=mod_home&a=Help&t=admin_b2b_master_index" onFocus="this.blur()" title="查看管理员相关帮助"><img src="<?php echo $vd['sc']; ?>images/help.gif" style="vertical-align:middle" border="0"/></a></div>
</div>
<div id="contentTip" style="display:none;"></div>
<div class="mytitle" id="mytitle">
  <div class="titleOp4" onmouseover="this.className='iconbg4'" onmouseout="this.className='titleOp4'" onclick="disp('adddiv')"><samp title="点击添加管理员">
    <div style="padding-top:10px;padding-left:9px;"><img src="<?php echo $vd['sc']; ?>images/add.gif" style="vertical-align:middle"/> 添加</div></samp>
  </div>  
  <div style="float:right;padding-top:4px;">
    
  </div>
</div>
<div id="adddiv" style="position:absolute;top:60px;left:50px;;width:320px;display:none">
  <div style="padding:20px;background:#F1F5FA;border:5px #75BCD7 solid">
  <div style="font-size:14px;font-weight:bold;padding:5px;float:left">添加管理员</div>
  <div style="float:right;"><img src="<?php echo $vd['sc']; ?>images/destroy.gif" onclick="disp('adddiv')" style="cursor:pointer"/></div>
  <form name="form1" method="post" action="index.php?m=mod_b2b&c=Master&a=Create" id="cform">
  <table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
      <td width="25%">管理员</td>
      <td width="75%"><input name="adminname" type="text" size="25"></td>
    </tr>
    <tr>
      <td width="25%">密码</td>
      <td width="75%"><input name="adminpass" type="password" size="25"></td>
    </tr>
    <tr>
      <td width="25%">角色</td>
      <td width="75%">
        <select size="1" name="adminrank">
          <?php if($vd['issuper']==1){ ?>
          <option value=2>系统管理员</option>
          <?php } ?>
          <option value=3>会员管理员</option>
          <option value=4>订单管理员</option>
          <option value=5>商品管理员</option>
          <option value=6>新闻管理员</option>
        </select>
      </td>
    </tr>
    <tr>
      <td width="25%"></td>
      <td width="75%">
        <input type="submit" name="Submit" value="添 加" class="button">
        <input type="button" name="Submit" value="取 消" onclick="disp('adddiv')" class="button"/>
      </td>
    </tr>
  </table>
  </form>
  </div>
</div>

<div id="menuMask" class="menuMask" style="display:none">
  <form action="?m=mod_b2b&c=Tpl&tpl=Sup&v=Sup" method="post" style="margin:0px">
  <div class="menuContent">
  <input type="checkbox" name="id[]" value="tid" id="tid" class="checkbox" onFocus='this.blur()'/> 商品编号<br/>
  <input type="checkbox" name="id[]" value="tordering" id="tordering" class="checkbox" onFocus='this.blur()'/> 商品名称<br/>
  <input type="checkbox" name="id[]" value="tpics" id="tpics" class="checkbox" onFocus='this.blur()'/> 供货商<br/>
  <input type="checkbox" name="id[]" value="tname" id="tname" class="checkbox" onFocus='this.blur()'/> 进货审核<br/>
  <input type="checkbox" name="id[]" value="tabst" id="tabst" class="checkbox" onFocus='this.blur()'/> 进货优先级<br/>
  <input type="checkbox" name="id[]" value="tfee" id="tfee" class="checkbox" onFocus='this.blur()'/> 进货价<br/>
  <input type="checkbox" name="id[]" value="tcode" id="tcode" class="checkbox" onFocus='this.blur()'/> 最低售价<br/>
  </div>
  <div class="menuOp">
  <input type="submit" value="保存" class="button" disabled />
  <input type="button" value="重置" class="button" disabled onclick="tInfoReset()"/>
  <input type="button" value="取消" class="button" onclick="setMenuMask()"/>
  </div>
  </form>
</div>
<div style="display:none">
  <form method="post" id="fakeform" action="index.php?m=mod_b2b&c=master&a=Update">
    <input type="hidden" id="tadminname" name="adminname"/>
    <input type="hidden" id="toldname"  name="oldname"/>
    <input type="hidden" id="sid" name="id"/>
    <input type="hidden" id="tadminpass" name="adminpass">
    <input type="hidden" id="tadminrank" name="adminrank">
  </form>
</div>
<table id="thead" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="30px">
      <input name="chkall" id="chkall" type="checkbox" class="checkbox" onclick="CheckAll(this)" onFocus='this.blur()' disabled /></td>
<?php //thead ?>
    <td width="35px">编号</td>
    <td width="165px">管理员</td>
    <td width="165px">密码</td>
    <td width="100px">角色</td>
    <td width="80px">修改</td>
    <td width="60px"><img src="<?php echo $vd['sc']; ?>images/icon_edit.gif" alt="设置权限" style="padding-right:3px">权限</td>
    <td width="60px"><img src="<?php echo $vd['sc']; ?>images/bind.gif" alt="绑定密保卡" style="padding-right:6px">绑定</td>
    <td width="60px"><img src="<?php echo $vd['sc']; ?>images/destroy.gif" alt="删除" style="padding-right:6px">删除</td>
<?php //endthead ?>
    <td class="endtd">
      <div class="infoicon" style="color:#ccc"><b><u>>></u></b></div>
    </td>
  </tr>
</table>
<div id="tip" style="display:none">
  <span id="tiptable">此页中所有 <b><span id="ncheck"><?php echo $vd['nrows'] < $vd['totlerow'] ? $vd['nrows'] : $vd['totlerow'] ?></span></b> 条记录已选中 </span> 
  <span id="tipspan">
    <a href="javascript:CheckTotle(<?php echo $vd['totlerow']; ?>,0)">点此选择当前列表中所有 <b><?php echo $vd['totlerow']; ?></b> 条记录>></a>
  </span>
</div>
<div id="content">
<?php } ?>
  <?php if($vd['totlerow'] == 0) { ?>
  <table  width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="right" colspan="20">无任何记录</td>
  </tr>
  </table>
  <?php } ?>
  <table id="tbody"  border="0" cellspacing="0" cellpadding="0">
  <?php foreach($vd['items'] as $item) { ?>
  <tr>
    <td width="30px">
      <input type="checkbox" name="id[]" id="idchk_<?php echo $item['id']; ?>" class="checkbox" value="<?php echo $item['id']; ?>" onclick="CheckThis(this)" onFocus='this.blur()'  disabled ></input>
    </td>
    <?php //tbody ?>
    <td width="35px"><?php echo $item['id']; ?></td>
    <td width="165px">
      <input name="adminname" id="adminname_<?php echo $item['id']; ?>" type="text" size="25" value="<?php echo $item['adminName']; ?>"/>
      <input type="hidden" name="oldname" id="oldname_<?php echo $item['id']; ?>" value="<?php echo $item['adminName']; ?>" />
      <input type="hidden" name="id" id="id_<?php echo $item['id']; ?>" value="<?php echo $item['id']; ?>" />
    </td>
    <td width="165px"><input name="adminpass" id="adminpass_<?php echo $item['id']; ?>" type="password" size="25"></td>
    <td width="100px">
      <?php if($item['adminRank']==1){ ?>
      <select size="1" name="adminrank" id="adminrank_<?php echo $item['id']; ?>">
        <option value="1">超级管理员</option>
      </select>
      <?php }else if($item['adminRank']==2){ ?>
      <select size="1" name="adminrank" id="adminrank_<?php echo $item['id']; ?>">
        <option value="2">系统管理员</option>
        <?php if($vd['issuper']==1){ ?>
        <option value=3 <?php if($item['adminRank'] == '3'){ ?> selected <?php } ?>>会员管理员</option>
        <option value=4 <?php if($item['adminRank'] == '4'){ ?> selected <?php } ?>>订单管理员</option>
        <option value=5 <?php if($item['adminRank'] == '5'){ ?> selected <?php } ?>>商品管理员</option>
        <option value=6 <?php if($item['adminRank'] == '6'){ ?> selected <?php } ?>>新闻管理员</option>
        <?php } ?>
      </select>
      <?php }else{ ?>
      <select size="1" name="adminrank" id="adminrank_<?php echo $item['id']; ?>">
        <?php if($vd['issuper']==1){ ?>
        <option value=2>系统管理员</option>
        <?php } ?>
        <option value=3 <?php if($item['adminRank'] == '3'){ ?> selected <?php } ?>>会员管理员</option>
        <option value=4 <?php if($item['adminRank'] == '4'){ ?> selected <?php } ?>>订单管理员</option>
        <option value=5 <?php if($item['adminRank'] == '5'){ ?> selected <?php } ?>>商品管理员</option>
        <option value=6 <?php if($item['adminRank'] == '6'){ ?> selected <?php } ?>>新闻管理员</option>
      </select>
      <?php } ?>
    </td>
    <td width="80px"><input type="button" name="Submit" value="修改" class="button" onclick="tofake('<?php echo $item['id']; ?>')">
    </td>
    <td width="60px">
      <?php if($item['adminRank'] > 1){ ?>
      -- 
      <?php }else{ ?>
      --
      <?php } ?>
    </td>
    <td width="60px">
      <a href="index.php?m=mod_b2b&c=Master&a=Bind&adminname=<?php echo $item['adminName']; ?>"><img src="<?php echo $vd['sc']; ?>images/bind.gif" alt="绑定密保卡"> 绑定</a> 
    </td>
    <td width="60px">
      <a href="index.php?m=mod_b2b&c=Master&a=Bind&adminname=<?php echo $item['adminName']; ?>"><img src="<?php echo $vd['sc']; ?>images/bind.gif" alt="绑定密保卡"> 绑定</a> 
    </td>
    <td width="60px">
      <?php if($item['adminRank'] > 1){ ?>
      <a href="index.php?m=mod_b2b&c=Master&a=Del&id=<?php echo $item['id']; ?>" onClick="return confirm('您确定要删除此管理员吗？')"><img src="<?php echo $vd['sc']; ?>images/destroy.gif" alt="删除"> <font color=red>删除</font></a> 
      <?php }else{ ?>
      --
      <?php } ?>
    </td>
    <?php //endtbody ?>
    <td class="endtd"></td>
  </tr>
  <?php } ?>
  
</table>
<input type="hidden" value="<?php echo $vd['totlepage']; ?>" id="totlePage"/>
<input type="hidden" value="<?php echo $vd['thispage']; ?>" id="thisPage"/>
<?php if($vd['table']==0){ ?>
</div>

<input type="hidden" value="index.php?m=mod_b2b&c=master&a=Deals&<?php echo $vd['op']; ?>" id="op"/>
<input type="hidden" value="index.php?m=mod_b2b&c=master&a=index&istable=1&<?php echo $vd['op']; ?>" id="url"/>
<input type="hidden" value="<?php echo $vd['op']; ?>" id="params"/>
<div style="position:absolute;bottom:0px">
  <div class="tbBottom" id="tbBottom">
    <div style="float:left;padding-top:8px;">
      <strong> 总计 <font color="#ff0000"><span id="tol2"><?php echo $vd['totlerow']; ?></span></font> 条</strong>
    </div>
    <div style="float:right;text-align:right;">
    <form id="actionform" method="post" action="index.php?m=mod_b2b&c=master&a=index&<?php echo $vd['op']; ?>" style="margin:0px;" onsubmit="loadDisp(1)">
    <div id="page"></div>
    <div style="float:left;margin-top:3px">
      每页显示<input type="text" name="nrows" size="2" value="<?php echo $vd['nrows']; ?>" class="pagetxt" onMouseOver="iEvent('mouseover',this)" onFocus="iEvent('focus',this)" onBlur="iEvent('blur',this)" onMouseOut="iEvent('mouseout',this)" /> 个 
      到第<input type="text" name="page" size="2" value="<?php echo $vd['thispage']; ?>" class="pagetxt" onMouseOver="iEvent('mouseover',this)" onFocus="iEvent('focus',this)" onBlur="iEvent('blur',this)" onMouseOut="iEvent('mouseout',this)" />页<input type="submit" value=" 确 定 &gt;&gt;" class="pagesub" />
    </div>
    </form>
    </div>
  </div>
</div>
<div id="load" style="display:none;">
  <div id="loadcontent" >页面加载中请稍等...</div>
</div>
</body>
<script type="text/javascript">
//第一参数，后边保留显示的列数
//第二参数，除最后一个参数外的保留参数的总宽度
tRows   = <?php echo $vd['nrows'] < $vd['totlerow'] ? $vd['nrows'] : $vd['totlerow'] ?>;
tInfoA  = Array(0,0);
totleRows = <?php echo $vd['totlerow']; ?>;
deltxt  = "销毁分类后,是无法恢复的,只能重新添加,您确定进行销毁操作吗？";
thisaction = "销毁";
thisdel = 0;
statistics = 0;
var resizeidx = 4;
</script>
<script type="text/javascript">
//当前表格配置
<?php //tinfo ?>
 tInfo = Array('tid','tordering','tpics','tname','tabst','tfee','tcode');
<?php //endtinfo ?>
function pickcolor(id) 
{
  var color = showModalDialog("<?php echo $vd['sc']; ?>tools/colorselect.htm", "", "font-family:Verdana; font-size:12; status:no; dialogWidth:21em; dialogHeight:21em");
  if (color != null) 
  {
    $("colorexample"+id).style.backgroundColor = color;
    $("textcolor"+id).value = color;
  }
}

</script>
<script src="<?php echo $vd['sc']; ?>js/tools.js" type="text/javascript"></script>
<script type="text/javascript">
function setct(val)
{
  $("cttr").style.display = val == 3 ? "" : "none";
}

function tofake(id)
{
  vararray = Array("adminname","oldname","adminpass");
  len = vararray.length;
  for(i=0; i<len; i++)
  {
    $("t"+vararray[i]).value = $(vararray[i]+"_"+id).value;
  }
  $("sid").value = id;
  $("tadminrank").value = $("adminrank_"+id).options[$("adminrank_"+id).selectedIndex].value;
  $("fakeform").submit();
}
</script>
</html>
<?php } ?>