人人商城

notice-category.html 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {template 'common/header'}
  2. {template 'article/common'}
  3. {if $do == 'category'}
  4. <div class="clearfix">
  5. <form action="{php echo url('article/notice/category');}" method="post" class="we7-form" role="form">
  6. <div class="form-group">
  7. <div class="pull-right">
  8. <a href="{php echo url('article/notice/category_post');}" class="btn btn-primary">添加分类</a>
  9. </div>
  10. </div>
  11. <table class="table we7-table table-hover">
  12. <col width="100px"/>
  13. <col />
  14. <col width="150px" />
  15. <tr>
  16. <th>排序</th>
  17. <th class="text-left">分类名称</th>
  18. <th class="text-right">操作</th>
  19. </tr>
  20. {loop $data $da}
  21. <input type="hidden" name="ids[]" value="{$da['id']}"/>
  22. <tr>
  23. <td><input type="text" name="displayorder[]" value="{$da['displayorder']}" class="form-control"/></td>
  24. <td><input type="text" name="title[]" value="{$da['title']}" class="form-control"/></td>
  25. <td>
  26. <div class="link-group"><a href="{php echo url('article/notice/category_del', array('id' => $da['id']));}" class="del" onclick="if(!confirm('删除分类后,该分类下公告也会被删除,确定删除吗?')) return false;">删除</a></div>
  27. </td>
  28. </tr>
  29. {/loop}
  30. </table>
  31. <div class="form-group">
  32. <div class="">
  33. <input type="submit" class="btn btn-primary we7-padding-horizontal" name="submit" value="提交" />
  34. <input type="hidden" name="token" value="{$_W['token']}" />
  35. </div>
  36. </div>
  37. </form>
  38. </div>
  39. {elseif $do == 'category_post'}
  40. <div class="clearfix">
  41. <form action="{php echo url('article/notice/category_post');}" method="post" class="we7-form" role="form">
  42. <div id="tpl">
  43. <div class="form-group">
  44. <label class="col-xs-12 col-sm-2 col-md-2 control-label">分类名称</label>
  45. <div class="col-sm-8 col-lg-9 col-xs-12">
  46. <input type="text" class="form-control" name="title[]" vlaue="" placeholder="分类名称"/>
  47. <div class="help-block">请填写分类名称</div>
  48. </div>
  49. </div>
  50. <div class="form-group">
  51. <label class="col-xs-12 col-sm-2 col-md-2 control-label">排序</label>
  52. <div class="col-sm-8 col-lg-9 col-xs-12">
  53. <input type="text" class="form-control" name="displayorder[]" vlaue="" placeholder="排序"/>
  54. <div class="help-block">数字越大,越靠前</div>
  55. </div>
  56. </div>
  57. <hr/>
  58. </div>
  59. <div id="container"></div>
  60. <div class="form-group">
  61. <label class="col-xs-12 col-sm-2 col-md-2 control-label"></label>
  62. <div class="col-sm-8 col-lg-9 col-xs-12">
  63. <a href="javascript:;" id="category-add"><i class="fa fa-plus-circle"></i> 继续添加分类</a>
  64. </div>
  65. </div>
  66. <div class="form-group">
  67. <div class="col-sm-8 col-lg-9 col-xs-12">
  68. <input type="submit" class="btn btn-primary" name="submit" value="提交" />
  69. <input type="hidden" name="token" value="{$_W['token']}" />
  70. </div>
  71. </div>
  72. </form>
  73. </div>
  74. {/if}
  75. <script>
  76. $(function(){
  77. $('#category-add').click(function(){
  78. var html = $('#tpl').html();
  79. $('#container').append(html);
  80. return false;
  81. });
  82. });
  83. </script>
  84. {template 'common/footer'}