foot_step.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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>
  27. document.addEventListener('DOMContentLoaded', function() {
  28. var calendarEl = document.getElementById('calendar');
  29. var calendar = new FullCalendar.Calendar(calendarEl, {
  30. headerToolbar: {
  31. left: 'prev,next today',
  32. center: 'title',
  33. right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
  34. },
  35. editable: true,
  36. navLinks: true, // can click day/week names to navigate views
  37. dayMaxEvents: true, // allow "more" link when too many events
  38. events: {
  39. url: 'foot_step_data.php?userid=<?php echo $foot_set_userid;?>',
  40. failure: function() {
  41. document.getElementById('script-warning').style.display = 'block'
  42. }
  43. },
  44. loading: function(bool) {
  45. document.getElementById('loading').style.display =
  46. bool ? 'block' : 'none';
  47. }
  48. });
  49. calendar.render();
  50. });
  51. </script>
  52. <style>
  53. body {
  54. margin: 0;
  55. padding: 0;
  56. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  57. font-size: 14px;
  58. }
  59. #script-warning {
  60. display: none;
  61. background: #eee;
  62. border-bottom: 1px solid #ddd;
  63. padding: 0 10px;
  64. line-height: 40px;
  65. text-align: center;
  66. font-weight: bold;
  67. font-size: 12px;
  68. color: red;
  69. }
  70. #loading {
  71. display: none;
  72. position: absolute;
  73. top: 10px;
  74. right: 10px;
  75. }
  76. #calendar {
  77. max-width: 1100px;
  78. margin: 40px auto;
  79. padding: 0 10px;
  80. }
  81. </style>
  82. <div class='index_inner'>
  83. <div id='script-warning'>
  84. <code>php/get-events.php</code> must be running.
  85. </div>
  86. <div id='loading'>loading...</div>
  87. <div id='calendar'></div>
  88. </div>
  89. <?php
  90. include "../pcdl/html_foot.php";
  91. ?>