stat_newmember.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <div class="subject">
  6. <h3>{$Think.lang.ds_statmember}</h3>
  7. <h5></h5>
  8. </div>
  9. {include file="public/admin_items" /}
  10. </div>
  11. </div>
  12. <form method="get" action="" name="formSearch" id="formSearch">
  13. <div class="ds-search-form">
  14. <dl>
  15. <dd>
  16. <select name="search_type" id="search_type" class="querySelect">
  17. <option value="day" {if isset($search_arr.search_type) && $search_arr.search_type == 'day'}selected{/if}>{$Think.lang.search_type_day}</option>
  18. <option value="week" {if isset($search_arr.search_type) && $search_arr.search_type == 'week'}selected{/if}>{$Think.lang.search_type_week}</option>
  19. <option value="month" {if isset($search_arr.search_type) && $search_arr.search_type == 'month'}selected{/if}>{$Think.lang.search_type_month}</option>
  20. </select>
  21. </dd>
  22. <dd id="searchtype_day" style="display:none;">
  23. <input class="txt date" type="text" value="{:date('Y-m-d',$search_arr.day.search_time)}" id="search_time" name="search_time">
  24. </dd>
  25. <dd id="searchtype_week" style="display:none;">
  26. <select name="searchweek_year" class="querySelect">
  27. {foreach name="year_arr" item="v"}
  28. <option value="{$key}" {$search_arr.week.current_year == $key ? 'selected': ''}>{$v}</option>
  29. {/foreach}
  30. </select>
  31. <select name="searchweek_month" class="querySelect">
  32. {foreach name="month_arr" item="v"}
  33. <option value="{$key}" {$search_arr.week.current_month == $key ? 'selected':''}>{$v}</option>
  34. {/foreach}
  35. </select>
  36. <select name="searchweek_week" class="querySelect">
  37. {foreach name="week_arr" item="v"}
  38. <option value="{$v.key}" {$search_arr.week.current_week == $v['key'] ? 'selected' :''}>{$v.val}</option>
  39. {/foreach}
  40. </select>
  41. </dd>
  42. <dd id="searchtype_month" style="display:none;">
  43. <select name="searchmonth_year" class="querySelect">
  44. {foreach name="year_arr" item="v"}
  45. <option value="{$key}" {$search_arr.month.current_year == $key?'selected':''}>{$v}</option>
  46. {/foreach}
  47. </select>
  48. <select name="searchmonth_month" class="querySelect">
  49. {foreach name="month_arr" item="v"}
  50. <option value="{$key}" {$search_arr.month.current_month == $key?'selected':''}>{$v}</option>
  51. {/foreach}
  52. </select>
  53. </dd>
  54. </dl>
  55. <div class="btn_group">
  56. <a href="javascript:void(0);" id="dssubmit" class="btn" title="{$Think.lang.ds_query}">{$Think.lang.ds_query}</a>
  57. <a href="{:url('Statmember/newmember')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
  58. </div>
  59. </div>
  60. </form>
  61. <div class="explanation" id="explanation">
  62. <div class="title" id="checkZoom">
  63. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  64. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  65. </div>
  66. <ul>
  67. <li>{$Think.lang.statstore_stat_newmember_help1}</li>
  68. <li>{$Think.lang.statstore_stat_newmember_help2}</li>
  69. <li>{$Think.lang.statstore_stat_newmember_help3}</li>
  70. </ul>
  71. </div>
  72. <div id="container" class="w100pre close_float" style="height:400px"></div>
  73. <div style="text-align:right;">
  74. <input type="hidden" id="export_type" data-url="{:url(request()->controller().'/'.request()->action())}/exporttype/excel" name="export_type" data-param='{"url":"{$actionurl}&exporttype=excel"}' value="excel"/>
  75. <a class="btn btn-mini" href="javascript:void(0);" id="export_btn">{$Think.lang.ds_export}Excel</a>
  76. </div>
  77. <table class="ds-default-table">
  78. <thead>
  79. <tr class="thead">
  80. {foreach name="statlist.headertitle" item="v"}
  81. <th class="align-center">{$v}</th>
  82. {/foreach}
  83. <th class="align-center">{$Think.lang.ds_handle}</th>
  84. </tr>
  85. </thead>
  86. <tbody id="datatable">
  87. {notempty name="statlist.data"}
  88. {foreach name="statlist.data" item="v"}
  89. <tr class="hover">
  90. <td class="align-center">{$v.timetext}</td>
  91. <td class="align-center">{$v.updata}</td>
  92. <td class="align-center">{$v.currentdata}</td>
  93. <td class="align-center">{$v.tbrate}</td>
  94. <td class="align-center">
  95. <a href="{:url('Statmember/showmember',['type'=>'newbyday','t'=>$v.seartime])}>" class="dsui-btn-view"><i class="iconfont"></i>{$Think.lang.ds_view}</a>
  96. </td>
  97. </tr>
  98. {/foreach}
  99. <tr class="hover">
  100. <td class="align-center"><b>{$Think.lang.statstore_total}</b></td>
  101. <td class="align-center">{$count_arr.up}</td>
  102. <td class="align-center">{$count_arr.curr}</td>
  103. <td class="align-center">{$count_arr.tbrate}</td>
  104. <td class="align-center">
  105. <a href="{:url('Statmember/showmember',['type'=>'newbyday','t'=>$count_arr.seartime])}" class="dsui-btn-view"><i class="iconfont"></i>{$Think.lang.ds_view}</a>
  106. </td>
  107. </tr>
  108. {else /}
  109. <tr class="no_data">
  110. <td colspan="15">{$Think.lang.no_record}</td>
  111. </tr>
  112. {/notempty}
  113. </tbody>
  114. </table>
  115. </div>
  116. <script src="{$Think.PLUGINS_SITE_ROOT}/highcharts/highcharts.js"></script>
  117. <script src="{$Think.PLUGINS_SITE_ROOT}/statistics.js"></script>
  118. <script>
  119. //展示搜索时间框
  120. function show_searchtime(){
  121. s_type = $("#search_type").val();
  122. $("[id^='searchtype_']").hide();
  123. $("#searchtype_"+s_type).show();
  124. }
  125. $(function () {
  126. //统计数据类型
  127. var s_type = $("#search_type").val();
  128. $('#search_time').datepicker({dateFormat: 'yy-mm-dd'});
  129. show_searchtime();
  130. $("#search_type").change(function(){
  131. show_searchtime();
  132. });
  133. //更新周数组
  134. $("[name='searchweek_month']").change(function(){
  135. var year = $("[name='searchweek_year']").val();
  136. var month = $("[name='searchweek_month']").val();
  137. $("[name='searchweek_week']").html('');
  138. $.getJSON(ADMINSITEURL+'/Common/getweekofmonth',{y:year,m:month},function(data){
  139. if(data != null){
  140. for(var i = 0; i < data.length; i++) {
  141. $("[name='searchweek_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
  142. }
  143. }
  144. });
  145. });
  146. $('#container').highcharts({$stat_json|raw});
  147. $('#dssubmit').click(function(){
  148. $('#formSearch').submit();
  149. });
  150. //导出图表
  151. $("#export_btn").click(function(){
  152. var item = $("#export_type");
  153. var type = $(item).val();
  154. if(type == 'excel'){
  155. export_xls(item.attr('data-url').replace('.html',''));
  156. }
  157. });
  158. });
  159. </script>