人人商城

fields.html 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. {template 'common/header'}
  2. {template 'profile/common'}
  3. <ul class="nav nav-tabs">
  4. <li {if empty($id)}class="active"{/if}><a href="{url 'profile/fields'}">字段管理</a></li>
  5. {if !empty($id)}<li class="active"><a href="{php echo url ('profile/fields/post', array('id' => $id));}">编辑字段</a></li>{/if}
  6. </ul>
  7. {if $do == 'display'}
  8. <form action="" method="post">
  9. <div class="panel panel-default">
  10. <div class="panel-heading">
  11. 字段管理
  12. </div>
  13. <div class="panel-body table-responsive">
  14. <table class="table table-hover">
  15. <thead class="navbar-inner">
  16. <tr>
  17. <th>排序</th>
  18. <th>字段</th>
  19. <th>标题</th>
  20. <th>是否启用</th>
  21. <th>操作</th>
  22. </tr>
  23. </thead>
  24. <tbody>
  25. {loop $account_member_fields $field}
  26. <tr>
  27. <td>
  28. <input type="text" class="form-control" style="width: 50%;" name="displayorder[{$field['fieldid']}]" value="{$field['displayorder']}" />
  29. <input type="hidden" name="id[{$field['fieldid']}]" value="{$field['id']}" />
  30. <input type="hidden" name="fieldid[{$field['fieldid']}]" value="{$field['fieldid']}" />
  31. <input type="hidden" name="title[{$field['fieldid']}]" value="{$field['title']}" />
  32. </td>
  33. <td>{$field['field']}</td>
  34. <td>{$field['title']}</td>
  35. <td>
  36. <input type="checkbox" name="available[{$field['fieldid']}]" value="1" {if $field['available']} checked {/if} />
  37. </td>
  38. <td>
  39. {if !empty($field['id'])}
  40. <a href="{php echo url('profile/fields/post', array('id' => $field['id']))}" title="编辑" class="btn btn-primary btn-sm">编辑</a>
  41. {/if}
  42. </td>
  43. </tr>
  44. {/loop}
  45. <tr>
  46. <td></td>
  47. <td></td>
  48. <td></td>
  49. <td>
  50. <input type="checkbox" id="selectAll" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});">
  51. <a class="btn btn-success btn-sm" style="margin-left: -25px;" onclick="$('#selectAll').click();">全选</a>
  52. </td>
  53. <td></td>
  54. </tr>
  55. </tbody>
  56. </table>
  57. </div>
  58. </div>
  59. <div>
  60. <button type="submit" class="btn btn-primary col-lg-1" name="submit" value="提交">提交</button>
  61. <input type="hidden" name="token" value="{$_W['token']}" />
  62. </div>
  63. </div>
  64. </form>
  65. {elseif $do == 'post'}
  66. <div class="panel panel-default">
  67. <div class="panel-heading">
  68. 编辑字段
  69. </div>
  70. <div class="panel-body">
  71. <form class="form-horizontal form" action="" method="post">
  72. <input type="hidden" name="id" value="{$field['id']}">
  73. <div class="form-group">
  74. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">排序</label>
  75. <div class="col-sm-10 col-xs-12">
  76. <input type="text" class="form-control" name="displayorder" value="{$field['displayorder']}">
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">名称</label>
  81. <div class="col-sm-10 col-xs-12">
  82. <input type="text" class="form-control" name="title" value="{$field['title']}">
  83. </div>
  84. </div>
  85. <div class="form-group">
  86. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">启用</label>
  87. <div class="col-sm-10 col-xs-12">
  88. <label for="radio_1" class="radio-inline">
  89. <input type="radio" name="available" id="radio_1" value="1" {if empty($field) || $field['available'] == 1} checked{/if} /> 是
  90. </label>
  91. <label for="radio_0" class="radio-inline">
  92. <input type="radio" name="available" id="radio_0" value="0" {if !empty($field) && $field['available'] == 0} checked{/if} /> 否
  93. </label>
  94. </div>
  95. </div>
  96. <div class="form-group">
  97. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label"></label>
  98. <div class="col-sm-10 col-xs-12">
  99. <input type="submit" class="btn btn-primary" name="submit" />
  100. <input type="hidden" name="token" value="{$_W['token']}" />
  101. </div>
  102. </div>
  103. </form>
  104. </div>
  105. </div>
  106. {/if}
  107. {template 'common/footer'}