calendar.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. // including the relevant language file
  3. $langFile = "agenda";
  4. // including the claroline global
  5. include('../inc/global.inc.php');
  6. //session
  7. if(isset($_GET['id_session']))
  8. $_SESSION['id_session'] = $_GET['id_session'];
  9. // the variables for the days and the months
  10. // Defining the shorts for the days
  11. $DaysShort = array(get_lang("SundayShort"), get_lang("MondayShort"), get_lang("TuesdayShort"), get_lang("WednesdayShort"), get_lang("ThursdayShort"), get_lang("FridayShort"), get_lang("SaturdayShort"));
  12. // Defining the days of the week to allow translation of the days
  13. $DaysLong = array(get_lang("SundayLong"), get_lang("MondayLong"), get_lang("TuesdayLong"), get_lang("WednesdayLong"), get_lang("ThursdayLong"), get_lang("FridayLong"), get_lang("SaturdayLong"));
  14. // Defining the months of the year to allow translation of the months
  15. $MonthsLong = array(get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong"));
  16. ?>
  17. <html>
  18. <head>
  19. <title>Calendar</title>
  20. <style type="text/css">
  21. table.calendar
  22. {
  23. width: 100%;
  24. font-size: 11px;
  25. font-family: verdana, arial, helvetica, sans-serif;
  26. }
  27. table.calendar .monthyear
  28. {
  29. background-color: #4171B5;
  30. text-align: center;
  31. color: #ffffff;
  32. }
  33. table.calendar .daynames
  34. {
  35. background-color: #D3DFF1;
  36. text-align: center;
  37. }
  38. table.calendar td
  39. {
  40. width: 25px;
  41. height: 25px;
  42. background-color: #f5f5f5;
  43. text-align: center;
  44. }
  45. table.calendar td.selected
  46. {
  47. border: 1px solid #ff0000;
  48. background-color: #FFCECE;
  49. }
  50. table.calendar td a
  51. {
  52. width: 25px;
  53. height: 25px;
  54. text-decoration: none;
  55. }
  56. table.calendar td a:hover
  57. {
  58. background-color: #ffff00;
  59. }
  60. table.calendar .monthyear a
  61. {
  62. text-align: center;
  63. color: #ffffff;
  64. }
  65. table.calendar .monthyear a:hover
  66. {
  67. text-align: center;
  68. color: #ff0000;
  69. background-color: #ffff00;
  70. }
  71. </style>
  72. <script language="JavaScript" type="text/javascript">
  73. <!--
  74. /* added 2004-06-10 by Michael Keck
  75. * we need this for Backwards-Compatibility and resolving problems
  76. * with non DOM browsers, which may have problems with css 2 (like NC 4)
  77. */
  78. var isDOM = (typeof(document.getElementsByTagName) != 'undefined'
  79. && typeof(document.createElement) != 'undefined')
  80. ? 1 : 0;
  81. var isIE4 = (typeof(document.all) != 'undefined'
  82. && parseInt(navigator.appVersion) >= 4)
  83. ? 1 : 0;
  84. var isNS4 = (typeof(document.layers) != 'undefined')
  85. ? 1 : 0;
  86. var capable = (isDOM || isIE4 || isNS4)
  87. ? 1 : 0;
  88. // Uggly fix for Opera and Konqueror 2.2 that are half DOM compliant
  89. if (capable) {
  90. if (typeof(window.opera) != 'undefined') {
  91. var browserName = ' ' + navigator.userAgent.toLowerCase();
  92. if ((browserName.indexOf('konqueror 7') == 0)) {
  93. capable = 0;
  94. }
  95. } else if (typeof(navigator.userAgent) != 'undefined') {
  96. var browserName = ' ' + navigator.userAgent.toLowerCase();
  97. if ((browserName.indexOf('konqueror') > 0) && (browserName.indexOf('konqueror/3') == 0)) {
  98. capable = 0;
  99. }
  100. } // end if... else if...
  101. } // end if
  102. //-->
  103. </script>
  104. <script type="text/javascript" src="tbl_change.js"></script>
  105. <script type="text/javascript">
  106. <!--
  107. var month_names = new Array(
  108. <?php
  109. foreach($MonthsLong as $index => $month)
  110. {
  111. echo '"'.$month.'",';
  112. }
  113. ?>
  114. "");
  115. var day_names = new Array(
  116. <?php
  117. foreach($DaysShort as $index => $day)
  118. {
  119. echo '"'.$day.'",';
  120. }
  121. ?>
  122. "");
  123. //-->
  124. </script>
  125. </head>
  126. <body onload="initCalendar();">
  127. <div id="calendar_data"></div>
  128. <div id="clock_data"></div>
  129. </body>
  130. </html>