index.blade.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. @extends('admin.layouts.app')
  2. @section('content')
  3. <div class="container">
  4. <h2>상황판</h2>
  5. <hr/>
  6. <div class="row justify-content-center">
  7. <div class="col-md-6">
  8. <h5>{{ date('m') }}월 방문자</h5>
  9. <div id="visitsChart"></div>
  10. <table class="table table-bordered">
  11. <caption>
  12. 단위:명
  13. </caption>
  14. <colgroup>
  15. <col width="20%"/>
  16. <col width="*"/>
  17. <col width="20%"/>
  18. <col width="*"/>
  19. </colgroup>
  20. <tr>
  21. <th>신규 방문자</th>
  22. <td>{{ $visitStats['totalCntNew'] }}</td>
  23. <th>오늘 방문자</th>
  24. <td>{{ $visitStats['visitorTodayCount'] }}</td>
  25. </tr>
  26. <tr>
  27. <th>재방문자</th>
  28. <td>{{ $visitStats['totalCntRe'] }}</td>
  29. <th>어제 방문자</th>
  30. <td>{{ $visitStats['visitorYesterdayCount'] }}</td>
  31. </tr>
  32. <tr>
  33. <th>오늘 방문자</th>
  34. <td>{{ $visitStats['totalCntTo'] }}</td>
  35. <th>전체 방문자</th>
  36. <td>{{ $visitStats['visitorTotalCount'] }}</td>
  37. </tr>
  38. </table>
  39. </div>
  40. <div class="col-md-6">
  41. <h5>회원가입</h5>
  42. <div id="usersChart"></div>
  43. <table class="table table-bordered">
  44. <caption>
  45. 단위:명
  46. </caption>
  47. <colgroup>
  48. <col width="20%"/>
  49. <col width="*"/>
  50. <col width="20%"/>
  51. <col width="*"/>
  52. </colgroup>
  53. <tr>
  54. <th>오늘 가입자</th>
  55. <td>{{ $userStats['todayCount'] }}</td>
  56. <th>주간 가입자 수</th>
  57. <td>{{ $userStats['weeklyUserCount'] }}</td>
  58. </tr>
  59. <tr>
  60. <th>월간 가입자 수</th>
  61. <td>{{ $userStats['monthlyUserCount'] }}</td>
  62. <th>전체 가입자 수</th>
  63. <td>{{ $userStats['totalUserCount'] }}</td>
  64. </tr>
  65. </table>
  66. </div>
  67. </div>
  68. </div>
  69. @endsection
  70. @push('styles')
  71. <link rel="stylesheet" href="/plugin/c3-0.7.20/c3.min.css"/>
  72. @endpush
  73. @push('scripts')
  74. <script src="/plugin/c3-0.7.20/docs/js/d3-5.8.2.min.js"></script>
  75. <script src="/plugin/c3-0.7.20/c3.min.js"></script>
  76. <script>
  77. let chart_1 = c3.generate({
  78. bindto: "#visitsChart",
  79. data: {
  80. x: 'x',
  81. columns: [
  82. ['x', {!! $visitStats['dates'] !!}],
  83. ["신규", {!! $visitStats['cntNews'] !!}],
  84. ["재방문", {!! $visitStats['cntRes'] !!}],
  85. ["합계", {!! $visitStats['cntTots'] !!}],
  86. ]
  87. },
  88. axis: {
  89. x: {
  90. type: "timeseries",
  91. tick: {
  92. format: "%m-%d"
  93. }
  94. }
  95. }
  96. });
  97. let chart_2 = c3.generate({
  98. bindto: "#usersChart",
  99. data: {
  100. x: 'x',
  101. columns: [
  102. ['x', {!! $userStats['dates'] !!}],
  103. ["신규", {!! $userStats['cntNews'] !!}],
  104. ]
  105. },
  106. axis: {
  107. x: {
  108. type: "timeseries",
  109. tick: {
  110. format: "%m-%d"
  111. }
  112. }
  113. }
  114. });
  115. </script>
  116. @endpush