Witam, mam następujący problem: usiłuję dodać na stronie wyszukiwarkę noclegów pobraną z pewnej strony, robię wszystko zgodnie z instrukcją, ale nie udaje mi się osiągnąć tego, żeby po wybraniu daty zmieniała się w formularzu. Działający formularz jest na stronie hotele24h
Oto kod kalendarza, który chcę podpiąć:
  1. <?
  2. if (!isset($_GET[jezyk])) $_GET[jezyk]='pl';
  3.  
  4. $dni[pl] = array(
  5. 1 => 'P',
  6. 2 => 'W',
  7. 3 => '|',
  8. 4 => 'C',
  9. 5 => 'P',
  10. 6 => 'S',
  11. 7 => 'N'
  12. );
  13.  
  14. $dni[en] = array(
  15. 1 => 'MO',
  16. 2 => 'TU',
  17. 3 => 'WE',
  18. 4 => 'TH',
  19. 5 => 'FR',
  20. 6 => 'SA',
  21. 7 => 'SU'
  22. );
  23.  
  24. $miesiac_nazwa[pl] = array(
  25. 1 => 'styczeń',
  26. 2 => 'luty',
  27. 3 => 'marzec',
  28. 4 => 'kwiecień',
  29. 5 => 'maj',
  30. 6 => 'czerwiec',
  31. 7 => 'lipiec',
  32. 8 => 'sierpień',
  33. 9 => 'wrzesień',
  34. 10 => 'październik',
  35. 11 => 'listopad',
  36. 12 => 'grudzień',
  37. );
  38.  
  39. $miesiac_nazwa[en] = array(
  40. 1 => 'January',
  41. 2 => 'February',
  42. 3 => 'March',
  43. 4 => 'April',
  44. 5 => 'May',
  45. 6 => 'June',
  46. 7 => 'July',
  47. 8 => 'August',
  48. 9 => 'September',
  49. 10 => 'October',
  50. 11 => 'November',
  51. 12 => 'December',
  52. );
  53.  
  54. ?>
  55.  
  56.  
  57.  
  58. <title>Kalendarz</title>
  59. <head>
  60. <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"/>
  61. <style type="text/css">
  62. body{background: #f8ebbe; margin:3px;}
  63. .kalendarz {
  64. font-family: Tahoma;
  65. color: #000000;
  66. font-size: 10pt;
  67. A.kalendarz {
  68. font-family: Tahoma;
  69. color: #000000;
  70. font-size: 10pt;
  71. text-decoration:none;
  72. }
  73. </style>
  74. </head>
  75. <body>
  76. <?
  77.  
  78. $nazwa_forma = "$_GET[nazwa_forma]";
  79. $nazwa_pola = "$_GET[nazwa_pola]";
  80.  
  81. $rok = date("Y");
  82.  
  83. if ((!$_GET[r]) or (mktime(0, 0, 0, date("m"), date("d"), date("Y")) > mktime(0, 0, 0, $_GET[m], 1, $_GET[r]))) {
  84. $dzien = date("d");
  85. $miesiac = date("n");
  86. $rok = date("Y");
  87. } else {
  88. $dzien = 0;
  89. $miesiac= $_GET[m];
  90. $rok = $_GET[r];
  91. if ($miesiac == 13) { $miesiac = 1; $rok++;}
  92. if ($miesiac == 0) { $miesiac = 12; $rok--;}
  93.  
  94. }
  95.  
  96. $miesiac_dni =array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
  97.  
  98. //dodaje dni w roku przestepnym
  99. if ((($rok % 4 == 0) and !($rok % 100 == 0)) or ($rok % 400 == 0)) {$miesiac_dni[1]++;}
  100.  
  101. $dzien_tyg = date("w", mktime (0,0,0, $miesiac, 1, $rok)); if ($dzien_tyg == 0) {$dzien_tyg=7;}
  102.  
  103. print ("<table border=0 cellspacing=1 cellpadding=0 align=center class=kalendarz>");
  104. print ("<tr><td colspan=7 align=center><a href=\"popup_kalendarz.php?nazwa_pola=$_GET[nazwa_pola]&nazwa_forma=$_GET[nazwa_forma]&jezyk=$_GET[jezyk]&r=$rok&m=") . ($miesiac-1) . ("\" class=kalendarz><B>&laquo;</B></a>&nbsp;&nbsp;&nbsp;&nbsp;<b>") . $miesiac_nazwa[$_GET[jezyk]][$miesiac] . " " . $rok . ("</b>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"popup_kalendarz.php?nazwa_pola=$_GET[nazwa_pola]&jezyk=$_GET[jezyk]&nazwa_forma=$_GET[nazwa_forma]&r=$rok&m=") . ($miesiac+1) . ("\" class=kalendarz><B>&raquo;</B></a></td></tr>");
  105. print ("<tr height=22>
  106. <td width=25 bgcolor=\"#620206\" align=center style=\"color: white; font-weight: bold;\">").$dni[$_GET[jezyk]][1].("</td>
  107.  
  108. <td width=25 bgcolor=\"#620206\" align=center style=\"color: white; font-weight: bold;\">").$dni[$_GET[jezyk]][2].("</td>
  109.  
  110. <td width=25 bgcolor=\"#620206\" align=center style=\"color: white; font-weight: bold;\">").$dni[$_GET[jezyk]][3].("</td>
  111.  
  112. <td width=25 bgcolor=\"#620206\" align=center style=\"color: white; font-weight: bold;\">").$dni[$_GET[jezyk]][4].("</td>
  113.  
  114. <td width=25 bgcolor=\"#620206\" align=center style=\"color: white; font-weight: bold;\">").$dni[$_GET[jezyk]][5].("</td>
  115.  
  116. <td width=25 bgcolor=\"#620206\" align=center style=\"color: white; font-weight: bold;\">").$dni[$_GET[jezyk]][6].("</td>
  117.  
  118. <td width=25 bgcolor=\"#620206\" align=center style=\"color: white; font-weight: bold;\">").$dni[$_GET[jezyk]][7].("</td></tr>
  119. ");
  120. print ("<tr height=22>");
  121.  
  122. $tr=0;
  123. //puste pola w tabelce
  124. if (($dzien_tyg) != 1) {
  125. for ($i=1; $i<($dzien_tyg); $i++) {
  126. print ("<td>&nbsp;</td>"); $tr++;
  127. }
  128. }
  129.  
  130. if ($miesiac<10) {$miesiac = '0' . $miesiac;}
  131. //pelne
  132. for ($i=1; $i<=($miesiac_dni[$miesiac-1]); $i++) {
  133. if ($dzien <= $i) {
  134. if ($i<10) {$j = '0' . $i;} else {$j = $i;}
  135. print ("<td align=center onclick=\"parent.window.document.$nazwa_forma.$nazwa_pola.value='$rok-$miesiac-$j';parent.window.test.style.display='none';parent.window.test2.style.display='none';\" onmouseover=\"this.style.border='1px solid #804000';this.style.backgroundColor='white';this.style.cursor='pointer';\" onmouseout=\"this.style.border='0px';this.style.backgroundColor='#f8ebbe';\"><a href=\"#\" class=\"kalendarz\" style=\"");
  136. //koloruje niedziele na czerwono
  137. if (($tr%7) == 6) {print ("color:red; ");}
  138. print ("\">");
  139.  
  140.  
  141. //podswietla dzien jesli jest podany
  142. if ($dzien == $i) { print ("<b>$i</b>"); } else { print $i; }
  143. print ("</a>");
  144. print ("</td>"); $tr++; if (($tr%7) == 0) {print ("</tr><tr height=18>");}
  145.  
  146.  
  147. } else {
  148. print ("<td align=center><span class=\"kalendarz\" style=\"");
  149. //koloruje niedziele na czerwono
  150. if (($tr%7) == 6) {print ("color:red; ");}
  151. print ("\">");
  152.  
  153.  
  154. //podswietla dzien jesli jest podany
  155. if ($dzien == $i) { print ("<b>$i</b>"); } else { print $i; }
  156. print ("</span>");
  157. print ("</td>"); $tr++; if (($tr%7) == 0) {print ("</tr><tr height=18>");}
  158.  
  159. }
  160.  
  161. }
  162. print ("<tr><td colspan=\"7\" style=\"text-align: right\"><a href=\"#\" class=\"kalendarz\" style=\"font-weight:bold;\" onclick=\"parent.window.test.style.display='none';parent.window.test2.style.display='none';\"></a></td></tr></table>");
  163. ?>


Kalendarz się u mnie wyświetla, tylko nie wczytuje z niego daty do formularza, więc może to u mnie po prostu źle jest wstawiony? Podaję kod:

  1. <td bgcolor="#DEAC01" class=hotele_text style="padding:3px;">Data przyjazdu<br />
  2. <input type="text" name="data_od" MAXLENGTH="10" value="<?php print date('Y-m-d'); ?>" class="hotele_form" style="width:80px;">&nbsp;
  3. <img src="http://www.hotel24h.com/img/kalendarz.gif" align="middle" border="0" onclick="document.getElementById('hoteleTest').style.display=''">
  4. <div id="hoteleTest" name="hoteleTest" style="display:none;" onmouseout="document.getElementById('hoteleTest').style.display='none';">
  5. <iframe src="popup_kalendarz.php" scrolling="no" frameborder="no" align="center" width="210px" height="180px"></iframe>
  6. </div>
  7. </td>


Bardzo proszę o pomoc, bo nie wiem, co z tym fantem począć...