foot_step.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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.getJSON('../ucenter/active_get.php', function (data) {
  57. // create the chart
  58. Highcharts.stockChart('container', {
  59. rangeSelector: {
  60. selected: 2
  61. },
  62. title: {
  63. text: 'Pali Step'
  64. },
  65. series: [{
  66. type: 'ohlc',
  67. name: '每日收获',
  68. data: data,
  69. dataGrouping: {
  70. units: [[
  71. 'week', // unit name
  72. [1] // allowed multiples
  73. ], [
  74. 'month',
  75. [1, 2, 3, 4, 6]
  76. ]]
  77. }
  78. }]
  79. });
  80. });
  81. </script>
  82. <style>
  83. body {
  84. margin: 0;
  85. padding: 0;
  86. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  87. font-size: 14px;
  88. }
  89. #script-warning {
  90. display: none;
  91. background: #eee;
  92. border-bottom: 1px solid #ddd;
  93. padding: 0 10px;
  94. line-height: 40px;
  95. text-align: center;
  96. font-weight: bold;
  97. font-size: 12px;
  98. color: red;
  99. }
  100. #loading {
  101. display: none;
  102. position: absolute;
  103. top: 10px;
  104. right: 10px;
  105. }
  106. #calendar {
  107. max-width: 1100px;
  108. margin: 40px auto;
  109. padding: 0 10px;
  110. }
  111. </style>
  112. <div class='index_inner'>
  113. <div id='script-warning'>
  114. <code>php/get-events.php</code> must be running.
  115. </div>
  116. <div id='loading'>loading...</div>
  117. <div id='calendar'></div>
  118. </div>
  119. <?php
  120. include "../pcdl/html_foot.php";
  121. ?>