Location: PHPKode > scripts > Opening hours > oeffnungszeiten2.0/scripte/Ampelwoche.php


<?php

//-----Copyright Praxisampel: Christoph Schwarz,nebulanet-hide@address.com
//-----ueber eine kleine Spende wuerde ich mich freuen:
//-----https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7043154

$handle = fopen('../scripte/texte/ampelwoche.txt', 'r');
  $ampelwoche = fread($handle,60) ;
  fclose($handle) ;
  $ampelwoche  =utf8_decode($ampelwoche); 

//Montag-Sonntag:  Uhrzeit---------------------------------------------------------------------------------



$handle = fopen('../scripte/texte/geschlossen.txt', 'r');
  $geschlossen = fread($handle,15) ;
  fclose($handle) ;
  $geschlossen  =utf8_encode(   $geschlossen  ); 
$handle = fopen('../scripte/montag/Praxisoeffnung.txt', 'r');
  $time1 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/montag/MittagspauseStart.txt', 'r');
$time2 = fread($handle,5) ;
  fclose($handle) ;
$handle = fopen('../scripte/montag/MittagspauseEnde.txt', 'r');
 $time3 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/montag/Praxisgeschlossen.txt', 'r');
  $time4 = fread($handle,5) ;
  fclose($handle) ;
$handle = fopen('../scripte/montag/MittagspauseStart.txt', 'r');
$montagpausenlos = fread($handle,2) ;
  fclose($handle) ;




$handle = fopen('../scripte/dienstag/Praxisoeffnung.txt', 'r');
  $timed1 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/dienstag/MittagspauseStart.txt', 'r');
$timed2 = fread($handle,5) ;
  fclose($handle) ;
$handle = fopen('../scripte/dienstag/MittagspauseEnde.txt', 'r');
 $timed3 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/dienstag/Praxisgeschlossen.txt', 'r');
  $timed4 = fread($handle,5) ;
  fclose($handle) ;
$handle = fopen('../scripte/dienstag/MittagspauseStart.txt', 'r');
$dienstagpausenlos = fread($handle,2) ;
  fclose($handle) ;


$handle = fopen('../scripte/mittwoch/Praxisoeffnung.txt', 'r');
  $timem1 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/mittwoch/MittagspauseStart.txt', 'r');
$timem2 = fread($handle,5) ;
  fclose($handle) ;
$handle = fopen('../scripte/mittwoch/MittagspauseEnde.txt', 'r');
 $timem3 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/mittwoch/Praxisgeschlossen.txt', 'r');
  $timem4 = fread($handle,5) ;
  fclose($handle) ;
$handle = fopen('../scripte/mittwoch/MittagspauseStart.txt', 'r');
$mittwochpausenlos = fread($handle,2) ;
  fclose($handle) ;



$handle = fopen('../scripte/donnerstag/Praxisoeffnung.txt', 'r');
  $timedo1 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/donnerstag/MittagspauseStart.txt', 'r');
$timedo2 = fread($handle,5) ;
  fclose($handle) ;
$handle = fopen('../scripte/donnerstag/MittagspauseEnde.txt', 'r');
 $timedo3 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/donnerstag/Praxisgeschlossen.txt', 'r');
  $timedo4 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/donnerstag/MittagspauseStart.txt', 'r');
$donnerstagpausenlos = fread($handle,2) ;
  fclose($handle) ;




$handle = fopen('../scripte/freitag/Praxisoeffnung.txt', 'r');
  $timef1 = fread($handle,5) ;
fclose($handle) ;

$handle = fopen('../scripte/freitag/MittagspauseStart.txt', 'r');
$timef2 = fread($handle,5) ;
  fclose($handle) ;
$handle = fopen('../scripte/freitag/MittagspauseEnde.txt', 'r');
 $timef3 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/freitag/Praxisgeschlossen.txt', 'r');
  $timef4 = fread($handle,5) ;
  fclose($handle) ;
$handle = fopen('../scripte/freitag/MittagspauseStart.txt', 'r');
$freitagpausenlos = fread($handle,2) ;
  fclose($handle) ;




$handle = fopen('../scripte/samstag/Samstagoeffnung.txt', 'r');
  $times6 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/samstag/SamstagMittagspauseStart.txt', 'r');
$times7 = fread($handle,5) ;
  fclose($handle) ;
$handle = fopen('../scripte/samstag/SamstagMittagspauseEnde.txt', 'r');
 $times8 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/samstag/Samstaggeschlossen.txt', 'r');
  $times9= fread($handle,5) ;
  fclose($handle) ;


$handle = fopen('../scripte/samstag/SamstagMittagspauseStart.txt', 'r');
$samstagpausenlos = fread($handle,2) ;
  fclose($handle) ;



$handle = fopen('../scripte/sonntag/Praxisoeffnung.txt', 'r');
  $timeso1 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/sonntag/MittagspauseStart.txt', 'r');
$timeso2 = fread($handle,5) ;
  fclose($handle) ;
$handle = fopen('../scripte/sonntag/MittagspauseEnde.txt', 'r');
 $timeso3 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/sonntag/Praxisgeschlossen.txt', 'r');
  $timeso4 = fread($handle,5) ;
  fclose($handle) ;

$handle = fopen('../scripte/sonntag/MittagspauseStart.txt', 'r');
$sonntagpausenlos = fread($handle,2) ;
  fclose($handle) ;



//---Freitag/Samstag auf Montag

$handle = fopen('../scripte/samstag/Samstagoeffnung.txt', 'r');
  $samstagzu = fread($handle,2) ;
  fclose($handle) ;

$handle = fopen('../scripte/sonntag/Praxisoeffnung.txt', 'r');
  $sonntagzu = fread($handle,2) ;
  fclose($handle) ;


//-Berechnungswerte

$time1x=str_replace(":",".",$time1);
$time2x=str_replace(":",".",$time2);
$time3x=str_replace(":",".",$time3);
$time4x=str_replace(":",".",$time4);


$timed1x=str_replace(":",".",$timed1);
$timed2x=str_replace(":",".",$timed2);
$timed3x=str_replace(":",".",$timed3);
$timed4x=str_replace(":",".",$timed4);

$timem1x=str_replace(":",".",$timem1);
$timem2x=str_replace(":",".",$timem2);
$timem3x=str_replace(":",".",$timem3);
$timem4x=str_replace(":",".",$timem4);

$timedo1x=str_replace(":",".",$timedo1);
$timedo2x=str_replace(":",".",$timedo2);
$timedo3x=str_replace(":",".",$timedo3);
$timedo4x=str_replace(":",".",$timedo4);

$timef1x=str_replace(":",".",$timef1);
$timef2x=str_replace(":",".",$timef2);
$timef3x=str_replace(":",".",$timef3);
$timef4x=str_replace(":",".",$timef4);

$times6x=str_replace(":",".",$times6);
$times7x=str_replace(":",".",$times7);
$times8x=str_replace(":",".",$times8);
$times9x=str_replace(":",".",$times9);

$timeso1x=str_replace(":",".",$timeso1);
$timeso2x=str_replace(":",".",$timeso2);
$timeso3x=str_replace(":",".",$timeso3);
$timeso4x=str_replace(":",".",$timeso4);



//Ende  Zeiteinstellung--------------------------------------------------------------------------------------Ende





$handle = fopen('../scripte/texte/samstag.txt', 'r');
  $samstag = fread($handle,100) ;
  fclose($handle) ;


$handle = fopen('../scripte/texte/sonntag.txt', 'r');
  $sonntag = fread($handle,100) ;
  fclose($handle) ;
  $sonntag  =utf8_encode(    $sonntag ); 

$handle = fopen('../scripte/texte/montag.txt', 'r');
  $montag = fread($handle,100) ;
  fclose($handle) ;
$montag =utf8_encode(  $montag ); 

$handle = fopen('../scripte/texte/dienstag.txt', 'r');
  $dienstag = fread($handle,100) ;
  fclose($handle) ;
 $dienstag=utf8_encode(  $dienstag ); 

$handle = fopen('../scripte/texte/mittwoch.txt', 'r');
  $mittwoch = fread($handle,100) ;
  fclose($handle) ;
 $mittwoch=utf8_encode( $mittwoch ); 

$handle = fopen('../scripte/texte/donnerstag.txt', 'r');
  $donnerstag = fread($handle,100) ;
  fclose($handle) ;
$donnerstag =utf8_encode(  $donnerstag  ); 

$handle = fopen('../scripte/texte/freitag.txt', 'r');
  $freitag = fread($handle,100) ;
  fclose($handle) ;
 $freitag =utf8_encode(   $freitag); 




//Formatierung zweiter Satz
$handle = fopen('../scripte/texte/format_Satz_Teil3.txt', 'r');
  $format = fread($handle,100) ;
  fclose($handle) ;

  $formatende ="</font>"  ;



$handle = fopen('../scripte/texte/bis.txt', 'r');
  $bis = fread($handle,100) ;
  fclose($handle) ;
    $bis  =utf8_encode(      $bis  ); 

$handle = fopen('../scripte/texte/uhr.txt', 'r');
  $Uhr = fread($handle,100) ;
  fclose($handle) ;
$Uhr =utf8_encode(  $Uhr  ); 


//Formatierung zweiter Satz
$handle = fopen('../scripte/texte/Satz_Teil3_Wochenende.txt', 'r');
  $Wochenende = fread($handle,100) ;
  fclose($handle) ;




// Montag

$TextFrueh="  $format $montag:  $time1 $bis $time2 $Uhr, $time3 $bis $time4 $Uhr </font>" ;


// Dienstag
$TextFruehd=" $format $dienstag: $timed1 $bis $timed2 $Uhr, $timed3 $bis $timed4 $Uhr </font>";



// Mittwoch
$TextFruehm="  $format $mittwoch: $timem1 $bis $timem2 $Uhr, $timem3 $bis $timem4 $Uhr </font>";



// Donnerstag
$TextFruehdo=" $format $donnerstag: $timedo1 $bis $timedo2 $Uhr, $timedo3 $bis $timedo4 $Uhr  </font>";






// Freitag
$TextFruehf=" $format  $freitag: $timef1 $bis $timef2 $Uhr, $timef3 $bis $timef4 $Uhr </font>";



//Samstag

$TextSFrueh=" $format $samstag:    $times6 $bis $times7 $Uhr, $times8 $bis $times9 $Uhr  </font>" ;  



// Sonntag
$TextFruehso=" $format $sonntag: $timeso1 $bis $timeso2 $Uhr, $timeso3 $bis $timeso4 $Uhr </font>";


//Wochenende auf Montag


//Tage komplett geschlossen
$leerzeichen="&nbsp;
";

$Textdosa1=" $format $samstag: $times6  $bis $times7 $Uhr, $times7  $bis $times8 $Uhr </font>";
$Textdosa2=" $format $samstag:  $times6  $bis $times8 $Uhr </font>";
$Textdoso1=" $format $sonntag: $timeso1  $bis $timeso2 $Uhr, $timeso3  $bis $timeso4 $Uhr </font>";
$Textdoso2=" $format $sonntag:  $timeso1  $bis $timeso4 $Uhr </font>";
$Textdomo1=" $format $montag: $time1  $bis $time2 $Uhr, $time3  $bis $time4 $Uhr </font>";
$Textdomo2=" $format $montag:  $time1  $bis $time4 $Uhr </font>";
$Textdodi1=" $format $dienstag,: $timed1  $bis $timed2 $Uhr, $timed3  $bis $timed4 $Uhr </font>";
$Textdodi2=" $format $dienstag:  $timed1  $bis $timed4 $Uhr </font>";

$Textdomi1=" $format $mittwoch: $timem1  $bis $timem2 $Uhr, $timem3  $bis $timem4 $Uhr </font>";
$Textdomi2=" $format $mittwoch:  $timem1  $bis $timem4 $Uhr </font>";
$Textdodo1=" $format $donnerstag: $timedo  $bis $timedo2 $Uhr, $timedo3  $bis $timedo4 $Uhr </font>";
$Textdodo2=" $format $donnerstag:  $timedo1  $bis $timedo4 $Uhr </font>";
$Textdofr1=" $format $freitag: $timef1  $bis $timef2 $Uhr, $timef3  $bis $timef4 $Uhr </font>";
$Textdofr2=" $format $freitag:  $timef1  $bis $timef4 $Uhr </font>";

//Montag
$zu1= "<table border=0><tr><td>$institution $einszwei1 - $TextFrueh</td></tr></table>";

$zu2= "<table  border=0><tr><td>$institution $einszwei2 - $Textspaet</td></tr></table>";

$zu3= "<table  border=0><tr><td >$institution $einszwei3 - $Textnacht</td></tr></table>";

$zu4= "<table border=0><tr><td>$institution $einszwei1 - $TextFrueh2</td></tr></table>";
$zu5= "<table  border=0><tr><td >$institution $einszwei3 - $Textnacht2</td></tr></table>";

// Dienstag

$zu1d= "<table border=0><tr><td>$institution $einszwei1 - $TextFruehd</td></tr></table>";

$zu2d= "<table  border=0><tr><td>$institution $einszwei2 - $Textspaetd</td></tr></table>";

$zu3d= "<table  border=0><tr><td >$institution $einszwei3 - $Textnachtd</td></tr></table>";


$zu4d= "<table border=0><tr><td>$institution $einszwei1 - $TextFruehd2</td></tr></table>";
$zu5d= "<table  border=0><tr><td >$institution $einszwei3 - $Textnachtd2</td></tr></table>";

// Mittwoch
$zu1m= "<table border=0><tr><td>$institution $einszwei1  $TextFruehm</td></tr></table>";

$zu2m= "<table  border=0><tr><td>$institution  $einszwei2   $Textspaetm</td></tr></table>";

$zu3m= "<table  border=0><tr><td >$institution $einszwei3  $Textnachtm</td></tr></table>";


$zu4m= "<table border=0><tr><td>$institution $einszwei1  $TextFruehm2</td></tr></table>";
$zu5m= "<table  border=0><tr><td >$institution $einszwei3  $Textnachtm2</td></tr></table>";

// Donnerstag
$zu1do= "<table border=0><tr><td>$institution $einszwei1 - $TextFruehdo</td></tr></table>";

$zu2do= "<table  border=0><tr><td>$institution $einszwei2 - $Textspaetdo</td></tr></table>";

$zu3do= "<table  border=0><tr><td >$institution $einszwei3 - $Textnachtdo</td></tr></table>";


$zu4do= "<table border=0><tr><td>$institution2 $einszwei1 - $TextFruehdo2</td></tr></table>";
$zu5do= "<table  border=0><tr><td >$institution2 $einszwei3 - $Textnachtdo2</td></tr></table>";


// Freitag
$zu1f= "<table border=0><tr><td>$institution $einszwei1 - $TextFruehf</td></tr></table>";

$zu2f= "<table  border=0><tr><td>$institution $einszwei2 - $Textspaetf</td></tr></table>";

$zu3f= "<table  border=0><tr><td >$institution $einszwei3 - $Textnachtf</td></tr></table>";

$zu9= "<table  border=0><tr><td>$institution $einszwei3 - $Textnachtfreitag</td></tr></table>";


$zu4f= "<table border=0><tr><td>$institution $einszwei1 - $TextFruehf2</td></tr></table>";
$zu5f= "<table  border=0><tr><td >$institution $einszwei3 - $Textnachtf2</td></tr></table>";


//Samstag Texte---------------------------------------
$zu3s= "<table  border=0><tr><td>$institution $einszwei1  $TextSFrueh</td></tr></table>";
$zu2s= "<table  border=0><tr><td>$institution $einszwei3  $TextSspaet</td></tr></table>";
$zu1s= "<table  border=0><tr><td>$institution $einszwei2  $TextSnacht</td></tr></table>";

$zu4s= "<table  border=0><tr><td>$institution $einszwei1  $TextSFrueh2</td></tr></table>";
$zu5s= "<table  border=0><tr><td>$institution $einszwei2  $TextSnacht2</td></tr></table>";


// Sonntag
 $zu1so= "<table border=0><tr><td>$institution $einszwei1 - $TextFruehso</td></tr></table>";

 $zu2so= "<table  border=0><tr><td>$institution $einszwei2 - $Textspaetso</td></tr></table>";

 $zu3so= "<table  border=0><tr><td >$institution $einszwei3 - $Textnachtso</td></tr></table>";

 
$zu4so= "<table border=0><tr><td>$institution $einszwei1 - $TextFruehso2</td></tr></table>";
 $zu5so= "<table  border=0><tr><td >$institution $einszwei3 - $Textnachtso2</td></tr></table>";






// Tage komplett geschlossen
$zudodo1= "$Textdodo1<br>";
$zudodo2= "$Textdodo2<br>";
$zudofr1= "$Textdofr1<br>";
$zudofr2= "$Textdofr2<br>";
$zudosa1= "$Textdosa1<br>";
$zudosa2= "$Textdosa2<br>";
$zudoso1= "$Textdoso1<br>";
$zudoso2= "$Textdoso2<br>";
$zudomo1= "$Textdomo1<br>";
$zudomo2= "$Textdomo2 <br> ";
$zudodi1= "$Textdodi1<br>";
$zudodi2= "$Textdodi2<br>";
$zudomi1= " $Textdomi1<br>";
$zudomi2= "$Textdomi2<br>";


// 2ter Teil erster Satz:
$offen1= "<table  border=0><tr><td>$institution <b> $geoeffnet</td></tr></table>";

$offen2= "<table  border=0><tr><td>$institution $geoeffnet</td></tr></table>";












// Ampeldeaktivierungstext:



$handle = fopen('../scripte/texte/deaktivierungoffen.txt', 'r');
  $text2 = fread($handle,100) ;
  fclose($handle) ;
$handle = fopen('../scripte/texte/deaktivierungzu.txt', 'r');
  $text = fread($handle,100) ;
  fclose($handle) ;


// Ende Konfiguration!!!!!!!!


$handle = fopen('../scripte/texte/geschlossenwochenuebersicht.txt', 'r');
  $geschlossenxxx = fread($handle,140) ;
  fclose($handle) ;











//Die Funktion unterteilt nach Wochentagen und der Uhrzeit

//Variablen

$Tag = date("d");
$Monat = date("m");
$Jahr= date("Y");
$Datum = date("r");
$time = date("H.i"); 
$d = date("D");date("G");date("r");

switch ($d)
{





 

case  1 == 1:

echo (" <center><table border=3 ><tr><td> $ampelwoche </td></tr><tr><td>");




if ($time1x == $geschlossen)    echo ("$format $montag: $geschlossenxxx <br>");
else if ($time2x == $geschlossen) echo ("$zudomo2  ");
else echo (" $TextFrueh  <br> ");

if ($timed1x == $geschlossen)    echo ("$format $dienstag: $geschlossenxxx <br>");
else if ($timed2x == $geschlossen) echo (" $format $zudodi2 ");
else echo (" $format  $TextFruehd <br>");

if ($timem1x == $geschlossen)    echo ("$format $mittwoch: $geschlossenxxx <br>");
else if ($timem2x == $geschlossen) echo ("$format $zudomi2 ");
else echo ("$TextFruehm <br>");

if ($timedo1x == $geschlossen)    echo ("$format $donnerstag: $geschlossenxxx <br>");
else if ($timedo2x == $geschlossen) echo ("$format $zudodo2 ");
else echo ("$TextFruehdo <br>");

if ($timef1x == $geschlossen)    echo ("$format $freitag: $geschlossenxxx <br>");
else if ($timef2x == $geschlossen) echo ("$format $zudofr2 ");
else echo ("$TextFruehf <br>");

if ($times6x == $geschlossen)    echo ("$format $samstag: $geschlossenxxx  <br>");
else if ($times7x == $geschlossen) echo ("$format$zudosa2 ");
else echo ("$TextSFrueh  <br>");

if ($timeso1x == $geschlossen)    echo ("$format  $sonntag: $geschlossenxxx <br>");
else if ($timeso2x == $geschlossen) echo ("$format $zudoso2 ");
else echo ("$TextFruehso <br>");


echo (" </tr></td></table></center>");

break;



}



//End
?>
</body>
</html>
Return current item: Opening hours