index.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <include file="public@header"/>
  2. </head>
  3. <body>
  4. <div class="wrap js-check-wrap">
  5. <ul class="nav nav-tabs">
  6. <li class="active"><a href="javascript:;">茶室列表</a></li>
  7. <li><a href="{:url('add')}">添加茶室</a></li>
  8. </ul>
  9. <form class="well form-inline margin-top-20" method="post" action="{:url('AdminLock/index')}">
  10. 状态:
  11. <select class="form-control" name="is_show" style="width: 140px;">
  12. <option value=''>全部</option>
  13. <option value='1' <eq name="is_show" value="1">selected</eq>>显示</option>
  14. <option value='2' <eq name="is_show" value="2">selected</eq>>隐藏</option>
  15. </select> &nbsp;&nbsp;
  16. 关键字:
  17. <input type="text" class="form-control" name="keyword" style="width: 200px;"
  18. value="{$keyword|default=''}" placeholder="请输入关键字...">
  19. <input type="submit" class="btn btn-primary" value="搜索"/>
  20. <a class="btn btn-danger" href="{:url('AdminLock/index')}">清空</a>
  21. </form>
  22. <form class="js-ajax-form" action="" method="post">
  23. <table class="table table-hover table-bordered table-list">
  24. <thead>
  25. <tr>
  26. <th width="15">
  27. <label>
  28. <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
  29. </label>
  30. </th>
  31. <th width="50">ID</th>
  32. <th width="200">茶室名称</th>
  33. <th width="80">主图</th>
  34. <th width="50">锁ID</th>
  35. <th width="200">地址</th>
  36. <th width="120">状态</th>
  37. <th width="95">操作</th>
  38. </tr>
  39. </thead>
  40. <foreach name="list" item="vo">
  41. <tr>
  42. <td>
  43. <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids"
  44. value="{$vo.id}" title="ID:{$vo.id}">
  45. </td>
  46. <td><b>{$vo.id}</b></td>
  47. <td>{$vo.name}</td>
  48. <td>
  49. <notempty name="vo.image">
  50. <a href="javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($vo.image)}');">
  51. <i class="fa fa-photo fa-fw"></i>
  52. </a>
  53. <else/>
  54. <i class="fa fa-close fa-fw"></i>
  55. </notempty>
  56. </td>
  57. <td>{$vo.lock_id}</td>
  58. <td>{$vo.address}</td>
  59. <td>{$vo.is_show_text}</td>
  60. <td>
  61. <a class="btn btn-xs btn-primary" href="{:url('AdminLock/edit',array('id'=>$vo['id']))}">编辑</a>
  62. <a class="btn btn-xs btn-danger js-ajax-delete"
  63. href="{:url('AdminLock/delete',array('id'=>$vo['id']))}">删除</a>
  64. </td>
  65. </tr>
  66. </foreach>
  67. </table>
  68. <ul class="pagination">{$page|default=''}</ul>
  69. </form>
  70. </div>
  71. <script src="__STATIC__/js/admin.js"></script>
  72. <script>
  73. function reloadPage(win) {
  74. win.location.reload();
  75. }
  76. $('.set_status').click(function () {
  77. var status = $(this).data('status');
  78. var arr = [];
  79. $('input[name="ids"]:checked').each(function(i){
  80. arr[i] = $(this).val();
  81. });
  82. Wind.css('layer');
  83. Wind.use("layer", function () {
  84. if (arr.length === 0) {
  85. layer.msg('请选择一条记录');
  86. return false;
  87. }
  88. $.post('{:url("setStatus")}',{ids:arr,status:status},function(data){
  89. reloadPage(window);
  90. },'json')
  91. });
  92. return false;
  93. });
  94. </script>
  95. </body>
  96. </html>