{:tpl head}
<table cellpadding="0" cellspacing="1" class="table_list">
 <caption>角色管理</caption>
  <tr>
   <td>
    <strong>管理选项：</strong>
    <a href="?c=role&a=add">增加角色</a> | <a href="?c=role">管理角色</a> | <a href="?c=role&a=member">会员列表</a>
   </td>
  </tr>
</table>
<!--{:if $a == 'add' || $a == 'edit'}-->
<table cellpadding="0" cellspacing="1" class="table_form">
 <caption>{:if $a == 'add'}增加{:else}修改{:/if}角色</caption>
 <form name="myform" action="?c=role&a={:$a}" method="post">
 <input type="hidden" name="info[roleid]" value="{:$data['roleid']}" />
 <input type="hidden" name="forward" value="{:$referer}" />
 <tr>
  <td align="right" width="30%">名称：</td>
  <td><input type="text" size="30" name="info[name]" value="{:$data['name']}" require="true" datatype="require" msg="角色名称不能为空"> <span class="fred">*</span></td>
 </tr>
 <tr>
  <td align="right">说明：</td>
  <td><textarea name="info[description]" rows="6" cols="40">{:$data['description']}</textarea></td>
 </tr>
 <tr>
  <td align="right">菜单显示校验：</td>
  <td>
   <input name="info[uncheck]" type="radio" value="0"{:Tag::checked($data['uncheck'],0)} />是
   <input name="info[uncheck]" type="radio" value="1"{:Tag::checked($data['uncheck'],1)} />否 
   <span class="fred">*设置为否，没有权限的菜单也会展示，但不能执行</span>
  </td>
 </tr>
 <tr>
  <td colspan="2" align="center"><button type="submit" name="submit">提交</button> <button type="button" onclick="history.back()">返回</button></td>
 </tr>
 </form>
</table>
<script type="text/javascript" src="../../statics/js/validator.js"></script>
<script type="text/javascript"> 		
$(function(){
	$('form').checkForm(1);
})
</script>
<!--{:elseif $a == 'defaults'}-->
<table cellpadding="0" cellspacing="1" class="table_list">
 <caption>管理角色</caption>
 <form name="myform" method="post">
 <input type="hidden" value='' name="selids" />
 <tr align="center">
  <th width="5%"><input name="checkbox" type="checkbox" onclick="checkorno(this,this.form.ids)" /></th>
  <th width="10%">名称</th>
  <th width="5%">ID</th>
  <th>说明</th>
  <th width="8%">人数</th>
  <th width="8%">排序</th>
  <th width="20%">操作</th>
 </tr>
 {:loop $data $v}
 <tr align="center">
  <td><input name="ids" type="checkbox" value="{:$v['roleid']}" /></td>
  <td>{:$v['name']}</a></td>
  <td>{:$v['roleid']}</td>
  <td align="left">{:$v['description']}</td>
  <td>{:$v['membernum']}</td>
  <td><input name="orderid[{:$v['roleid']}]" type="text" size="2" value="{:$v['orderid']}"></td>
  <td>
   <a href="?c=role&a=member&roleid={:$v['roleid']}">查看</a>&nbsp;|&nbsp;
   <a href="?c=role&a=edit&roleid={:$v['roleid']}">修改</a>&nbsp;|&nbsp;
   {:if $v['issystem']}
   <span class="fgray">删除</span>
   {:else}
   <a href="?c=role&a=del&roleid={:$v['roleid']}">删除</a>
   {:/if}
  </td>
 </tr>
 {:/loop}
 <tr>
  <td height="20" colspan="7" class="align_c">
   <button name="select1" onclick="selAll(this.form.ids)" type="button">全选</button>
   <button name="select2" onclick="noSelAll(this.form.ids)" type="button">反选</button>
   <button name="order" type="button" onClick="subform(this.form,this.form.ids,'?c=role&a=order','')">排序</button>
  </td>
 </tr>
 </form>
</table>
<!--{:elseif $a == 'member'}-->
<table cellpadding="0" cellspacing="1" class="table_list">
 <caption>会员列表</caption>
 <form name="myform" method="post">
 <input type="hidden" value='' name="selids" />
 <tr align="center">
  <th width="5%"><input name="checkbox" type="checkbox" onclick="checkorno(this,this.form.ids)" /></th>
  <th width="10%">用户名</th>
  <th width="20%">会员组</th>
  <th>角色</th>
  <th width="20%">操作</th>
 </tr>
 {:loop $data $v}
 <tr align="center">
  <td><input name="ids" type="checkbox" value="{:$v['roleid']}" /></td>
  <td>{:$v['username']}</a></td>
  <td>{:$ggroup[$v['groupid']]['name']}</td>
  <td>{:$grole[$v['roleid']]['name']}</td>
  <td>
   <a href="?c=member&a=view&userid={:$v['userid']}">查看</a>&nbsp;|&nbsp;
   <a href="?c=role&a=setrole&userid={:$v['userid']}">设置角色</a>&nbsp;|&nbsp;
   <a href="?c=role&a=delmember&roleid={:$v['roleid']}&userid={:$v['userid']}">删除</a>
  </td>
 </tr>
 {:/loop}
 <tr>
  <td height="20" colspan="7" class="align_c">
   <button name="select1" onclick="selAll(this.form.ids)" type="button">全选</button>
   <button name="select2" onclick="noSelAll(this.form.ids)" type="button">反选</button>
   <button name="order" type="button" onClick="subform(this.form,this.form.ids,'?c=role&a=order','')">排序</button>
  </td>
 </tr>
 </form>
</table>
<!--{:/if}-->
{:tpl foot}