add schichtlan durchsroolen
git-svn-id: svn://svn.cccv.de/engel-system@13 29ba0400-6e00-0410-a75a-ca02368028f8
This commit is contained in:
parent
65214f378f
commit
abf811c604
|
@ -0,0 +1,74 @@
|
|||
<?PHP
|
||||
|
||||
function DatumUm1TagErhoehen( $Datum)
|
||||
{
|
||||
$Jahr = substr( $Datum, 0, 4);
|
||||
$Monat = substr( $Datum, 5, 2);
|
||||
$Tag = substr( $Datum, 8, 2);
|
||||
|
||||
$Tag++;
|
||||
|
||||
switch( $Monat)
|
||||
{
|
||||
case 1: $Mmax=31; break;
|
||||
case 2: $Mmax=28; break;
|
||||
case 3: $Mmax=31; break;
|
||||
case 4: $Mmax=30; break;
|
||||
case 5: $Mmax=31; break;
|
||||
case 6: $Mmax=30; break;
|
||||
case 7: $Mmax=31; break;
|
||||
case 8: $Mmax=31; break;
|
||||
case 9: $Mmax=30; break;
|
||||
case 10: $Mmax=31; break;
|
||||
case 11: $Mmax=30; break;
|
||||
case 12: $Mmax=31; break;
|
||||
}
|
||||
|
||||
if( $Tag > $Mmax)
|
||||
{
|
||||
$Tag = 1;
|
||||
$Monat++;
|
||||
}
|
||||
|
||||
if( $Monat > 12 )
|
||||
{
|
||||
$Monat = 1;
|
||||
$Jahr++;
|
||||
}
|
||||
|
||||
return ("$Jahr-$Monat-$Tag");
|
||||
} //function DatumUm1Tagerhoehen(
|
||||
|
||||
//suchen den ersten eintrags
|
||||
$SQL = "SELECT `DateS` FROM `Shifts` ORDER BY `DateS` LIMIT 1";
|
||||
$Erg = mysql_query($SQL, $con);
|
||||
|
||||
$Pos=0;
|
||||
do
|
||||
{
|
||||
//Startdatum einlesen und link ausgeben
|
||||
$DateS = substr(mysql_result($Erg, 0 , 0), 0,10);
|
||||
$VeranstaltungsTage[$Pos++] = $DateS;
|
||||
|
||||
//auslesen den endes und eventuelle weitere tage ausgeben
|
||||
$SQL2 = "SELECT MAX(`DateE`) FROM `Shifts` ".
|
||||
"WHERE ( (`DateS` like '$DateS%') AND NOT (`DateE` like '%00:00:00'))";
|
||||
$Erg2 = mysql_query($SQL2, $con);
|
||||
$DateE = substr(mysql_result($Erg2, 0 , 0), 0,10);
|
||||
|
||||
while( $DateS != $DateE)
|
||||
{
|
||||
$DateS = DatumUm1TagErhoehen( $DateS);
|
||||
$VeranstaltungsTage[$Pos++] = $DateS;
|
||||
}
|
||||
|
||||
//suchen den nästen eintrag
|
||||
$SQL = "SELECT `DateS` FROM `Shifts` ".
|
||||
"WHERE (`DateS` > '$DateE 23:59:59' ) ".
|
||||
"ORDER BY `DateS` ".
|
||||
"LIMIT 1";
|
||||
$Erg = mysql_query($SQL, $con);
|
||||
} while( mysql_fetch_row($Erg) > 0);
|
||||
$VeranstaltungsTageMax = $Pos-1;
|
||||
|
||||
?>
|
|
@ -2,45 +2,6 @@
|
|||
|
||||
<?
|
||||
|
||||
function DatumUm1TagErhoehen( $Datum)
|
||||
{
|
||||
$Jahr = substr( $Datum, 0, 4);
|
||||
$Monat = substr( $Datum, 5, 2);
|
||||
$Tag = substr( $Datum, 8, 2);
|
||||
|
||||
$Tag++;
|
||||
|
||||
switch( $Monat)
|
||||
{
|
||||
case 1: $Mmax=31; break;
|
||||
case 2: $Mmax=28; break;
|
||||
case 3: $Mmax=31; break;
|
||||
case 4: $Mmax=30; break;
|
||||
case 5: $Mmax=31; break;
|
||||
case 6: $Mmax=30; break;
|
||||
case 7: $Mmax=31; break;
|
||||
case 8: $Mmax=31; break;
|
||||
case 9: $Mmax=30; break;
|
||||
case 10: $Mmax=31; break;
|
||||
case 11: $Mmax=30; break;
|
||||
case 12: $Mmax=31; break;
|
||||
}
|
||||
|
||||
if( $Tag > $Mmax)
|
||||
{
|
||||
$Tag = 1;
|
||||
$Monat++;
|
||||
}
|
||||
|
||||
if( $Monat > 12 )
|
||||
{
|
||||
$Monat = 1;
|
||||
$Jahr++;
|
||||
}
|
||||
|
||||
return ("$Jahr-$Monat-$Tag");
|
||||
} //function DatumUm1Tagerhoehen(
|
||||
|
||||
function Printlink( $Datum)
|
||||
{
|
||||
GLOBAL $raum;
|
||||
|
@ -51,34 +12,9 @@ function Printlink( $Datum)
|
|||
echo "'>$Datum</a></li>\n";
|
||||
} //function Printlink(
|
||||
|
||||
//suchen den ersten eintrags
|
||||
$SQL = "SELECT `DateS` FROM `Shifts` ORDER BY `DateS` LIMIT 1";
|
||||
$Erg = mysql_query($SQL, $con);
|
||||
|
||||
do
|
||||
foreach( $VeranstaltungsTage as $k => $v)
|
||||
{
|
||||
//Startdatum einlesen und link ausgeben
|
||||
$DateS = substr(mysql_result($Erg, 0 , 0), 0,10);
|
||||
Printlink( $DateS);
|
||||
|
||||
//auslesen den endes und eventuelle weitere tage ausgeben
|
||||
$SQL2 = "SELECT MAX(`DateE`) FROM `Shifts` ".
|
||||
"WHERE ( (`DateS` like '$DateS%') AND NOT (`DateE` like '%00:00:00'))";
|
||||
$Erg2 = mysql_query($SQL2, $con);
|
||||
$DateE = substr(mysql_result($Erg2, 0 , 0), 0,10);
|
||||
|
||||
while( $DateS != $DateE)
|
||||
{
|
||||
$DateS = DatumUm1TagErhoehen( $DateS);
|
||||
Printlink( $DateS);
|
||||
Printlink( $v);
|
||||
}
|
||||
|
||||
//suchen den nästen eintrag
|
||||
$SQL = "SELECT `DateS` FROM `Shifts` ".
|
||||
"WHERE (`DateS` > '$DateE 23:59:59' ) ".
|
||||
"ORDER BY `DateS` ".
|
||||
"LIMIT 1";
|
||||
$Erg = mysql_query($SQL, $con);
|
||||
} while( mysql_fetch_row($Erg) > 0);
|
||||
|
||||
?>
|
||||
|
|
|
@ -6,6 +6,7 @@ include ("./inc/header.php");
|
|||
include ("./inc/funktion_user.php");
|
||||
include ("./inc/funktionen.php");
|
||||
include ("./inc/funktion_schichtplan.php");
|
||||
include ("./inc/funktion_schichtplan_Tage.php");
|
||||
?>
|
||||
|
||||
<? echo Get_Text("Hello").$_SESSION['Nick'].",<br>".
|
||||
|
@ -13,6 +14,26 @@ include ("./inc/funktion_schichtplan.php");
|
|||
<br><br>
|
||||
<?
|
||||
|
||||
function ShowSwitchDay()
|
||||
{
|
||||
GLOBAL $VeranstaltungsTage, $VeranstaltungsTageMax, $ausdatum, $raum;
|
||||
|
||||
echo "\n\n<table border=\"0\" width=\"100%\"><tr>\n";
|
||||
|
||||
foreach( $VeranstaltungsTage as $k => $v)
|
||||
if( $ausdatum == $v)
|
||||
{
|
||||
if( $k > 0)
|
||||
echo "\t\t\t<td align=\"left\">".
|
||||
"<a href='./schichtplan.php?ausdatum=". $VeranstaltungsTage[$k-1].
|
||||
"&raum=$raum'>". $VeranstaltungsTage[$k-1]. "</a></td>\n";
|
||||
if( $k < $VeranstaltungsTageMax)
|
||||
echo "\t\t\t<td align=\"right\">".
|
||||
"<a href='./schichtplan.php?ausdatum=". $VeranstaltungsTage[$k+1].
|
||||
"&raum=$raum'>". $VeranstaltungsTage[$k+1]. "</a></td>\n";
|
||||
}
|
||||
echo "\n\n</table>";
|
||||
}
|
||||
|
||||
// wenn kein Datum gesetzt ist (die Seite zum ersten mal aufgerufen wird),
|
||||
// das Datum auf den ersten Tag setzen...
|
||||
|
@ -60,6 +81,8 @@ else
|
|||
echo Get_Text("pub_schicht_Anzeige_1"). $ausdatum.
|
||||
Get_Text("pub_schicht_Anzeige_2"). $RoomID[$raum]. "<br><br>";
|
||||
|
||||
ShowSwitchDay();
|
||||
|
||||
echo "\n\n<table border=\"0\" width=\"100%\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n";
|
||||
echo "\t<tr class=\"contenttopic\">\n";
|
||||
echo "\t\t<td>start</td>\n";
|
||||
|
@ -116,6 +139,9 @@ else
|
|||
echo $Spalten[$i]."\t</tr>\n";
|
||||
|
||||
echo "</table>\n";
|
||||
|
||||
ShowSwitchDay();
|
||||
|
||||
}//if (isset($raum))
|
||||
|
||||
include ("./inc/footer.php");
|
||||
|
|
Loading…
Reference in New Issue