\n"; $currentDate = date('d'); $currentMonth = date('m'); $currentYear = date('Y'); $today = date('j'); $prevMonthsDays = date('t', time() - date('j') * 24*60*60); echo "\n\n"; for($n = $prevMonthsDays - ($firstDayInMonth + 7) +1; $n <= $prevMonthsDays; $n++) { echo "\n"; if(date('w', time() - ($prevMonthsDays - $n + $currentDate) * 24 * 60 * 60) == 0) echo "\n\n"; } echo "
$n
\n"; } function showInputMode() { PHP?>
År:
Månad:
Datum:
Rubrik:
Ingress:
Text:
Länk 1:
Länk 2:
Bild 1:
Bild 2:
Bild 3:
"; $query = "select * from calendar where date='$date'"; $result = mysql_query($query); $line = @mysql_fetch_array($result); if($line != "") { echo "$line[rubrik]
$line[ingress]
$line[date]
$line[kropp]
"; $links = explode(';', $line[links]); foreach($links as $link) { if($link != '') echo "$link
\n"; } $images = explode(';', $line[images]); foreach($images as $image) { if($image != '') echo "
\n"; } } else showNoSchedule(); } else { showInputMode(); } PHP?>