Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php] kontrolka kalendarza
jewel1985
post
Post #1





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 21.11.2007

Ostrzeżenie: (0%)
-----


probuje stworsyc kontrolke kalendarza na podstawie pewnego wzoru.. wyskakuje mi jendak blad w linijce 31 ( for ($nr = 0; $nr < 7; $nr++) ): Parse error: syntax error, unexpected T_FOR in C:\wamp\www\strona\skrypty\kalendarz.php on line 31

Oto kod :

  1. <?php
  2. class Calendar{
  3.  
  4.  var $_shortDays = null;
  5.  var $_longMonths = null;
  6.  
  7.  function Calendar() {
  8.  $this->_shortDays = array(&apos;Pn&apos;, &apos;Wt&apos;, &apos;Sr&apos;, &apos;Cz&apos;, &apos;Pt&apos;, &apos;Sb&apos;, &apos;N&apos;);
  9.  $this->_longMonths = array(&apos;Styczeń&apos;, &apos;Luty&apos;, &apos;Marzec&apos;, &apos;Kwiecień&apos;, &apos;Maj&apos;, &apos;Czerwiec&apos;, &apos;Lipiec&apos;, 
  10. &apos;Sierpień&apos;, &apos;Wrzesień&apos;, &apos;Październik&apos;, &apos;Listopad&apos;, &apos;Grudzień&apos;);
  11.  }
  12.  
  13.  function showCslendar() {
  14.  $actDay = date(`j`); $numberOfDay = date(&apos;t&apos;);
  15.  $actMonth = date(&apos;n&apos;); $actYear = date(&apos;Y&apos;);
  16.  $startDay = date(&apos;w&apos;, mktime(0, 0, 0, $actMonth, 1, $actYear));
  17.  
  18.  echo &apos;
  19.  
  20.  
  21.  
  22.  &apos;.
  23.  $this->_longMonths[$actMonth-1] .&apos;, &apos;. $actYear.&apos;
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  &apos; . 
  30.  for ($nr = 0; $nr < 7; $nr++)
  31.  echo &apos;
  32.  &apos;.$this->_shortDays[$nr] . &apos;&apos;;
  33.  echo &apos;
  34.  
  35.  &apos;;}
  36.  if($startDay == 0) $startDay = 7;
  37.  for($nr=0; $numberOfDay+$startDay-1; $nr<$numberOfDay; $nr++){
  38.  if($nr - $w + 2 <=0){
  39.  echo &apos;
  40.  &apos;;
  41.  continue;
  42.  }
  43.  else{
  44.  if($nr % 7 == 0)
  45.  echo &apos;
  46.  
  47.  &apos;;
  48.  if($nr - $startDay + 2 == $actDay)
  49.  echo &apos;
  50.  &apos;.($nr - $startDay + 2).&apos;&apos;;
  51.  else
  52.  echo &apos;
  53.  &apos;.($nr - $startDay + 2).&apos;&apos;;
  54.  }
  55.  }
  56.  echo &apos;
  57.  
  58.  
  59.  &apos;;
  60.  } 
  61.  
  62.  }
  63.  
  64.  ?>


Ten post edytował jewel1985 5.12.2007, 15:48:06
Go to the top of the page
+Quote Post
drPayton
post
Post #2





Grupa: Zarejestrowani
Postów: 890
Pomógł: 65
Dołączył: 13.11.2005
Skąd: Olsztyn

Ostrzeżenie: (0%)
-----


Popraw temat na zgodny z "Tematyką i zasadami panującymi na forum Przedszkole" oraz popraw bbcode. Do umieszczania kodu php służą znaczniki [ php ] a nie [ code ] (vide powyższe zasady). W przeciwnym wypadku temat zostanie zamknięty.

PS. Błąd wyskakuję bo wcześniejsza instrukcja echo nie została zakończona średnikiem.

Pozdrawiam!
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 11:44