foot_step.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. ?>
  13. <!DOCTYPE html>
  14. <html>
  15. <head>
  16. <meta charset='utf-8' />
  17. <link href='../lib/fullcalendar/main.css' rel='stylesheet' />
  18. <script src='../lib/fullcalendar/main.js'></script>
  19. <script>
  20. document.addEventListener('DOMContentLoaded', function() {
  21. var calendarEl = document.getElementById('calendar');
  22. var calendar = new FullCalendar.Calendar(calendarEl, {
  23. headerToolbar: {
  24. left: 'prev,next today',
  25. center: 'title',
  26. right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
  27. },
  28. initialDate: '2021-01-31',
  29. editable: true,
  30. navLinks: true, // can click day/week names to navigate views
  31. dayMaxEvents: true, // allow "more" link when too many events
  32. events: {
  33. url: 'foot_step_data.php?userid=<?php echo $foot_set_userid;?>',
  34. failure: function() {
  35. document.getElementById('script-warning').style.display = 'block'
  36. }
  37. },
  38. loading: function(bool) {
  39. document.getElementById('loading').style.display =
  40. bool ? 'block' : 'none';
  41. }
  42. });
  43. calendar.render();
  44. });
  45. </script>
  46. <style>
  47. body {
  48. margin: 0;
  49. padding: 0;
  50. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  51. font-size: 14px;
  52. }
  53. #script-warning {
  54. display: none;
  55. background: #eee;
  56. border-bottom: 1px solid #ddd;
  57. padding: 0 10px;
  58. line-height: 40px;
  59. text-align: center;
  60. font-weight: bold;
  61. font-size: 12px;
  62. color: red;
  63. }
  64. #loading {
  65. display: none;
  66. position: absolute;
  67. top: 10px;
  68. right: 10px;
  69. }
  70. #calendar {
  71. max-width: 1100px;
  72. margin: 40px auto;
  73. padding: 0 10px;
  74. }
  75. </style>
  76. </head>
  77. <body>
  78. <div id='script-warning'>
  79. <code>php/get-events.php</code> must be running.
  80. </div>
  81. <div id='loading'>loading...</div>
  82. <div id='calendar'></div>
  83. </body>
  84. </html>