index.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-content">
  5. <div class="row">
  6. <div class="col-xs-12" style="text-align: right;">
  7. <form class="form-inline" id="form-search" action="{:url('index')}">
  8. <div class="input-group">
  9. <input type="text" class="form-control" name="real_name" placeholder="签到人">
  10. </div>
  11. <div class="input-group">
  12. <input class="form-control" id="start" readonly placeholder="开始时间" name="start" >
  13. </div>
  14. <div class="input-group">
  15. <input class="form-control" id="end" readonly placeholder="结束时间" name="end" >
  16. </div>
  17. <div class="input-group">
  18. <select name="addr" class="form-control">
  19. <option value="">选择位置</option>
  20. {foreach $address as $k=>$v}
  21. <option value="{$v['id']}">{$v['title']}</option>
  22. {/foreach}
  23. </select>
  24. </div>
  25. <div class="input-group">
  26. <span class="input-group-btn">
  27. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  28. </span> &nbsp;
  29. <span class="input-group-btn">
  30. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  31. </span>&nbsp;
  32. <span class="input-group-btn">
  33. <button data-url="{:url('export',[],'')}" title="导出" class="btn-sm btn-primary" onclick="excel_download(this)" type="button" ><i class="fa fa-cloud-download"></i></button>
  34. </span>
  35. </div>
  36. </form>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="ibox-content">
  41. <div class="jqGrid_wrapper">
  42. <table id="table" style="border-collapse: collapse"></table>
  43. <div id="pager"></div>
  44. </div>
  45. </div>
  46. </div>
  47. {/block}
  48. {block name="script"}
  49. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  50. <script>
  51. //导出
  52. function excel_download(_self){
  53. var url = $(_self).attr('data-url');
  54. var param = $('#form-search').serialize();
  55. window.location.href = url+'?'+param;
  56. }
  57. $(function () {
  58. laydate.render({
  59. elem: '#start',
  60. trigger: 'click' ,
  61. theme: '#284a94'
  62. });
  63. laydate.render({
  64. elem: '#end',
  65. trigger: 'click' ,
  66. theme: '#284a94'
  67. });
  68. $(window).bind("resize",function(){
  69. var width=$(".jqGrid_wrapper").width();
  70. $("#table").setGridWidth(width);
  71. });
  72. $.jgrid.defaults.styleUI="Bootstrap";
  73. $("#table").jqGrid({
  74. url:"{:url('index')}",
  75. datatype: "json",
  76. colModel:[
  77. {label:'ID',name:'id',index:'id', width:30,sortable: false},
  78. {label:'签到人',name:'real_name',index:'real_name',width:80,editable: false,sortable: false},
  79. {label:'位置',name:'address_title',index:'address_title',width:40,sortable: true},
  80. {label:'时间',name:'create_time',index:'create_time',width:40,sortable: true},
  81. ],
  82. rowNum:10,
  83. rowList:[10,20,30,50,100],
  84. pager: '#pager',
  85. sortname: 'id',
  86. viewrecords: true,
  87. autowidth:true,
  88. mtype: 'post',
  89. height: 'auto',
  90. emptyrecords: "暂无数据",
  91. sortorder: "desc",
  92. caption:"循环签到记录",
  93. loadComplete: function (xhr) {
  94. if(xhr.code==0){
  95. layer.msg(xhr.msg);
  96. return false;
  97. }
  98. },
  99. });
  100. });
  101. </script>
  102. {/block}