Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]PHP nie zna daty 25.03.2012
mambus
post
Post #1





Grupa: Zarejestrowani
Postów: 53
Pomógł: 0
Dołączył: 30.11.2010

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


Witajcie !
chce mi się śmiać - bo jakbym nie kombinował - tak PHP w żaden sposób do mojego napisanego kalendarza, nie jest w stanie "wypluć" dnia 25.03.2012 - wycina go po prostu. Kalendarz sypie się do momentu właśnie gdy powinien pojawić się 25.03.2012 - później dziala. Nie mam pojęcia czemu, walcze 2 dzień, znajomi patrzyli - naprawdę nic nie wiemy, może ktoś z Was widzi błąd questionmark.gif?

  1. function kalendarz($fix)
  2. {
  3. if($fix > 16) return "<div style='color: #ff0033: Możesz maksymalnie z wyprzedzeniem <b><u>16 tygodni</u></b> !'></div>";
  4. else
  5. {
  6.  
  7. $day = 86400;
  8.  
  9. if(date("N")==1)
  10. {
  11. $ret[0] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix);
  12. $ret[1] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + $day);
  13. $ret[2] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 2*$day);
  14. $ret[3] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 3*$day);
  15. $ret[4] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 4*$day);
  16. $ret[5] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 5*$day);
  17. $ret[6] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 6*$day);
  18. }
  19. elseif(date("N")==2)
  20. {
  21. $ret[0] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - $day);
  22. $ret[1] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix);
  23. $ret[2] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + $day);
  24. $ret[3] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 2*$day);
  25. $ret[4] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 3*$day);
  26. $ret[5] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 4*$day);
  27. $ret[6] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 5*$day);
  28. }
  29. elseif(date("N")==3)
  30. {
  31. print $fix."&nbsp;";
  32. $ret[0] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 2*$day);
  33. $ret[1] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - $day);
  34. $ret[2] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix);
  35. $ret[3] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + $day);
  36. $ret[4] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 2*$day);
  37. $ret[5] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 3*$day);
  38. $ret[6] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 4*$day);
  39. }
  40. elseif(date("N")==4)
  41. {
  42. $ret[0] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 3*$day);
  43. $ret[1] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 2*$day);
  44. $ret[2] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - $day);
  45. $ret[3] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix);
  46. $ret[4] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + $day);
  47. $ret[5] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 2*$day);
  48. $ret[6] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 3*$day);
  49. }
  50. elseif(date("N")==5)
  51. {
  52. $ret[0] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 4*$day);
  53. $ret[1] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 3*$day);
  54. $ret[2] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 2*$day);
  55. $ret[3] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - $day);
  56. $ret[4] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix);
  57. $ret[5] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + $day);
  58. $ret[6] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + 2*$day);
  59. }
  60. elseif(date("N")==6)
  61. {
  62. $ret[0] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 5*$day);
  63. $ret[1] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 4*$day);
  64. $ret[2] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 3*$day);
  65. $ret[3] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 2*$day);
  66. $ret[4] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - $day);
  67. $ret[5] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix);
  68. $ret[6] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix + $day);
  69. }
  70. elseif(date("N")==7)
  71. {
  72. $ret[0] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 6*$day);
  73. $ret[1] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 5*$day);
  74. $ret[2] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 4*$day);
  75. $ret[3] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 3*$day);
  76. $ret[4] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - 2*$day);
  77. $ret[5] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix - $day);
  78. $ret[6] = date("d-m-Y", strtotime(date("d-m-Y")) + ($day*7)*$fix);
  79. }
  80. return $ret;
  81. }
  82. }
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 21.08.2025 - 15:00