stat_memberscale.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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}"
  39. {$search_arr.week.current_week==$v['key'] ? 'selected' :''}>{$v.val}</option>
  40. {/foreach}
  41. </select>
  42. </dd>
  43. <dd id="searchtype_month" style="display:none;">
  44. <select name="searchmonth_year" class="querySelect">
  45. {foreach name="year_arr" item="v"}
  46. <option value="{$key}" {$search_arr.month.current_year== $key?'selected':''}>{$v}</option>
  47. {/foreach}
  48. </select>
  49. <select name="searchmonth_month" class="querySelect">
  50. {foreach name="month_arr" item="v"}
  51. <option value="{$key}" {$search_arr.month.current_month== $key?'selected':''}>{$v}</option>
  52. {/foreach}
  53. </select>
  54. </dd>
  55. </dl>
  56. <dl>
  57. <dt>{$Think.lang.ds_member_name}</dt>
  58. <dd><input type="text" name="membername" value="{$Request.param.membername}"/></dd>
  59. </dl>
  60. <div class="btn_group">
  61. <input type='hidden' name='exporttype' id='exporttype'>
  62. <a href="javascript:void(0);" id="dssubmit" class="btn" title="{$Think.lang.ds_query}">{$Think.lang.ds_query}</a>
  63. <a href="{:url('Statmember/scale')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
  64. </div>
  65. </div>
  66. </form>
  67. <div class="explanation" id="explanation">
  68. <div class="title" id="checkZoom">
  69. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  70. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  71. </div>
  72. <ul>
  73. <li>{$Think.lang.stat_validorder_explain}</li>
  74. <li>{$Think.lang.statstore_stat_memberscale_help1}</li>
  75. <li>{$Think.lang.statstore_stat_memberscale_help2}</li>
  76. </ul>
  77. </div>
  78. <div class="w100pre close_float" style="text-align:right;">
  79. <a class="btn btn-mini" href="javascript:void(0);" id="export_btn">{$Think.lang.ds_export}Excel</a>
  80. </div>
  81. <table class="ds-default-table">
  82. <thead>
  83. <tr class="thead sortbar-array">
  84. <th class="align-center">{$Think.lang.ds_member_name}</th>
  85. <th class="align-center">
  86. <a ds_type="orderitem" data-param='{"orderby":"orderamount"}' class="{!$orderby || $orderby == 'orderamount desc' ? 'selected desc' :''}{$orderby == 'orderamount asc' ? 'selected asc' :''}">{$Think.lang.statstore_orderamount}
  87. <i></i>
  88. </a>
  89. </th>
  90. <th class="align-center">
  91. <a ds_type="orderitem" data-param='{"orderby":"predincrease"}' class="{$orderby == 'predincrease desc'?'selected desc':''}{$orderby == 'predincrease asc'?'selected asc':''}">{$Think.lang.predincrease}
  92. <i></i>
  93. </a>
  94. </th>
  95. <th class="align-center">
  96. <a ds_type="orderitem" data-param='{"orderby":"predreduce"}' class="{$orderby == 'predreduce desc' ?'selected desc':''}{$orderby == 'predreduce asc' ?'selected asc':''}">{$Think.lang.predreduce}
  97. <i></i>
  98. </a>
  99. </th>
  100. <th class="align-center">
  101. <a ds_type="orderitem" data-param='{"orderby":"pointsincrease"}' class="{$orderby == 'pointsincrease desc' ?'selected desc':''}{$orderby == 'pointsincrease asc' ?'selected asc':''}">{$Think.lang.pointsincrease}
  102. <i></i>
  103. </a>
  104. </th>
  105. <th class="align-center">
  106. <a ds_type="orderitem" data-param='{"orderby":"pointsreduce"}' class="{$orderby == 'pointsreduce desc' ?'selected desc':''}{$orderby == 'pointsreduce asc' ?'selected asc':''}">{$Think.lang.pointsreduce}
  107. <i></i>
  108. </a>
  109. </th>
  110. </tr>
  111. </thead>
  112. <tbody id="datatable">
  113. {notempty name="statlist"}
  114. {foreach name="statlist" item="v"}
  115. <tr class="hover">
  116. <td class="align-center">{$v.statm_membername}</td>
  117. <td class="align-center">{$v.orderamount}</td>
  118. <td class="align-center">{$v.predincrease}</td>
  119. <td class="align-center">{$v.predreduce}</td>
  120. <td class="align-center">{$v.pointsincrease}</td>
  121. <td class="align-center">{$v.pointsreduce}</td>
  122. </tr>
  123. {/foreach}
  124. {else /}
  125. <tr class="no_data">
  126. <td colspan="11">{$Think.lang.no_record}</td>
  127. </tr>
  128. {/notempty}
  129. </tbody>
  130. </table>
  131. {$show_page|raw}
  132. </div>
  133. <script>
  134. //展示搜索时间框
  135. function show_searchtime(){
  136. s_type = $("#search_type").val();
  137. $("[id^='searchtype_']").hide();
  138. $("#searchtype_"+s_type).show();
  139. }
  140. $(function () {
  141. //统计数据类型
  142. var s_type = $("#search_type").val();
  143. $('#search_time').datepicker({dateFormat: 'yy-mm-dd'});
  144. show_searchtime();
  145. $("#search_type").change(function(){
  146. show_searchtime();
  147. });
  148. //更新周数组
  149. $("[name='searchweek_month']").change(function(){
  150. var year = $("[name='searchweek_year']").val();
  151. var month = $("[name='searchweek_month']").val();
  152. $("[name='searchweek_week']").html('');
  153. $.getJSON(ADMINSITEURL+'/Common/getweekofmonth',{y:year,m:month},function(data){
  154. if(data != null){
  155. for(var i = 0; i < data.length; i++) {
  156. $("[name='searchweek_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
  157. }
  158. }
  159. });
  160. });
  161. $('#dssubmit').click(function(){
  162. $("#exporttype").val('');
  163. $("#orderby").val('');
  164. $('#formSearch').submit();
  165. });
  166. //导出图表
  167. $("#export_btn").click(function(){
  168. $("#exporttype").val('excel');
  169. $('#formSearch').submit();
  170. });
  171. $("[ds_type='orderitem']").click(function(){
  172. $("#exporttype").val('');
  173. var data_str = $(this).attr('data-param');
  174. eval( "data_str = "+data_str);
  175. if($(this).hasClass('desc')){
  176. $("#orderby").val(data_str.orderby + ' asc');
  177. } else {
  178. $("#orderby").val(data_str.orderby + ' desc');
  179. }
  180. $('#formSearch').submit();
  181. });
  182. });
  183. </script>