You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
4.5 KiB

7 years ago
  1. <?=$this->site->add_js("https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.min.js")?>
  2. <?=$this->site->add_js("https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.bundle.min.js")?>
  3. <div class="page-header">
  4. <h1 class="page-title">DASHBOARD</h1>
  5. </div>
  6. <div class="row">
  7. <div class="col-sm-8">
  8. <h4 class="text-center">최근 방문자</h4>
  9. <canvas id="chart-recent"></canvas>
  10. </div>
  11. <script>
  12. $(function(){
  13. var chartData = <?=$month_data?>;
  14. var chartDataMobile = <?=$month_mobile?>;
  15. var chartLabel = <?=$month_label?>;
  16. var myBarChart = new Chart($('#chart-recent'), {
  17. type: 'bar',
  18. data: {
  19. labels: chartLabel,
  20. datasets: [{
  21. label : 'PC',
  22. backgroundColor : 'rgba(255,255,255,0.8)',
  23. data: chartData
  24. },{
  25. label : 'Mobile',
  26. backgroundColor : 'rgba(0,0,0,0.4)',
  27. data : chartDataMobile
  28. }]
  29. },
  30. options : {
  31. responsive : true,
  32. scales: {
  33. xAxes: [{
  34. stacked: true,
  35. ticks: {
  36. fontColor : '#fff'
  37. }
  38. }],
  39. yAxes : [{
  40. stacked:true,
  41. ticks: {
  42. fontColor : '#fff'
  43. }
  44. }]
  45. }
  46. }
  47. //options: options
  48. });
  49. });
  50. </script>
  51. <div class="col-sm-4">
  52. <div class="ax-button-group">
  53. <div class="left">
  54. <h4>최근 방문자 통계</h4>
  55. </div>
  56. </div>
  57. <div data-ax5grid>
  58. <table>
  59. <thead>
  60. <tr>
  61. <th>구분</th>
  62. <th>방문자</th>
  63. <th>PC</th>
  64. <th>Mobile</th>
  65. </tr>
  66. </thead>
  67. <tbody>
  68. <tr>
  69. <td class="text-center">TOTAL</td>
  70. <td class="text-right"><?=number_format($total_count['sumT'])?></td>
  71. <td class="text-right"><?=number_format($total_count['sumT'] - $total_count['sumM'])?></td>
  72. <td class="text-right"><?=number_format($total_count['sumM'])?></td>
  73. </tr>
  74. <tr>
  75. <td class="text-center">최근 30</td>
  76. <td class="text-right"><?=number_format($month_count['sumT'])?></td>
  77. <td class="text-right"><?=number_format($month_count['sumT'] - $month_count['sumM'])?></td>
  78. <td class="text-right"><?=number_format($month_count['sumM'])?></td>
  79. </tr>
  80. <tr>
  81. <td class="text-center">오늘</td>
  82. <td class="text-right"><?=number_format($today_count['sumT'])?></td>
  83. <td class="text-right"><?=number_format($today_count['sumT'] - $today_count['sumM'])?></td>
  84. <td class="text-right"><?=number_format($today_count['sumM'])?></td>
  85. </tr>
  86. </tbody>
  87. </table>
  88. </div>
  89. <div class="H30"></div>
  90. <div class="ax-button-group">
  91. <div class="left">
  92. <h4>회원 통계</h4>
  93. </div>
  94. </div>
  95. <div data-ax5grid>
  96. <table>
  97. <thead>
  98. <tr>
  99. <th>구분</th>
  100. <th>회원수</th>
  101. </tr>
  102. </thead>
  103. <tbody>
  104. <tr>
  105. <td class="text-center">TOTAL</td>
  106. <td class="text-right"><?=number_format($total_member)?></td>
  107. </tr>
  108. <tr>
  109. <td class="text-center">로그인 금지</td>
  110. <td class="text-right"><?=number_format($total_member_d)?></td>
  111. </tr>
  112. <tr>
  113. <td class="text-center">휴면</td>
  114. <td class="text-right"><?=number_format($total_member_h)?></td>
  115. </tr>
  116. </tbody>
  117. </table>
  118. </div>
  119. </div>
  120. </div>