edit
\n\t\t";
}
///////////////////////////////////////////////////////////////////
// Ausgabe des Schischtnamens
///////////////////////////////////////////////////////////////////
$SQL = "SELECT `URL` FROM `Shifts` WHERE (`SID` = '$SID');";
$Erg = mysql_query($SQL, $con);
if( mysql_result($Erg, 0, 0) != "")
$Spalten.="$Man:
";
else
$Spalten.="".$Man.":
";
///////////////////////////////////////////////////////////////////
// SQL abfrage für die benötigten schichten
///////////////////////////////////////////////////////////////////
$SQL = "SELECT * FROM `ShiftEntry` WHERE (`SID` = '$SID') ORDER BY `TID`, `UID` DESC ;";
$Erg = mysql_query($SQL, $con);
$Anzahl = mysql_num_rows($Erg);
$Feld=0;
$Temp_TID_old=-1;
for( $i = 0; $i < $Anzahl; $i++ )
{
if( isset($Temp[$Feld]["TID"]))
$Temp_TID_old = $Temp[$Feld]["TID"];
if( isset($Temp[$Feld]["UID"]))
$Temp_UID_old = $Temp[$Feld]["UID"];
$Temp_TID = mysql_result($Erg, $i, "TID");
// wenn sich der Type ändert wird zumnästen feld geweckselt
if( $Temp_TID_old != $Temp_TID )
$Feld++;
$Temp[$Feld]["TID"] = $Temp_TID;
$Temp[$Feld]["UID"] = mysql_result($Erg, $i, "UID");
// sonderfall ersten durchlauf
if( $i == 0 )
{
$Temp_TID_old = $Temp[$Feld]["TID"];
$Temp_UID_old = $Temp[$Feld]["UID"];
}
// ist es eine zu vergeben schicht?
if( $Temp[$Feld]["UID"] == 0 )
{
if( isset($Temp[$Feld]["free"]))
$Temp[$Feld]["free"]++;
else
$Temp[$Feld]["free"]=1;
}
else
$Temp[$Feld]["Engel"][] = $Temp[$Feld]["UID"];
} // FOR
///////////////////////////////////////////////////////////////////
// Aus gabe der Schicht
///////////////////////////////////////////////////////////////////
if( isset($Temp))
if( count($Temp) )
foreach( $Temp as $TempEntry => $TempValue )
{
if( !isset($TempValue["free"]))
$TempValue["free"] = 0;
// ausgabe EngelType
$Spalten.= $EngelTypeID[ $TempValue["TID"] ]. " ";
// ausgabe Eingetragener Engel
if( isset($TempValue["Engel"]))
if( count($TempValue["Engel"]) > 0 )
{
if( count($TempValue["Engel"]) == 1 )
$Spalten.= Get_Text("inc_schicht_ist"). ":
\n\t\t";
else
$Spalten.= Get_Text("inc_schicht_sind"). ":
\n\t\t";
foreach( $TempValue["Engel"] as $TempEngelEntry=> $TempEngelID )
{
if( $_SESSION['CVS'][ "admin/schichtplan.php" ] == "Y" )
{
if( UIDgekommen( $TempEngelID ) == "1")
$Spalten.= " ".
UID2Nick( $TempEngelID ).
DisplayAvatar( $TempEngelID ).
"
\n\t\t";
else
$Spalten.= " ".
UID2Nick( $TempEngelID ).
DisplayAvatar( $TempEngelID ).
"
\n\t\t";
}
else
$Spalten.= " ". UID2Nick( $TempEngelID ).
DisplayAvatar( $TempEngelID ).
"
\n\t\t";
}
$Spalten = substr( $Spalten, 0, strlen($Spalten)-7 );
}
// ausgabe benötigter Engel
////////////////////////////
//in vergangenheit
$SQLtime = "SELECT `DateE` FROM `Shifts` WHERE (SID='$SID' AND `DateE` >= '".
gmdate("Y-m-d H:i:s", time()+ 3600). "')";
$Ergtime = mysql_query($SQLtime, $con);
if( mysql_num_rows( $Ergtime) > 0)
{
// $EngelTypeID[$TempValue["TID"]]
$SQLerlaubnis = "SELECT Name FROM `EngelType` WHERE TID = '". $TempValue["TID"]. "'";
$Ergerlaubnis = mysql_query( $SQLerlaubnis, $con);
if( mysql_num_rows( $Ergerlaubnis))
{
//wenn keien rechte definiert sind
if( !isset($_SESSION['CVS'][mysql_result( $Ergerlaubnis, 0, "Name")]))
$_SESSION['CVS'][mysql_result( $Ergerlaubnis, 0, "Name")] = "Y";
if( $_SESSION['CVS'][mysql_result( $Ergerlaubnis, 0, "Name")] == "Y")
if( $TempValue["free"] > 0 )
{
$Spalten.= "
\n\t\t ";
$Spalten.= $TempValue["free"];
if( $TempValue["free"] != 1 )
$Spalten.= Get_Text("inc_schicht_weitere").
" ".Get_Text("inc_schicht_Engel").
Get_Text("inc_schicht_wird");
else
$Spalten.= Get_Text("inc_schicht_weiterer").
" ".Get_Text("inc_schicht_Engel").
Get_Text("inc_schicht_werden");
$Spalten.= Get_Text("inc_schicht_noch_gesucht");
$Spalten.= "";
}
}
}
else
{
if( isset($TempValue["free"]))
if( $TempValue["free"] > 0 )
$Spalten.= "
\n\t\t
". Get_Text("inc_schicht_date"). " | \n"; echo "\t". Get_Text("inc_schicht_time"). " | \n"; echo "\t". Get_Text("inc_schicht_room"). " | \n"; echo "\t". Get_Text("inc_schicht_commend"). " | \n"; echo "
---|---|---|---|
". substr(mysql_result( $Erg, $i, "DateS"), 0, 10). " | \n"; echo "\t". substr(mysql_result( $Erg, $i, "DateS"), 11). " | \n"; echo "\t". $RoomID[mysql_result( $Erg, $i, "RID")]. " | \n"; echo "\t". ausgabe_Feld_Inhalt( mysql_result( $Erg, $i, "SID"), mysql_result( $Erg, $i, "Man")). " | \n"; echo "