$name = "Öppettider";
function GetTodayIndex() {
$today = getdate();
if ($today["weekday"] == 'Monday') {
return 1;
} else if ($today["weekday"] == 'Tuesday') {
return 2;
} else if ($today["weekday"] == 'Wednesday') {
return 3;
} else if ($today["weekday"] == 'Thursday') {
return 4;
} else if ($today["weekday"] == 'Friday') {
return 5;
} else if ($today["weekday"] == 'Saturday') {
return 6;
} else {
return 7;
}
}
function GetTodayName($index) {
if ($index == 1) {
return "Måndag";
} else if ($index == 2) {
return "Tisdag";
} else if ($index == 3) {
return "Onsdag";
} else if ($index == 4) {
return "Torsdag";
} else if ($index == 5) {
return "Fredag";
} else if ($index == 6) {
return "Lördag";
} else {
return "Söndag";
}
}
function GetDay() {
$today = getdate();
if ($today["weekday"] == 'Saturday') {
return 1;
} else if ($today["weekday"] == 'Sunday') {
return 2;
} else {
return 0;
}
}
function CheckIfToday($val, $day) {
if (GetDay() == $day) { ?>
} else {
?>
}
}
$totIndex = GetTodayIndex();
if ($totIndex == 1)
$yestIndex = 7;
else
$yestIndex = $totIndex - 1;
if ($totIndex == 7)
$morrowIndex = 1;
else
$morrowIndex = $totIndex + 1;
?>
include "f_header.php"; ?>
include "f_top.php"; ?>
include "f_top2.php"; ?>
Ordinarie öppettider: |
echo GetTodayName($yestIndex);?> |
echo GetTodayName($totIndex);?> |
echo GetTodayName($morrowIndex);?> |
//?> |
Öppettider kan avvika vid helgdagar. |