summaryrefslogtreecommitdiff
path: root/admin/free.php
diff options
context:
space:
mode:
authorcookie <cookie@29ba0400-6e00-0410-a75a-ca02368028f8>2005-09-10 17:25:43 +0000
committercookie <cookie@29ba0400-6e00-0410-a75a-ca02368028f8>2005-09-10 17:25:43 +0000
commit310c2ce98fc8c0e94559c9ed8587101d92f6e853 (patch)
tree7093065a133e434fb7e551803e8700661d04c5bb /admin/free.php
add total system
git-svn-id: svn://svn.cccv.de/engel-system@1 29ba0400-6e00-0410-a75a-ca02368028f8
Diffstat (limited to 'admin/free.php')
-rwxr-xr-xadmin/free.php108
1 files changed, 108 insertions, 0 deletions
diff --git a/admin/free.php b/admin/free.php
new file mode 100755
index 00000000..1e7bd259
--- /dev/null
+++ b/admin/free.php
@@ -0,0 +1,108 @@
+<?PHP
+
+$title = "Erzengel";
+$header = "Freie Engel";
+include ("./inc/header.php");
+include ("./inc/funktion_db_list.php");
+include ("./inc/funktion_user.php");
+
+
+echo "Hallo ".$_SESSION['Nick'].",<br>\n";
+
+?>
+hier findest du alle Engel, welche zur Zeit in Schichten verplant sind:
+<br><br>
+
+
+<?
+#######################################################
+# Ermitteln freier Engel
+#
+# auslesen aller Engel und dazugehoerige Schichten
+#######################################################
+
+// $SQL= "SELECT User.Nick, Schichtplan.*, Schichtbelegung. * FROM User LEFT JOIN Schichtplan ON User.UID=Schichtbelegung.UID, Schichtplan.SID LEFT JOIN Schichtbelegung.SID WHERE User.UID = Schichtbelegung.UID AND Schichtplan.SID = Schichtbelegung.SID AND Schichtplan.Date < now() and Schichtplan.EndDate > now() ORDER BY Nick";
+
+/* geht nicht ??? unter stabel !!
+$SQL= "SELECT User.Nick, Schichtplan.*, Schichtbelegung.* ".
+ "FROM Schichtplan, User LEFT OUTER ".
+ "JOIN Schichtbelegung ON User.UID=Schichtbelegung.UID ".
+ "WHERE Schichtplan.SID = Schichtbelegung.SID AND ".
+ "Schichtplan.Date < now() and ".
+ "Schichtplan.EndDate > now() ".
+ "ORDER BY Nick";
+
+$SQL = "SELECT Shifts.*, ShiftEntry.*, User.Nick ".
+ "FROM User ".
+ "INNER JOIN (Shifts INNER JOIN ShiftEntry ON Shifts.SID = ShiftEntry.SID) ON User.UID = ShiftEntry.UID ".
+ "WHERE (Shifts.DateS<=Now() AND Shifts.DateE>=Now() );";
+*/
+$SQL = "SELECT Shifts.*, ShiftEntry.* ".
+ "FROM Shifts INNER JOIN ShiftEntry ON Shifts.SID = ShiftEntry.SID ".
+ "WHERE (Shifts.DateS<=Now() AND Shifts.DateE>=Now() );";
+
+//SELECT User.Nick, Schichtplan.*, Schichtbelegung. * FROM User LEFT JOIN Schichtbelegung ON User.UID=Schichtbelegung.UID, Schichtplan LEFT JOIN Schichtbelegung ON Schichtplan.SID = Schichtbelegung.SID WHERE Schichtplan.Date < now() and Schichtplan.EndDate > now() ORDER BY Nick
+
+//echo "<pre>$SQL</pre>";
+
+$Erg = mysql_query($SQL, $con);
+$Zeilen = mysql_num_rows($Erg);
+
+// for ($i = 1; $i < mysql_num_fields($Erg); $i++)
+// echo "|".mysql_field_name($Erg, $i);
+
+
+
+echo "<table width=\"100%\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n";
+echo "\t<tr class=\"contenttopic\">\n";
+echo "\t\t<td>Nick</td>\n";
+echo "\t\t<td>Schicht</td>\n";
+echo "\t\t<td>Ort</td>\n";
+echo "\t\t<td>Von</td>\n";
+echo "\t\t<td>Bis</td>\n";
+echo "\t</tr>\n";
+
+
+$inuse="";
+for ($i=0; $i < $Zeilen; $i++)
+{
+ echo "<tr class=\"content\">\n";
+ echo "<td><a href=\"./user.php?Type=Normal&enterUID=". mysql_result($Erg, $i, "UID"). "\">".
+ mysql_result($Erg, $i, "Nick"). "</td></a>\n";
+ echo "<td>". UID2Nick(mysql_result($Erg, $i, "UID")). "</td>\n";
+ echo "<td>". mysql_result($Erg, $i, "RID"). "</td>\n";
+ echo "<td>". mysql_result($Erg, $i, "DateS"). "</td>\n";
+ echo "<td>". mysql_result($Erg, $i, "DateE"). "</td>\n";
+ echo "</tr>\n";
+
+ if ($inuse!="")
+ $inuse.= " OR ";
+ $inuse.= "(Nick = \"". UID2Nick(mysql_result($Erg, $i, "UID")). "\")";
+}
+if ($inuse!="")
+ $inuse=" WHERE NOT (".$inuse.")";
+echo "</table>\n";
+
+
+//##########################################################################################################
+
+echo "<br><br>\n\nhier findest du alle Engel, welche zur Zeit in keiner Schichten verplant sind:<br><br>\n";
+echo "<table width=\"100%\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\"\>\n";
+echo "\t<tr class=\"contenttopic\">\n\t\t<td>Nick</td>\n\t\t<td>DECT</td>\n\t</tr>\n";
+
+$SQL = "SELECT Nick, UID, DECT FROM User".$inuse.";";
+$Erg = mysql_query($SQL, $con);
+$Zeilen = mysql_num_rows($Erg);
+for ($i=0; $i < $Zeilen; $i++)
+{
+ echo "\t<tr class=\"content\">\n";
+ echo "\t\t<td><a href=\"./user.php?Type=Normal&enterUID=". mysql_result($Erg, $i, "UID"). "\">".
+ mysql_result($Erg, $i, "Nick"). "</a></td>\n";
+ echo "\t\t<td>". mysql_result($Erg, $i, "DECT"). "</td>\n";
+ echo "\n</tr>\n";
+}
+echo "</table>\n";
+
+include ("./inc/footer.php");
+?>
+