booking_agenda_table_view.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. $res = 0;
  3. // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
  4. if (!$res && !empty ($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
  5. $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"] . "/main.inc.php";
  6. }
  7. // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
  8. $tmp = empty ($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
  9. $tmp2 = realpath(__FILE__);
  10. $i = strlen($tmp) - 1;
  11. $j = strlen($tmp2) - 1;
  12. while ($i > 0 && $j > 0 && isset ($tmp[$i]) && isset ($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
  13. $i--;
  14. $j--;
  15. }
  16. if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)) . "/main.inc.php")) {
  17. $res = @include substr($tmp, 0, ($i + 1)) . "/main.inc.php";
  18. }
  19. if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php")) {
  20. $res = @include dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php";
  21. }
  22. // Try main.inc.php using relative path
  23. if (!$res && file_exists("../main.inc.php")) {
  24. $res = @include "../main.inc.php";
  25. }
  26. if (!$res && file_exists("../../main.inc.php")) {
  27. $res = @include "../../main.inc.php";
  28. }
  29. if (!$res && file_exists("../../../main.inc.php")) {
  30. $res = @include "../../../main.inc.php";
  31. }
  32. if (!$res) {
  33. die ("Include of main fails");
  34. }
  35. $year = GETPOST('year', 'aZ09');
  36. $month = GETPOST('month', 'aZ09');
  37. $day = GETPOST('day', 'aZ09');
  38. require_once DOL_DOCUMENT_ROOT . '/custom/booking/class/booking_agenda_helper.class.php';
  39. $bookingAgendaHelper = new BookingAgendaHelper($db);
  40. $eventdayDates = $bookingAgendaHelper->getEventDayDates($year, $month, $day);
  41. $bookingAgendaHelper->showTable($eventdayDates, $selectedEvent);
  42. ?>
  43. <style>
  44. .trheight {
  45. height: 50px;
  46. }
  47. .elvalaszto {
  48. background-color: grey;
  49. }
  50. .foglaltsag {
  51. color: red;
  52. }
  53. .location {
  54. color: black;
  55. }
  56. .firstcolumn {
  57. background-color: lightgrey;
  58. text-align: center;
  59. font-weight: bold;
  60. }
  61. </style>