{:tpl head}
<table cellpadding="0" cellspacing="1" class="table_list">
 <caption>会员模型管理</caption>
  <tr>
   <td>
    <strong>管理选项：</strong>
    <a href="?c=member&a=model_add">安装会员模型</a> | <a href="?c=member&a=model">管理会员模型</a>
   </td>
  </tr>
</table>
<!--{:if $a == 'model_add' || $a == 'model_edit'}-->
<table cellpadding="0" cellspacing="1" class="table_form">
 <caption>{:if $a == 'model_add'}安装{:else}编辑{:/if}会员模型</caption>
 <form name="myform" action="?c=member&a={:$a}" method="post">
 <input type="hidden" name="info[id]" value="{:$data['id']}" />
 <input type="hidden" name="forward" value="{:$referer}" />
 <tr>
  <td width="20%" align="right">模型名称：</td>
  <td>
   <input name="info[name]" type="text" value="{:$data['name']}" size="20" maxlength="20" require="true" datatype="require" msg="名称不能为空" /> <span class="fred">*</span></td>
 </tr>
 <tr>
  <td width="20%" align="right">数据表名：</td>
  <td>{:C('DB_PREFIX',1)}member_
   <input name="info[tablename]" type="text" value="{:$data['tablename']}" size="8" maxlength="20"{:if $a == 'model_edit'} disabled="disabled"{:/if} require="true" datatype="require" msg="英文标识不能为空" /> <span class="fred">* 唯一</span><br />
   <span class="fblue">模型的安装(卸载)sql文件名与该设置一致，<br />存放在/member/Lib/Install(Uninstall)/目录下</span></td>
 </tr>
 <tr>
   <td align="right">简要说明：</td>
   <td>
     <textarea name="info[description]" cols="56" rows="5">{:$data['description']}</textarea>
   </td>
 </tr>
 <tr>
   <td align="right">状态：</td>
   <td>
     <input name="info[state]" type="radio" value="1"{:Tag::checked($data['state'],1)}>允许
     <input name="info[state]" type="radio" value="0"{:Tag::checked($data['state'],0)}>禁止
   </td>
 </tr>
 <tr>
   <td>&nbsp;</td><td>
     <button type="submit" name="submit" value="submit">提交</button>
     <button type="button" name="back" value="back" 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 == 'model'}-->
<form name="myform" method="post" action="">
<input type="hidden" name="selids" value="">
<table cellpadding="0" cellspacing="1" class="table_list">
 <caption>
 管理会员模型
 </caption>
 <tr align="center">
  <th width="5%"><input name="checkbox" type="checkbox" onclick="checkorno(this,this.form.ids)" /></th>
  <th width="5%">ID</th>
  <th width="15%">模型名称</th>
  <th width="15%">数据表名</th>
  <th width="20%">简要说明</th>
  <th width="10%">排序</th>
  <th width="10%">状态</th>
  <th>管理操作</th>
 </tr>
 {:loop $data $v}
 <tr align="center">
  <td><input name="ids" type="checkbox" value="{:$v['id']}"></td>
  <td>{:$v['id']}</td>
  <td>{:$v['name']}</td>
  <td>{:$v['tablename']}</td>
  <td>{:$v['description']}</td>
  <td><input name="orderid[{:$v['id']}]" type="text" size="2" value="{:$v['orderid']}"></td>
  <td>{:if $v['state']}<span class="fgreen">√</span>{:else}<span class="fred">×</span>{:/if}</td>
  <td><a href="?c=member&a=model_edit&id={:$v['id']}">编辑</a>&nbsp;|&nbsp;<a href="?c=member&a=model_del&id={:$v['id']}">删除</a>
  </td>
 </tr>
 {:/loop}
 <tr>
  <td height="20" colspan="8" align="center">
   <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=member&a=order','')">排序</button>
   <button name="reset" type="reset">重置</button>
  </td>
 </tr>
</table>
</form>
<!--{:/if}-->
{:tpl foot}