2008-12-27 15:52:22 +01:00
|
|
|
<?PHP
|
|
|
|
|
|
|
|
include ("../../includes/config_db.php");
|
|
|
|
include ("../../includes/funktion_db_list.php");
|
2008-12-28 17:07:20 +01:00
|
|
|
include ("../../includes/funktion_user.php");
|
2008-12-27 15:52:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
#######################################################
|
|
|
|
# Ermitteln freier Engel
|
|
|
|
#
|
|
|
|
# auslesen aller Engel und dazugehoerige Schichten
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
$SQL = "SELECT Shifts.*, ShiftEntry.* ".
|
|
|
|
"FROM `Shifts` INNER JOIN ShiftEntry ON Shifts.SID = ShiftEntry.SID ".
|
|
|
|
"WHERE (Shifts.DateS<=Now() AND Shifts.DateE>=Now() AND ShiftEntry.UID>0);";
|
|
|
|
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
$Zeilen = mysql_num_rows($Erg);
|
|
|
|
|
|
|
|
$inuse="";
|
|
|
|
for ($i=0; $i < $Zeilen; $i++)
|
|
|
|
{
|
|
|
|
if ($inuse!="")
|
|
|
|
$inuse.= " OR ";
|
|
|
|
$inuse.= "(UID = \"". mysql_result($Erg, $i, "UID"). "\")";
|
|
|
|
}
|
|
|
|
if ($inuse!="")
|
2008-12-28 17:07:20 +01:00
|
|
|
{
|
2008-12-27 15:52:22 +01:00
|
|
|
$inuse=" WHERE (NOT (".$inuse.")) AND (DECT!='')";
|
2008-12-28 17:07:20 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$inuse=" WHERE (DECT!='')";
|
|
|
|
}
|
2008-12-27 15:52:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
//##########################################################################################################
|
|
|
|
|
|
|
|
$SQL = "SELECT * FROM User".$inuse.";";
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
$Zeilen = mysql_num_rows($Erg);
|
|
|
|
for ($i=0; $i < $Zeilen; $i++)
|
|
|
|
{
|
2008-12-28 17:07:20 +01:00
|
|
|
// get DECT number
|
|
|
|
echo mysql_result($Erg, $i, "DECT"). "\t";
|
|
|
|
|
|
|
|
// get all user rights
|
2008-12-27 15:52:22 +01:00
|
|
|
$SQL_RIGHT = "SELECT * FROM UserCVS WHERE UID=". mysql_result($Erg, $i, "UID"). ";";
|
|
|
|
$Erg_RIGHT = mysql_query($SQL_RIGHT, $con);
|
2008-12-28 17:07:20 +01:00
|
|
|
$UserRights = mysql_fetch_array($Erg_RIGHT);
|
|
|
|
|
|
|
|
foreach( $UserRights as $Var => $Value)
|
|
|
|
{
|
|
|
|
if( (strpos( $Var, ".php") === false) AND
|
|
|
|
(strpos( $Var, "/") === false) AND
|
|
|
|
(strpos( $Var, "UID") === false) AND
|
|
|
|
(is_numeric($Var) === false) )
|
|
|
|
{
|
|
|
|
echo "\"".$Var. "\"=". $Value. "\t";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// get shift types
|
|
|
|
$SQL_TYPES = "SELECT TID FROM `ShiftEntry` WHERE UID=". mysql_result($Erg, $i, "UID"). " GROUP BY TID;";
|
|
|
|
$Erg_TYPES = mysql_query($SQL_TYPES, $con);
|
2008-12-28 17:36:05 +01:00
|
|
|
$Zeilen_Typen = mysql_num_rows($Erg_TYPES);
|
|
|
|
for ($i=0; $i < $Zeilen_Typen; $i++)
|
2008-12-28 17:07:20 +01:00
|
|
|
{
|
2008-12-28 17:36:05 +01:00
|
|
|
echo "\"TID_". TID2Type( mysql_result($Erg_TYPES, $i, "TID")). "\"=Y\t";
|
2008-12-28 17:07:20 +01:00
|
|
|
}
|
2008-12-27 15:52:22 +01:00
|
|
|
|
|
|
|
echo "\n";
|
2008-12-28 17:36:05 +01:00
|
|
|
echo "<br>";
|
2008-12-27 15:52:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|