select.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <include file="public@header"/>
  2. </head>
  3. <body>
  4. <div class="wrap js-check-wrap">
  5. <form class="well form-inline margin-top-20" method="post" action="{:url('AdminActivity/select')}">
  6. 关键字:
  7. <input type="text" class="form-control" name="keyword" style="width: 200px;display:inline;"
  8. value="{$keyword|default=''}" placeholder="请输入关键字...">
  9. <input type="submit" class="btn btn-primary" value="搜索"/>
  10. <a class="btn btn-danger" href="{:url('AdminActivity/select')}">清空</a>
  11. </form>
  12. <form method="post" class="js-ajax-form">
  13. <table class="table table-hover table-bordered table-list">
  14. <thead>
  15. <tr>
  16. <th width="16">
  17. </th>
  18. <th width="50">ID</th>
  19. <th>活动名称</th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. <foreach name="activity" item="vo">
  24. <tr>
  25. <td>
  26. <input type="radio" class="js-check" name="id" data-title="{$vo.title}" data-user_id="{$vo.user_id}" value="{$vo.id}">
  27. </td>
  28. <td>{$vo.id}</td>
  29. <td>{$vo.title}</td>
  30. </tr>
  31. </foreach>
  32. </tbody>
  33. </table>
  34. </form>
  35. </div>
  36. <script src="__STATIC__/js/admin.js"></script>
  37. <script>
  38. Wind.css('layer');
  39. $('.data-item-tr').click(function (e) {
  40. var $this = $(this);
  41. if ($(e.target).is('input')) {
  42. return;
  43. }
  44. var $input = $this.find('input');
  45. if ($input.is(':checked')) {
  46. $input.prop('checked', false);
  47. } else {
  48. $input.prop('checked', true);
  49. }
  50. });
  51. function confirm() {
  52. if ($('.js-check:checked').length == 0) {
  53. return false;
  54. } else {
  55. return {
  56. id: $('.js-check:checked').val(),
  57. title: $('.js-check:checked').data('title'),
  58. user_id: $('.js-check:checked').data('user_id'),
  59. };
  60. }
  61. }
  62. </script>
  63. </body>
  64. </html>