index.html 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. {extend name="default/base/base_seller" /}
  2. {block name="seller_main"}
  3. <div class="alert mt10" style="clear:both;">
  4. <ul class="mt5">
  5. <li>{$Think.lang.traffic_trends}</li>
  6. </ul>
  7. </div>
  8. <form method="get" target="_self">
  9. <table class="search-form">
  10. <tr>
  11. <td class="tr">
  12. <div class="fr">
  13. <input type="submit" class="submit" value="{$Think.lang.ds_common_search}" />
  14. </div>
  15. <div class="fr">
  16. <div class="fl" style="margin-right:3px;">
  17. <select name="search_type" id="search_type" class="querySelect">
  18. <option value="week" {$Request.param.search_type == 'week'?'selected':''}>{$Think.lang.with_week_statistics}</option>
  19. <option value="month" {$Request.param.search_type == 'month'?'selected':''}>{$Think.lang.with_monthly_statistics}</option>
  20. </select>
  21. </div>
  22. <div id="searchtype_week" style="display:none;" class="fl">
  23. <select name="searchweek_year" class="querySelect">
  24. {foreach name="year_arr" item="v"}
  25. <option value="{$key}" {$search_arr.week.current_year == $key ?'selected':''}>{$v}</option>
  26. {/foreach}
  27. </select>
  28. <select name="searchweek_month" class="querySelect">
  29. {foreach name="month_arr" item="v"}
  30. <option value="{$key}" {$search_arr.week.current_month ==$key ?'selected':''}>{$v}</option>
  31. {/foreach}
  32. </select>
  33. <select name="searchweek_week" class="querySelect">
  34. {foreach name="week_arr" item="v"}
  35. <option value="{$v.key}" {$search_arr.week.current_week == $v.key ?'selected':''}>{$v.val}</option>
  36. {/foreach}
  37. </select>
  38. </div>
  39. <div id="searchtype_month" style="display:none;" class="fl">
  40. <select name="searchmonth_year" class="querySelect">
  41. {foreach name="year_arr" item="v"}
  42. <option value="{$key}" {$search_arr.month.current_year == $key ?'selected':''}>{$v}</option>
  43. {/foreach}
  44. </select>
  45. <select name="searchmonth_month" class="querySelect">
  46. {foreach name="month_arr" item="v"}
  47. <option value="{$key}" {$search_arr.month.current_month == $key ?'selected':''}>{$v}</option>
  48. {/foreach}
  49. </select>
  50. </div>
  51. </div>
  52. </td>
  53. </tr>
  54. </table>
  55. </form>
  56. <div id="container"></div>
  57. <script src="{$Think.PLUGINS_SITE_ROOT}/highcharts/highcharts.js"></script>
  58. <script type="text/javascript">
  59. //展示搜索时间框
  60. function show_searchtime(){
  61. s_type = $("#search_type").val();
  62. $("[id^='searchtype_']").hide();
  63. $("#searchtype_"+s_type).show();
  64. }
  65. $(function(){
  66. //统计数据类型
  67. var s_type = $("#search_type").val();
  68. show_searchtime();
  69. $("#search_type").change(function(){
  70. show_searchtime();
  71. });
  72. //更新周数组
  73. $("[name='searchweek_month']").change(function(){
  74. var year = $("[name='searchweek_year']").val();
  75. var month = $("[name='searchweek_month']").val();
  76. $("[name='searchweek_week']").html('');
  77. $.getJSON(HOMESITEURL+'/Index/getweekofmonth.html',{y:year,m:month},function(data){
  78. if(data != null){
  79. for(var i = 0; i < data.length; i++) {
  80. $("[name='searchweek_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
  81. }
  82. }
  83. });
  84. });
  85. $('#container').highcharts({$stat_json|raw});
  86. });
  87. </script>
  88. {/block}