foot_step.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. pointFormatter: function() { return '<b>'+this.series.name + ' : ' + this.high + '&nbsp;' +gLocal.gui.h+ '<br>' +gLocal.gui.day_EXP + ' : ' + Math.round((this.high - this.low)*100)/100 + '&nbsp;' +gLocal.gui.h+'</b><br/>'; },
  80. valueDecimals: 2
  81. },
  82. series: [{
  83. type: 'ohlc',
  84. name: gLocal.gui.EXP_in_total,
  85. data: data,
  86. dataGrouping: {
  87. units: [[
  88. 'week', // unit name
  89. [1] // allowed multiples
  90. ], [
  91. 'month',
  92. [1, 2, 3, 4, 6]
  93. ]]
  94. }
  95. }]
  96. });
  97. });
  98. </script>
  99. <style>
  100. body {
  101. margin: 0;
  102. padding: 0;
  103. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  104. font-size: 14px;
  105. }
  106. #script-warning {
  107. display: none;
  108. background: #eee;
  109. border-bottom: 1px solid #ddd;
  110. padding: 0 10px;
  111. line-height: 40px;
  112. text-align: center;
  113. font-weight: bold;
  114. font-size: 12px;
  115. color: red;
  116. }
  117. #loading {
  118. display: none;
  119. position: absolute;
  120. top: 10px;
  121. right: 10px;
  122. }
  123. #calendar {
  124. max-width: 1100px;
  125. margin: 40px auto;
  126. padding: 0 10px;
  127. }
  128. </style>
  129. <div class='index_inner'>
  130. <div id='script-warning'>
  131. <code>php/get-events.php</code> must be running.
  132. </div>
  133. <div id='loading'>loading...</div>
  134. <div id='calendar'></div>
  135. </div>
  136. <?php
  137. include "../pcdl/html_foot.php";
  138. ?>