foot_step.php 2.3 KB

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