foot_step.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?php
  2. if(isset($_GET["userid"])){
  3. $foot_set_userid = $_GET["userid"];
  4. }
  5. else if(isset($_COOKIE["userid"])){
  6. $foot_set_userid = $_COOKIE["userid"];
  7. }
  8. else{
  9. echo "no user id";
  10. exit;
  11. }
  12. include "../pcdl/html_head.php";
  13. ?>
  14. <body>
  15. <?php
  16. require_once "../path.php";
  17. require_once "../public/_pdo.php";
  18. require_once '../public/function.php';
  19. require_once '../ucenter/function.php';
  20. require_once "../pcdl/head_bar.php";
  21. $currChannal = "course";
  22. require_once "../uhome/head.php";
  23. ?>
  24. <link href='../lib/fullcalendar/main.css' rel='stylesheet' />
  25. <script src='../lib/fullcalendar/main.js'></script>
  26. <script src="https://code.highcharts.com/stock/highstock.js"></script>
  27. <script src="https://code.highcharts.com/stock/modules/data.js"></script>
  28. <script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
  29. <div id="container" style="height: 400px; min-width: 310px"></div>
  30. <script>
  31. document.addEventListener('DOMContentLoaded', function() {
  32. var calendarEl = document.getElementById('calendar');
  33. var calendar = new FullCalendar.Calendar(calendarEl, {
  34. headerToolbar: {
  35. left: 'prev,next today',
  36. center: 'title',
  37. right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
  38. },
  39. locale: getCookie("language"),
  40. editable: false,
  41. navLinks: true, // can click day/week names to navigate views
  42. dayMaxEvents: true, // allow "more" link when too many events
  43. events: {
  44. url: 'foot_step_data.php?userid=<?php echo $foot_set_userid;?>',
  45. failure: function() {
  46. document.getElementById('script-warning').style.display = 'block'
  47. }
  48. },
  49. loading: function(bool) {
  50. document.getElementById('loading').style.display =
  51. bool ? 'block' : 'none';
  52. }
  53. });
  54. calendar.render();
  55. });
  56. Highcharts.setOptions({
  57. lang: {
  58. weekdays: [
  59. gLocal.gui.ravi, gLocal.gui.canda, gLocal.gui.bhumma, gLocal.gui.budha,
  60. gLocal.gui.guru, gLocal.gui.sukka, gLocal.gui.sora
  61. ],
  62. shortMonths:[
  63. gLocal.gui.Jan, gLocal.gui.Feb, gLocal.gui.Mar, gLocal.gui.Apr, gLocal.gui.May, gLocal.gui.Jun, gLocal.gui.Jul, gLocal.gui.Aug, gLocal.gui.Sep, gLocal.gui.Oct, gLocal.gui.Nov, gLocal.gui.Dec
  64. ]
  65. }
  66. });
  67. Highcharts.getJSON('../ucenter/active_get.php', function (data) {
  68. // create the chart
  69. Highcharts.stockChart('container', {
  70. rangeSelector: {
  71. selected: 2
  72. },
  73. title: {
  74. text: gLocal.gui.progress_curve
  75. },
  76. tooltip: {
  77. shared: true,
  78. useHTML: true,
  79. headerFormat: '<small>{point.key}</small><table>',
  80. pointFormat: '<tr><td style="color: {series.color}">{series.name}: </td>' +
  81. '<td style="text-align: right"><b>{point.y} '+gLocal.gui.h+'</b></td></tr>',
  82. footerFormat: '</table>',
  83. valueDecimals: 2
  84. },
  85. series: [{
  86. type: 'ohlc',
  87. name: gLocal.gui.day_EXP,
  88. data: data,
  89. dataGrouping: {
  90. units: [[
  91. 'week', // unit name
  92. [1] // allowed multiples
  93. ], [
  94. 'month',
  95. [1, 2, 3, 4, 6]
  96. ]]
  97. }
  98. }]
  99. });
  100. });
  101. </script>
  102. <style>
  103. body {
  104. margin: 0;
  105. padding: 0;
  106. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  107. font-size: 14px;
  108. }
  109. #script-warning {
  110. display: none;
  111. background: #eee;
  112. border-bottom: 1px solid #ddd;
  113. padding: 0 10px;
  114. line-height: 40px;
  115. text-align: center;
  116. font-weight: bold;
  117. font-size: 12px;
  118. color: red;
  119. }
  120. #loading {
  121. display: none;
  122. position: absolute;
  123. top: 10px;
  124. right: 10px;
  125. }
  126. #calendar {
  127. max-width: 1100px;
  128. margin: 40px auto;
  129. padding: 0 10px;
  130. }
  131. </style>
  132. <div class='index_inner'>
  133. <div id='script-warning'>
  134. <code>php/get-events.php</code> must be running.
  135. </div>
  136. <div id='loading'>loading...</div>
  137. <div id='calendar'></div>
  138. </div>
  139. <?php
  140. include "../pcdl/html_foot.php";
  141. ?>