index.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. <script src="{__PLUG_PATH}moment.js"></script>
  4. <link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
  5. <script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
  6. {/block}
  7. {block name="content"}
  8. <div class="row">
  9. <div class="col-sm-12">
  10. <div class="ibox">
  11. <div class="ibox-content">
  12. <div class="row">
  13. <div class="m-b m-l">
  14. <form action="" class="form-inline" id="form" method="get">
  15. <select name="admin_id" aria-controls="editable" class="form-control input-sm">
  16. <option value="">管理员名称</option>
  17. {volist name="$admin" id="vo"}
  18. <option value="{$vo.id}" {eq name="where.admin_id" value="$vo.id"}selected="selected"{/eq}>{$vo.real_name}</option>
  19. {/volist}
  20. </select>
  21. <div class="input-group datepicker">
  22. <input style="width: 188px;" type="text" id="data" class="input-sm form-control" name="data" value="{$where.data}" placeholder="请选择日期" >
  23. </div>
  24. <div class="input-group">
  25. <input type="text" name="pages" value="{$where.pages}" placeholder="请输入行为" class="input-sm form-control"> <span class="input-group-btn">
  26. </div>
  27. <div class="input-group">
  28. <input type="text" name="path" value="{$where.path}" placeholder="请输入链接" class="input-sm form-control"> <span class="input-group-btn">
  29. </div>
  30. <div class="input-group">
  31. <input type="text" name="ip" value="{$where.ip}" placeholder="请输入ip" class="input-sm form-control"> <span class="input-group-btn">
  32. <button type="submit" class="btn btn-sm btn-primary"><i class="fa fa-search" ></i> 搜索</button> </span>
  33. </div>
  34. </form>
  35. </div>
  36. </div>
  37. <div class="table-responsive">
  38. <table class="table table-striped table-bordered">
  39. <thead>
  40. <tr>
  41. <th class="text-center">编号</th>
  42. <th class="text-center">ID/名称</th>
  43. <th class="text-center">行为</th>
  44. <th class="text-center">链接</th>
  45. <th class="text-center">操作ip</th>
  46. <th class="text-center">类型</th>
  47. <th class="text-center">操作时间</th>
  48. </tr>
  49. </thead>
  50. <tbody class="">
  51. {volist name="list" id="vo"}
  52. <tr>
  53. <td class="text-center">
  54. {$vo.id}
  55. </td>
  56. <td class="text-center">
  57. {$vo.admin_id} / {$vo.admin_name}
  58. </td>
  59. <td class="text-center">
  60. {$vo.page}
  61. </td>
  62. <td class="text-center">
  63. {$vo.path}({$vo.method})
  64. </td>
  65. <td class="text-center">
  66. {$vo.ip}
  67. </td>
  68. <td class="text-center">
  69. {$vo.type}
  70. </td>
  71. <td class="text-center">
  72. {$vo.add_time|date="Y-m-d H:i:s"}
  73. </td>
  74. </tr>
  75. {/volist}
  76. </tbody>
  77. </table>
  78. </div>
  79. {include file="public/inner_page"}
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. {/block}
  85. {block name="script"}
  86. <script>
  87. var dateInput =$('.datepicker');
  88. dateInput.daterangepicker({
  89. autoUpdateInput: false,
  90. "opens": "center",
  91. "drops": "down",
  92. "ranges": {
  93. '今天': [moment(), moment().add(1, 'days')],
  94. '昨天': [moment().subtract(1, 'days'), moment()],
  95. '上周': [moment().subtract(6, 'days'), moment()],
  96. '前30天': [moment().subtract(29, 'days'), moment()],
  97. '本月': [moment().startOf('month'), moment().endOf('month')],
  98. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  99. },
  100. "locale" : {
  101. applyLabel : '确定',
  102. cancelLabel : '清空',
  103. fromLabel : '起始时间',
  104. toLabel : '结束时间',
  105. format : 'YYYY/MM/DD',
  106. customRangeLabel : '自定义',
  107. daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
  108. monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
  109. '七月', '八月', '九月', '十月', '十一月', '十二月' ],
  110. firstDay : 1
  111. }
  112. });
  113. dateInput.on('cancel.daterangepicker', function(ev, picker) {
  114. $("#data").val('');
  115. });
  116. dateInput.on('apply.daterangepicker', function(ev, picker) {
  117. $("#data").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
  118. });
  119. </script>
  120. {/block}