entries->entry as $key => $entry) { $timestamp = strtotime($entry->from); $timestamp_day = mktime(12,0,0,date("m",$timestamp),date("d",$timestamp),date("Y",$timestamp)); $notdienst_arr[$timestamp_day][] = $entry; # Checke ob Notdienst länger als einen Tag geht $from_time = strtotime($entry->from); $to_time = strtotime($entry->to); $from = mktime(12,0,0,date("m",$from_time),date("d",$from_time),date("Y",$from_time)); $to = mktime(12,0,0,date("m",$to_time),date("d",$to_time),date("Y",$to_time)); $day_diff = $to - $from; $day_sec = (60 * 60 * 24); if($day_diff > $day_sec){ $days = $day_diff / $day_sec; for ($i = 1; $i < $days; $i++) { $notdienst_exception[$from + ($day_sec * $i)][] = $entry; } } } # -------------------------------------------------------------------------- # Datumskalkulation # -------------------------------------------------------------------------- $zeitraum_beginn = mktime(12,0,0,date("m",time()),date("d",time()),date("Y",time())); $zeitraum_ende = mktime(12,0,0,date("m",time()),date("d",time())+$zeitraum_laenge,date("Y",time())); $timefocus = $zeitraum_beginn; $actualservice = array(); while($timefocus <= $zeitraum_ende){ if($timefocus <= $zeitraum_ende){ $notdienst[$timefocus] = $notdienst_arr[$timefocus]; } $timefocus = mktime(12,0,0,date("m",$timefocus),date("d",$timefocus)+1,date("Y",$timefocus)); } $timekeys = array_keys($notdienst); $months = array("Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"); # -------------------------------------------------------------------------- # Ausgabe # -------------------------------------------------------------------------- ?> Apotheken Notdienst der Region Bühl | aesculap - Ihre Apotheke
Notdienstplan der Region Bühl
für den Monat

$countdayofmonth){ if($timekeys[$countdayofmonth]>=$zeitraum_beginn){ $actuallservice = mktime(12,0,0,date("m",time()),date("d",time()),date("Y",time())); if($actuallservice == $timekeys[$countdayofmonth]){ echo ""; } else{ if(isset($notdienst[$timekeys[$countdayofmonth]])){ echo ""; } else{ echo ""; } } } else{ echo ""; } $countdayofmonth++; } else{ echo ""; } if($countdayofweek >= 7){ echo ""; if(convertWeekDays(date("w",$timekeys[$countdayofmonth-1]))!=$countdayofweek && $countdayofweek > 6){ break; } else{ $countdayofweek = 0; } } } ?>
MO DI MI DO FR SA SO
".date("d",$timekeys[$countdayofmonth])."".date("d",$timekeys[$countdayofmonth])."".date("d",$timekeys[$countdayofmonth])."  

Aktueller Notdienst:
"; } else{ $tomorrow = mktime(12,0,0,date("m",time()),date("d",time())+1,date("Y",time())); echo "Notdienst
vom ".date("d.m.")." 8:30 Uhr bis ".(date("d.m.",$tomorrow))." 8:30 Uhr

"; } #if(date("Hi")*1<=830){ # $actuallservice = mktime(12,0,0,date("m",time()),date("d",time())-1,date("Y",time())); #} #else{ # $actuallservice = mktime(12,0,0,date("m",time()),date("d",time()),date("Y",time())); #} # #print_r($notdienst); #echo $actuallservice; #echo date("d.m.Y H:i:s",'1172746800'); $addresses = $notdienst[$actuallservice]; $string = ''; foreach ($addresses as $address){ $string .= $address->name."
"; $string .= $address->street."
"; $string .= $address->zipCode .' '. $address->location ."
"; $string .= $address->phone."

"; } if(isset($notdienst_exception[$actuallservice])){ foreach ($notdienst_exception[$actuallservice] as $address_exception){ $string .= $address_exception->name."
"; $string .= $address_exception->street."
"; $string .= $address_exception->zipCode .' '. $address_exception->location ."
"; $string .= $address_exception->phone."

"; } } echo $string; ?>

>>> Wer hat momentan Notdienst?



Die Notdienstdaten wurden / werden durch die Landesapothekerkammer Baden-Württemberg zur Verfügung gestellt