diff options
author | Philip Häusler <msquare@notrademark.de> | 2011-06-13 18:05:51 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2011-06-13 18:05:51 +0200 |
commit | 04973d1fa148381978b1251d10118e6bab86f435 (patch) | |
tree | 39f5a304342054e9da8c0452866b4f6eb69f87af /www-ssl_old | |
parent | 89fd736f36dc89becacc30dc250d7a3e93e9569f (diff) |
moved public files to public, old and yet untouched files to directories ending with _old
Diffstat (limited to 'www-ssl_old')
22 files changed, 2596 insertions, 0 deletions
diff --git a/www-ssl_old/ShowUserPicture.php b/www-ssl_old/ShowUserPicture.php new file mode 100644 index 00000000..5a222c07 --- /dev/null +++ b/www-ssl_old/ShowUserPicture.php @@ -0,0 +1,56 @@ +<?php +// Momentan keine Avatar-Funktionen +die(); + +require_once ('bootstrap.php'); + +include "config/config.php"; +include "includes/error_handler.php"; +include "config/config_db.php"; + +if (!isset ($_SESSION)) + session_start(); + +include "includes/secure.php"; + +// Parameter check +if (!isset ($_GET["UID"])) + $_GET["UID"] = "-1"; + +$SQL = "SELECT * FROM `UserPicture` WHERE `UID`='" . $_GET["UID"] . "'"; +$res = mysql_query($SQL, $con); + +if (mysql_num_rows($res) == 1) { + // genuegend rechte + if (!isset ($_SESSION['UID']) || $_SESSION['UID'] == -1) { + header("HTTP/1.0 403 Forbidden"); + die("403 Forbidden"); + } + + // ist das bild sichtbar? + if ((mysql_result($res, 0, "show") == "N") AND ($_SESSION['UID'] != $_GET["UID"]) AND ($_SESSION['CVS']["admin/UserPicture.php"] == "N")) { + $SQL = "SELECT * FROM `UserPicture` WHERE `UID`='-1'"; + $res = mysql_query($SQL, $con); + + if (mysql_num_rows($res) != 1) { + header("HTTP/1.0 404 Not Found"); + die("404 Not Found"); + } + } + + // bild aus db auslesen + $bild = mysql_result($res, 0, "Bild"); + + // ausgabe bild + header("Accept-Ranges: bytes"); + header("Content-Length: " . strlen($bild)); + header("Content-type: " . mysql_result($res, 0, "ContentType")); + header("Cache-control: public"); + header("Cache-request-directive: min-fresh = 120"); + header("Cache-request-directive: max-age = 360"); + echo $bild; +} else { + header("HTTP/1.0 404 Not Found"); + die("404 Not Found"); +} +?> diff --git a/www-ssl_old/admin/UserPicture.php b/www-ssl_old/admin/UserPicture.php new file mode 100644 index 00000000..25f8b54b --- /dev/null +++ b/www-ssl_old/admin/UserPicture.php @@ -0,0 +1,132 @@ +<?php +require_once ('../bootstrap.php'); + +$title = "UserPicture"; +$header = "Verwaltung der User Picture"; + +include ("includes/header.php"); +include ("includes/funktion_schichtplan_aray.php"); + +if (IsSet ($_GET["action"])) { + UnSet ($SQL); + + switch ($_GET["action"]) { + case 'FormUpload' : + echo "Hier kannst Du ein Foto hochladen för:"; + echo "<form action=\"./UserPicture.php?action=sendPicture\" method=\"post\" enctype=\"multipart/form-data\">\n"; + echo "\t<select name=\"UID\">\n"; + $usql = "SELECT * FROM `User` ORDER BY `Nick`"; + $uErg = mysql_query($usql, $con); + for ($k = 0; $k < mysql_num_rows($uErg); $k++) + echo "\t\t<option value=\"" . mysql_result($uErg, $k, "UID") . "\">" . mysql_result($uErg, $k, "Nick") . "</option>\n"; + echo "\t</select>\n"; + echo "\t<input type=\"hidden\" name=\"action\" value=\"sendPicture\">\n"; + echo "\t<input name=\"file\" type=\"file\" size=\"50\" maxlength=\"" . get_cfg_var("post_max_size") . "\">\n"; + echo "\t(max " . get_cfg_var("post_max_size") . "Byte)<br />\n"; + echo "\t<input type=\"submit\" value=\"" . Get_Text("upload"), "\">\n"; + echo "</form>\n"; + break; + case 'sendPicture' : + if (($_FILES["file"]["size"] > 0) && (isset ($_POST["UID"]))) { + if (($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/gif")) { + $data = addslashes(fread(fopen($_FILES["file"]["tmp_name"], "r"), filesize($_FILES["file"]["tmp_name"]))); + + if (GetPicturShow($_POST['UID']) == "") + $SQL = "INSERT INTO `UserPicture` " . + "( `UID`,`Bild`, `ContentType`, `show`) " . + "VALUES ('" . $_POST['UID'] . "', '$data', '" . $_FILES["file"]["type"] . "', 'N')"; + else + $SQL = "UPDATE `UserPicture` SET " . + "`Bild`='$data', " . + "`ContentType`='" . $_FILES["file"]["type"] . "' " . + "WHERE `UID`='" . $_POST['UID'] . "'"; + + echo "Upload Pictur:'" . $_FILES["file"]["name"] . "', " . + "MIME-Type: " . $_FILES["file"]["type"] . ", " . + $_FILES["file"]["size"] . " Byte " . + "for " . UID2Nick($_POST["UID"]); + } else + Print_Text("pub_einstellungen_send_KO"); + } else + Print_Text("pub_einstellungen_send_KO"); + break; + + case 'SetN' : + if (IsSet ($_GET["UID"])) { + echo "Bild von '" . UID2Nick($_GET["UID"]) . "' wurde gesperrt:<br />"; + $SQL = "UPDATE `UserPicture` SET `show`='N' WHERE `UID`='" . $_GET["UID"] . "'"; + } else + echo "Fehlerhafter Aufruf"; + break; + case 'SetY' : + if (IsSet ($_GET["UID"])) { + echo "Bild von '" . UID2Nick($_GET["UID"]) . "' wurde Freigegeben:<br />"; + $SQL = "UPDATE `UserPicture` SET `show`='Y' WHERE `UID`='" . $_GET["UID"] . "'"; + } else + echo "Fehlerhafter Aufruf"; + break; + case 'del' : + echo "Wollen Sie das Bild von '" . UID2Nick($_GET["UID"]) . "' wirklich löschen? " . + "<a href=\"./UserPicture.php?action=delYes&UID=" . $_GET["UID"] . "\">Yes</a>"; + break; + case 'delYes' : + if (IsSet ($_GET["UID"])) { + echo "Bild von '" . UID2Nick($_GET["UID"]) . "' wurde gelöscht:<br />"; + $SQL = "DELETE FROM `UserPicture` WHERE `UID`='" . $_GET["UID"] . "' LIMIT 1"; + } else + echo "Fehlerhafter Aufruf"; + break; + default : + echo "Fehlerhafter Aufruf"; + + } //switch + + // Update ??? + if (IsSet ($SQL)) { + // hier muesste das SQL ausgefuehrt werden... + $Erg = mysql_query($SQL, $con); + if ($Erg == 1) + echo "Änderung wurde gesichert...<br />"; + else { + echo "Fehler beim speichern... bitte noch ein mal probieren :)"; + echo "<br /><br />" . mysql_error($con) . "<br />($SQL)<br />"; + } + } // Ende Update + echo "<br />\n<hr width=\"100%\">\n<br />\n\n"; +} //IF IsSet($action) + +//ausgabe der Liste +$Sql = "SELECT * FROM `UserPicture` WHERE `UID`>0;"; +$Erg = mysql_query($Sql, $con); + +echo "Hallo " . $_SESSION['Nick'] . ",<br />\nhier hast du die Möglichkeit, die Bilder der Engel freizugeben:<br /><br />\n"; + +echo "<table width=\"100%\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n"; +echo "<tr class=\"contenttopic\">\n"; +echo "\t<td>User</td>\n"; +echo "\t<td>Bild</td>\n"; +echo "\t<td>Status</td>\n"; +echo "\t<td>Löschen</td>\n"; +echo "</tr>"; + +for ($t = 0; $t < mysql_num_rows($Erg); $t++) { + $UIDs = mysql_result($Erg, $t, "UID"); + echo "\t<tr class=\"content\">\n"; + + echo "\t\t<td>" . UID2Nick(mysql_result($Erg, $t, "UID")) . "</td>\n"; + echo "\t\t<td>" . displayPictur($UIDs, 0) . "</td>\n"; + + if (GetPicturShow($UIDs) == "Y") + echo "\t\t<td><a href=\"./UserPicture.php?action=SetN&UID=$UIDs\">sperren</a></td>\n"; + elseif (GetPicturShow($UIDs) == "N") echo "\t\t<td><a href=\"./UserPicture.php?action=SetY&UID=$UIDs\">freigeben</a></td>\n"; + else + echo "\t\t<td>ERROR: show='" . GetPicturShow($UIDs) . "'</td>\n"; + echo "\t\t<td><a href=\"./UserPicture.php?action=del&UID=$UIDs\">del</a></td>\n"; + echo "\t</tr>\n"; +} // ende Auflistung Raeume +echo "</table>"; + +echo "<br /><a href=\"./UserPicture.php?action=FormUpload\">picture upload</a>\n"; + +include ("includes/footer.php"); +?> diff --git a/www-ssl_old/admin/aktiv.php b/www-ssl_old/admin/aktiv.php new file mode 100644 index 00000000..8db62f98 --- /dev/null +++ b/www-ssl_old/admin/aktiv.php @@ -0,0 +1,105 @@ +<?php +require_once ('../bootstrap.php'); + +$title = "akive Engel"; +$header = "Liste der aktiven Engel"; +include ("includes/header.php"); +include ("includes/funktion_db_list.php"); + +echo "<form action=\"./aktiv.php\" method=\"post\">"; +echo Get_Text("pub_aktive_Text1") . "<br />\n"; +echo Get_Text("pub_aktive_Text2") . "<br /><br />\n"; + +// auswahlbox +echo Get_Text("pub_aktive_Text31") . "\n"; +echo "<select name=\"Anzahl\">\n"; +for ($i = 0; $i < 50; $i++) + echo "\t<option value=\"$i\">$i</option>\n"; +echo "</select>"; +echo Get_Text("pub_aktive_Text32") . "<br /><br />\n"; +echo "<input type=\"submit\" name=\"SendType\" value=\"Show..\">\n"; +echo "<input type=\"submit\" name=\"SendType\" value=\"Write..\">\n"; +echo "</form>\n"; + +echo "<form action=\"./aktiv.php\" method=\"post\">\n"; +echo "\t<br /><input type=\"submit\" name=\"ResetActive\" value=\"reset Active setting\">\n"; +echo "</form>\n"; + +if (Isset ($_POST["ResetActive"])) { + $SQLreset = "UPDATE `User` SET `Aktiv`='0'"; + $ErgReset = db_query($SQLreset, "Reset Active"); + if ($ErgReset != 1) + echo "Fehler beim zuruecksetzen der Activ\n"; + else + echo "Active wurde erfolgreich zurueckgesetzt\n"; +} + +if (IsSet ($_POST["Anzahl"])) + echo "<br />\n\n" . Get_Text("pub_aktive_Text5_1") . $_POST["Anzahl"] . Get_Text("pub_aktive_Text5_2") . ":"; + +echo "<br /><br />\n\n"; + +//ausgabe tabelle +echo "<table width=\"100%\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n"; +echo "<tr class=\"contenttopic\">\n"; +echo "\t<td>" . Get_Text("pub_aktive_Nick") . "</td>\n"; +echo "\t<td>" . Get_Text("pub_aktive_Anzahl") . "</td>\n"; +echo "\t<td>" . Get_Text("pub_aktive_Time") . "</td>\n"; +echo "\t<td>" . Get_Text("pub_aktive_Time") . " Weight</td>\n"; +echo "\t<td>Freeloader " . Get_Text("pub_aktive_Anzahl") . "</td>\n"; +echo "\t<td>Freeloader " . Get_Text("pub_aktive_Time") . "</td>\n"; +echo "\t<td>" . Get_Text("pub_aktive_Time") . " result</td>\n"; +echo "\t<td>" . Get_Text("pub_aktive_Active") . "</td>\n"; +echo "</tr>\n"; + +$SQL = " +SELECT d.UID, d.nr, d.len, d.lenWeight, f.nr AS nrFree, f.len AS lenFree, d.lenWeight - COALESCE(f.len, 0) as lenReal + FROM + (SELECT e.UID, COUNT(s.Len) as nr, SUM(s.Len) as len, SUM( s.Len*(1+(((HOUR(s.DateS)+2)%24)<10 and ((HOUR(s.DateE)+2)%24)<=10)) ) as lenWeight FROM `Shifts` AS s INNER JOIN `ShiftEntry` AS e USING(SID) WHERE NOT UID=0 GROUP BY UID) as d + LEFT JOIN + (SELECT UID, COUNT(Length) AS nr, SUM(Length) AS len FROM `ShiftFreeloader` GROUP BY UID) AS f + USING(UID) + ORDER BY lenReal DESC, nr DESC, UID"; + +$Erg = mysql_query($SQL, $con); +echo mysql_error($con); +$rowcount = mysql_num_rows($Erg); + +$aktivecount = 0; +for ($i = 0; $i < $rowcount; $i++) { + echo "\n\n\t<tr class=\"content\">\n"; + echo "\t\t<td>" . UID2Nick(mysql_result($Erg, $i, "UID")) . "</td>\n"; + echo "\t\t<td>" . mysql_result($Erg, $i, "nr") . "x</td>\n"; + echo "\t\t<td>" . mysql_result($Erg, $i, "len") . "h</td>\n"; + echo "\t\t<td>" . mysql_result($Erg, $i, "lenWeight") . "h</td>\n"; + echo "\t\t<td>" . mysql_result($Erg, $i, "nrFree") . "x</td>\n"; + echo "\t\t<td>" . mysql_result($Erg, $i, "lenFree") . "h</td>\n"; + echo "\t\t<td>" . mysql_result($Erg, $i, "lenReal") . "h</td>\n"; + + echo "\t\t<td>"; + if (IsSet ($_POST["Anzahl"])) { + if ($_POST["Anzahl"] < mysql_result($Erg, $i, "lenReal")) { + $aktivecount++; + if ($_POST["SendType"] == "Show..") + echo "show set"; + else { + $SQL2 = "UPDATE `User` SET `Aktiv`='1' WHERE `UID`='" . mysql_result($Erg, $i, "UID") . "' LIMIT 1"; + $Erg2 = db_query($SQL2, "update Active State"); + if ($Erg2 != 1) + echo "Fehler beim speichern bei Engel " . UID2Nick(mysql_result($Erg, $i, "UID")); + else + echo "write set"; + } + } + } + echo "</td>\n"; + echo "\t</tr>\n"; +} // ende Auflistung aktive Engel + +echo "</table>"; + +echo "<br />Anzahl eintraege: $aktivecount / $rowcount (Aktive/Mitschichten)<br /><br />"; + +include ("includes/footer.php"); +?> + diff --git a/www-ssl_old/admin/dbUpdateFromXLS.php b/www-ssl_old/admin/dbUpdateFromXLS.php new file mode 100644 index 00000000..88879de7 --- /dev/null +++ b/www-ssl_old/admin/dbUpdateFromXLS.php @@ -0,0 +1,252 @@ +<?php +require_once ('../bootstrap.php'); + +$title = "DB Update from XML"; +$header = "DB Update from XML"; +include ("includes/header.php"); +include ("includes/funktion_xml.php"); + +/////////// +// DEBUG // +/////////// +$ShowDataStrukture = 0; +$EnableRoomFunctions = 1; +$EnableRooms = 1; +$EnableSchudleFunctions = 1; +$EnableSchudle = 1; +$EnableSchudleDB = 1; + +/*############################################################################################## + erstellt Arrays der Reume + ##############################################################################################*/ +function CreateRoomArrays() { + global $Room, $RoomID, $RoomName, $con; + + $sql = "SELECT `RID`, `Name` FROM `Room` " . + "WHERE `Show`='Y'" . + "ORDER BY `Number`, `Name`;"; + $Erg = mysql_query($sql, $con); + $rowcount = mysql_num_rows($Erg); + + for ($i = 0; $i < $rowcount; $i++) { + $Room[$i]["RID"] = mysql_result($Erg, $i, "RID"); + $Room[$i]["Name"] = mysql_result($Erg, $i, "Name"); + $RoomID[mysql_result($Erg, $i, "RID")] = mysql_result($Erg, $i, "Name"); + $RoomName[mysql_result($Erg, $i, "Name")] = mysql_result($Erg, $i, "RID"); + } +} +CreateRoomArrays(); + +/*############################################################################################## + F I L E + ##############################################################################################*/ +echo "\n\n<br />\n<h1>XML File:</h1>\n"; +if (isset ($_POST["PentabarfUser"]) && isset ($_POST["password"]) && isset ($_POST["PentabarfURL"])) { + echo "Update XCAL-File from Pentabarf.."; + if ($PentabarfGetWith == "fsockopen") { + + //backup error messeges and delate + $Backuperror_messages = $error_messages; + $fp = fsockopen("ssl://$PentabarfXMLhost", 443, $errno, $errstr, 30); + // $error_messages = $Backuperror_messages; + + if (!$fp) { + echo "<h2>fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . "' not readable!" . + "[$errstr ($errno)]</h2>"; + } else { + if (($fileOut = fopen("$Tempdir/engelXML", "w")) != FALSE) { + $head = 'GET /' . $PentabarfXMLpath . $_POST["PentabarfURL"] . ' HTTP/1.1' . "\r\n" . + 'Host: ' . $PentabarfXMLhost . "\r\n" . + 'User-Agent: Engelsystem' . "\r\n" . + 'Authorization: Basic ' . + base64_encode($_POST["PentabarfUser"] . ':' . $_POST["password"]) . "\r\n" . + "\r\n"; + fputs($fp, $head); + $Zeilen = -1; + while (!feof($fp)) { + $Temp = fgets($fp, 1024); + + // ende des headers + if ($Temp == "f20\r\n") { + $Zeilen = 0; + $Temp = ""; + } + + //file ende? + if ($Temp == "0\r\n") + break; + + if (($Zeilen > -1) && ($Temp != "ffb\r\n")) { + //steuerzeichen ausfiltern + if (strpos("#$Temp", "\r\n") > 0) + $Temp = substr($Temp, 0, strlen($Temp) - 2); + if (strpos("#$Temp", "1005") > 0) + $Temp = ""; + if (strpos("#$Temp", "783") > 0) + $Temp = ""; + //schreiben in file + fputs($fileOut, $Temp); + $Zeilen++; + } + } + fclose($fileOut); + + echo "<br />Es wurden $Zeilen Zeilen eingelesen<br />"; + } else + echo "<h2>fail: File '$Tempdir/engelXML' not writeable!</h2>"; + fclose($fp); + } + } + elseif ($PentabarfGetWith == "fopen") { + //user uns password in url einbauen + $FileNameIn = "https://" . $_POST["PentabarfUser"] . ':' . $_POST["password"] . "@" . + $PentabarfXMLhost . "/" . $PentabarfXMLpath . $_POST["PentabarfURL"]; + + if (($fileIn = fopen($FileNameIn, "r")) != FALSE) { + if (($fileOut = fopen("$Tempdir/engelXML", "w")) != FALSE) { + $Zeilen = 0; + while (!feof($fileIn)) { + $Zeilen++; + fputs($fileOut, fgets($fileIn)); + } + fclose($fileOut); + echo "<br />Es wurden $Zeilen Zeilen eingelesen<br />"; + } else + echo "<h2>fail: File '$Tempdir/engelXML' not writeable!</h2>"; + fclose($fileIn); + } else + echo "<h2>fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . "' not readable!</h2>"; + } + elseif ($PentabarfGetWith == "wget") { + $Command = "wget --http-user=" . $_POST["PentabarfUser"] . " --http-passwd=" . $_POST["password"] . " " . + "https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . + " --output-file=$Tempdir/engelXMLwgetLog --output-document=$Tempdir/engelXML" . + " --no-check-certificate"; + echo system($Command, $Status); + if ($Status == 0) + echo "OK.<br />"; + else + echo "fail ($Status)($Command).<br />"; + } + elseif ($PentabarfGetWith == "lynx") { + $Command = "lynx -auth=" . $_POST["PentabarfUser"] . ":" . $_POST["password"] . " -dump " . + "https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . " > $Tempdir/engelXML"; + echo system($Command, $Status); + if ($Status == 0) + echo "OK.<br />"; + else + echo "fail ($Status)($Command).<br />"; + } + elseif ($PentabarfGetWith == "fopen") { + //user uns password in url einbauen + $FileNameIn = "https://" . $_POST["PentabarfUser"] . ':' . $_POST["password"] . "@" . + $PentabarfXMLhost . "/" . $PentabarfXMLpath . $_POST["PentabarfURL"]; + + if (($fileIn = fopen($FileNameIn, "r")) != FALSE) { + if (($fileOut = fopen("$Tempdir/engelXML", "w")) != FALSE) { + $Zeilen = 0; + while (!feof($fileIn)) { + $Zeilen++; + fputs($fileOut, fgets($fileIn)); + } + fclose($fileOut); + echo "<br />Es wurden $Zeilen Zeilen eingelesen<br />"; + } else + echo "<h2>fail: File '$Tempdir/engelXML' not writeable!</h2>"; + fclose($fileIn); + } else + echo "<h2>fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . "' not readable!</h2>"; + } + elseif ($PentabarfGetWith == "wget") { + $Command = "wget --http-user=" . $_POST["PentabarfUser"] . " --http-passwd=" . $_POST["password"] . " " . + "https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . + " --output-file=$Tempdir/engelXMLwgetLog --output-document=$Tempdir/engelXML" . + " --no-check-certificate"; + echo system($Command, $Status); + if ($Status == 0) + echo "OK.<br />"; + else + echo "fail ($Status)($Command).<br />"; + } + elseif ($PentabarfGetWith == "lynx") { + $Command = "lynx -auth=" . $_POST["PentabarfUser"] . ":" . $_POST["password"] . " -dump " . + "https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . " > $Tempdir/engelXML"; + echo system($Command, $Status); + if ($Status == 0) + echo "OK.<br />"; + else + echo "fail ($Status)($Command).<br />"; + } else + echo "<h1>The PentabarfGetWith='$PentabarfGetWith' not supported</h1>"; +} else { + echo "<form action=\"dbUpdateFromXLS.php\" method=\"post\">\n"; + echo "<table border=\"0\">\n"; + echo "\t<tr><td>XCAL-File: https://$PentabarfXMLhost/$PentabarfXMLpath</td>" . + "<td><input name=\"PentabarfURL\" type=\"text\" size=\"4\" maxlength=\"5\" " . + "value=\"$PentabarfXMLEventID\"></td></tr>\n"; + echo "\t<tr><td>Username:</td>" . + "<td><input name=\"PentabarfUser\" type=\"text\" size=\"30\" maxlength=\"30\"></td></tr>\n"; + echo "\t<tr><td>Password:</td>" . + "<td><input name=\"password\" type=\"password\" size=\"30\" maxlength=\"30\"></td></tr>\n"; + echo "\t<tr><td></td><td><input type=\"submit\" name=\"FileUpload\" value=\"upload\"></td></tr>\n"; + echo "</table>\n"; + echo "</form>\n"; +} + +//readXMLfile("xml.php.xml"); +if (readXMLfile("$Tempdir/engelXML") == 0) { + $XMLmain = getXMLsubPease($XMLmain, "VCALENDAR"); + + if ($ShowDataStrukture) { + echo "<pre><br />"; + echo $XMLmain->name; + echo "<br />"; + print_r(array_values($XMLmain->sub)); + echo "</pre>"; + } + + /* + echo "<br />"; + $Feld=7; + echo "$Feld#". $XMLmain->sub[$Feld]->name. "<br />"; + echo "$Feld#". $XMLmain->sub[$Feld]->sub; + //print_r(array_values ($XMLmain->sub[$Feld]->sub)); + while(list($key, $value) = each($XMLmain->sub[$Feld]->sub)) + echo "?ID".$value->sub[1]->data. "=". $value->sub[2]->data. "\n"; + echo "</pre>"; + */ + + /*############################################################################################## + V e r s i o n + ##############################################################################################*/ + + echo "<hr>\n"; + $XMLrelease = getXMLsubPease($XMLmain, "X-WR-CALDESC"); + echo "release: " . $XMLrelease->data . "<br />\n"; + //$XMLreleaseDate = getXMLsubPease( $XMLmain, "RELEASE-DATE"); + //echo "release date: ". $XMLreleaseDate->data. "<br />\n"; + echo "<hr>\n"; + + /*############################################################################################## + V e r s i o n + ##############################################################################################*/ + if ($EnableRoomFunctions) + include ("includes/funktion_xml_room.php"); + + if ($EnableSchudleFunctions) + include ("includes/funktion_xml_schudle.php"); + + /*############################################################################################## + U P D A T E A L L + ##############################################################################################*/ + echo "\n\n<br />\n<h1>Update ALL:</h1>\n"; + + echo "<form action=\"dbUpdateFromXLS.php\">\n"; + echo "\t<input type=\"submit\" name=\"UpdateALL\" value=\"now\">\n"; + echo "</form>\n"; + +} //if XMLopenOOK + +include ("includes/footer.php"); +?> + diff --git a/www-ssl_old/admin/dect.php b/www-ssl_old/admin/dect.php new file mode 100644 index 00000000..4e9f472a --- /dev/null +++ b/www-ssl_old/admin/dect.php @@ -0,0 +1,69 @@ +<?php +require_once ('../bootstrap.php'); + +$title = "Engelsystem - DECT"; +$header = "DECT send call"; +include ("includes/header.php"); + +include ("config/config_IAX.php"); +//include ("includes/funktion_modem.php"); +include ("includes/funktion_cron.php"); + +if (!isset ($_GET["dial"])) + $_GET["dial"] = ""; +if (!isset ($_GET["custum"])) + $_GET["custum"] = ""; + +if ($_GET["dial"] == "dial") { + if ($_GET["DECT"] == "") + $Number = $_GET["custum"]; + else + $Number = $_GET["DECT"]; + + if (strlen($_GET["timeh"]) == 1) + $_GET["timeh"] = "0" . $_GET["timeh"]; + + if (strlen($_GET["timem"]) == 1) + $_GET["timem"] = "0" . $_GET["timem"]; + + // SetWackeup( $Number, $_GET["timeh"], $_GET["timem"]); + DialNumberIAX($Number, $_GET["timeh"], $_GET["timem"], 0); + + $_GET["custum"] = $Number; +} + +echo "<form action=\"./dect.php\" method=\"GET\">\n"; +echo "<table>\n"; + +echo "<tr><th>Number</th><th>h:m</th><th></th></tr>\n"; + +echo "<tr><td>\n"; +// Listet alle Nicks auf +echo "<select name=\"DECT\">\n"; +echo "\t<option value=\"\">costum</option>\n"; + +$usql = "SELECT * FROM `User` WHERE NOT `DECT`='' ORDER BY `Nick`"; +$uErg = mysql_query($usql, $con); +$urowcount = mysql_num_rows($uErg); +for ($k = 0; $k < $urowcount; $k++) { + echo "\t<option value=\"" . mysql_result($uErg, $k, "DECT") . "\">" . + mysql_result($uErg, $k, "Nick") . + " (" . mysql_result($uErg, $k, "DECT") . ")" . + "</option>\n"; +} +echo "</select>\n"; + +echo "<input type=\"text\" name=\"custum\" size=\"4\" maxlength=\"4\" value=\"" . $_GET["custum"] . "\">\n"; +echo "</td>\n"; + +echo "<td><input type=\"text\" name=\"timeh\" size=\"2\" maxlength=\"2\" value=\"" . gmdate("H", time() + 90 + 3600) . "\">:"; +echo "<input type=\"text\" name=\"timem\" size=\"2\" maxlength=\"2\" value=\"" . gmdate("i", time() + 90 + 3600) . "\"></td>\n"; +echo "<td><input type=\"submit\" name=\"dial\" value=\"dial\"></td>\n"; +echo "</tr>"; +echo "</table>\n"; + +echo "</form>"; + +include ("includes/footer.php"); +?> + diff --git a/www-ssl_old/admin/free.php b/www-ssl_old/admin/free.php new file mode 100644 index 00000000..b45fadcf --- /dev/null +++ b/www-ssl_old/admin/free.php @@ -0,0 +1,98 @@ +<?php +require_once ('../bootstrap.php'); + +$title = "Erzengel"; +$header = "Freie Engel"; +include ("includes/header.php"); +include ("includes/funktion_db_list.php"); + +echo "Hallo " . $_SESSION['Nick'] . ",<br />\n"; + +echo "<br /><br />\n\nHier findest du alle Engel, welche zur Zeit in keiner Schicht verplant sind:<br /><br />\n"; + +####################################################### +# 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() AND ShiftEntry.UID>0);"; + +//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=\"./userChangeNormal.php?Type=Normal&enterUID=" . mysql_result($Erg, $i, "UID") . "\">" . + UID2Nick(mysql_result($Erg, $i, "UID")) . "</td></a>\n"; + echo "<td></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=\"./userChangeNormal.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 ("includes/footer.php"); +?> + diff --git a/www-ssl_old/admin/free_DECT.php b/www-ssl_old/admin/free_DECT.php new file mode 100644 index 00000000..4b4e3085 --- /dev/null +++ b/www-ssl_old/admin/free_DECT.php @@ -0,0 +1,65 @@ +<?php +require_once ('../bootstrap.php'); + +include ("config/config_db.php"); +include ("includes/funktion_db_list.php"); +include ("includes/funktion_user.php"); + +####################################################### +# 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 != "") { + $inuse = " WHERE (NOT (" . $inuse . ")) AND (DECT!='')"; +} else { + $inuse = " WHERE (DECT!='')"; +} + +//########################################################################################################## + +$SQL = "SELECT * FROM User" . $inuse . ";"; +$Erg = mysql_query($SQL, $con); +$Zeilen = mysql_num_rows($Erg); +for ($i = 0; $i < $Zeilen; $i++) { + // get DECT number + echo mysql_result($Erg, $i, "DECT") . "\t"; + + // get all user rights + $SQL_RIGHT = "SELECT * FROM UserCVS WHERE UID=" . mysql_result($Erg, $i, "UID") . ";"; + $Erg_RIGHT = mysql_query($SQL_RIGHT, $con); + $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); + $Zeilen_Typen = mysql_num_rows($Erg_TYPES); + for ($j = 0; $j < $Zeilen_Typen; $j++) { + echo "\"TID_" . TID2Type(mysql_result($Erg_TYPES, $j, "TID")) . "\"=Y\t"; + } + + echo "\n"; + // echo "<br />"; +} +?> + diff --git a/www-ssl_old/admin/room.php b/www-ssl_old/admin/room.php new file mode 100755 index 00000000..4854acb6 --- /dev/null +++ b/www-ssl_old/admin/room.php @@ -0,0 +1,199 @@ +<?php +$title = "Räume"; +$header = "Verwaltung der Räume"; +include ("../../includes/header.php"); +include ("../../includes/funktion_schichtplan_array.php"); + +$Sql = "SELECT * FROM `Room` ORDER BY `Number`, `Name`"; +$Erg = mysql_query($Sql, $con); + +if( !IsSet($_GET["action"]) ) +{ + echo "Hallo ".$_SESSION['Nick']. + ",<br>\nhier hast du die Möglichkeit, neue Räume für die Schichtpläne einzutragen ". + "oder vorhandene abzuändern:<br><br>\n"; + + echo "<a href=\"./room.php?action=new\">- Neuen Raum/Ort eintragen</a><br>\n"; + + echo "<table width=\"100%\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n"; + echo "<tr class=\"contenttopic\">\n"; + + for( $i = 1; $i < mysql_num_fields($Erg); $i++ ) + { + if( substr( mysql_field_name($Erg, $i), 0, 12) == "DEFAULT_EID_") + echo "\t<td> Anzahl ". $EngelTypeID[substr( mysql_field_name($Erg, $i), 12)]. "</td>"; + else + echo "\t<td>". mysql_field_name($Erg, $i)."</td>"; + } + echo "\t<td>Ändern</td>"; + echo "</tr>"; + + for( $t = 0; $t < mysql_num_rows($Erg); $t++ ) + { + echo "\t<tr class=\"content\">\n"; + for ($j = 1; $j < mysql_num_fields($Erg); $j++) + { + echo "\t\t<td>".mysql_result($Erg, $t, $j)."</td>\n"; + } + echo "\t\t<td><a href=\"./room.php?action=change&RID=".mysql_result($Erg, $t, "RID")."\">###</a></td>\n"; + echo "\t</tr>\n"; + } // ende Auflistung Raeume + echo "</table>"; +} +else +{ + +UnSet($SQL); + +switch ($_GET["action"]) { + +case 'new': + echo "Neuen Raum einrichten: <br>"; + echo "<form action=\"./room.php\" method=\"GET\">\n"; + echo "<table>\n"; + + for( $Uj = 1; $Uj < mysql_num_fields($Erg); $Uj++ ) + { + if( (mysql_field_name($Erg, $Uj) == "show") || (mysql_field_name($Erg, $Uj) == "FromPentabarf") ) + { + echo "<tr><td>". mysql_field_name($Erg, $Uj). "</td>". + "<td>". + "<input type=\"radio\" name=\"". mysql_field_name($Erg, $Uj). "\" value=\"Y\">Yes". + "<input type=\"radio\" name=\"". mysql_field_name($Erg, $Uj). "\" value=\"N\">No". + "</td></tr>\n"; + } + else + { + //sonderfall fuer Default Engel + if( substr( mysql_field_name($Erg, $Uj), 0, 12) == "DEFAULT_EID_") + $FeldName = "Anzahl ". $EngelTypeID[substr( mysql_field_name($Erg, $Uj), 12)]; + else + $FeldName = mysql_field_name($Erg, $Uj); + + echo "<td>$FeldName</td>". + "<td><input type=\"text\" size=\"40\" name=\"".mysql_field_name($Erg, $Uj)."\">"; + echo "</td></tr>\n"; + } + } + echo "</table>\n"; + echo "<input type=\"hidden\" name=\"action\" value=\"newsave\">\n"; + echo "<input type=\"submit\" value=\"sichern...\">\n"; + echo "</form>"; + break; + +case 'newsave': + $vars = $_GET; + $count = count($vars) - 1; + $vars = array_splice($vars, 0, $count); + $Keys = ""; + $Values = ""; + foreach($vars as $key => $value) + { + $Keys .= ", `$key`"; + $Values .= ", '$value'"; + } + $SQL = "INSERT INTO `Room` (". substr( $Keys, 2). ") VALUES (". substr( $Values, 2). ")"; + SetHeaderGo2Back(); + break; + +case 'change': + if (! IsSet($_GET["RID"])) + echo "Fehlerhafter Aufruf!"; + else + { + $SQL2 = "SELECT * FROM `Room` WHERE `RID`='". $_GET["RID"]. "'"; + $ERG = mysql_query($SQL2, $con); + + if( mysql_num_rows( $ERG)>0) + { + echo "Raum abändern:\n"; + echo "Hier kannst du eintragen, welche und wieviele Engel für den Raum zur Verf?gung stehen müssen."; + echo "<form action=\"./room.php\" method=\"GET\">\n"; + echo "<table>\n"; + + for ($Uj = 1; $Uj < mysql_num_fields($ERG); $Uj++) + { + if( (mysql_field_name($ERG, $Uj) == "show") || (mysql_field_name($ERG, $Uj) == "FromPentabarf") ) + { + echo "<tr><td>". mysql_field_name($Erg, $Uj). "</td>". + "<td>". + "<input type=\"radio\" name=\"e". mysql_field_name($ERG, $Uj). + "\" value=\"Y\"". (mysql_result($ERG, 0, $Uj)=='Y'? " checked":""). ">Yes". + "<input type=\"radio\" name=\"e". mysql_field_name($ERG, $Uj). + "\" value=\"N\"". (mysql_result($ERG, 0, $Uj)=='N'? " checked":""). ">No". + "</td></tr>\n"; + } + else + { + if( substr( mysql_field_name($ERG, $Uj), 0, 12) == "DEFAULT_EID_") + //sonderfall fuer Default Engel + $FeldName = "Anzahl ". $EngelTypeID[substr( mysql_field_name($ERG, $Uj), 12)]; + else + $FeldName = mysql_field_name($ERG, $Uj); + echo "<tr><td>$FeldName</td>". + "<td><input type=\"text\" size=\"40\" name=\"e".mysql_field_name($ERG, $Uj)."\" ". + "value=\"".mysql_result($ERG, 0, $Uj)."\">". + "</td></tr>\n"; + } + } + echo "</table>\n"; + echo "<input type=\"hidden\" name=\"eRID\" value=\"". $_GET["RID"]. "\">\n"; + echo "<input type=\"hidden\" name=\"action\" value=\"changesave\">\n"; + echo "<input type=\"submit\" value=\"sichern...\">\n"; + echo "</form>"; + echo "<form action=\"./room.php\" method=\"GET\">\n"; + echo "<input type=\"hidden\" name=\"RID\" value=\"". $_GET["RID"]. "\">\n"; + echo "<input type=\"hidden\" name=\"action\" value=\"delete\">\n"; + echo "<input type=\"submit\" value=\"Löschen...\">"; + echo "</form>"; + } + else + echo "FEHLER: Room ID ". $_GET["RID"]. " nicht gefunden"; + } + break; + +case 'changesave': + $sql=""; + $vars = $_GET; + $count = count($vars) - 2; + $vars = array_splice($vars, 0, $count); + foreach($vars as $key => $value) + { + $keys = substr($key,1); + $sql .= ", `".$keys."`='".$value."' "; + } + $SQL = "UPDATE `Room` SET ". substr($sql, 2). " WHERE `RID`='". $_GET["eRID"]. "'"; + SetHeaderGo2Back(); + break; + +case 'delete': + if (IsSet($_GET["RID"])) { + $SQL="DELETE FROM `Room` WHERE `RID`='". $_GET["RID"]. "'"; + } else { + echo "Fehlerhafter Aufruf"; + } + SetHeaderGo2Back(); + break; + +} //switch + + +// Update ??? + +if (IsSet($SQL)){ +// echo $SQL; + // hier muesste das SQL ausgefuehrt werden... + $Erg = db_query($SQL, "exec SQL"); + if ($Erg == 1) + echo "Änderung wurde gesichert...<br>"; + else + { + echo "Fehler beim speichern... bitte noch ein mal probieren :)"; + echo "<br><br>".mysql_error( $con ). "<br>($SQL)<br>"; + } +} // Ende Update + +} //IF IsSet($action) + +include ("../../includes/footer.php"); +?> diff --git a/www-ssl_old/admin/schichtplan.1.php b/www-ssl_old/admin/schichtplan.1.php new file mode 100644 index 00000000..fe8c0384 --- /dev/null +++ b/www-ssl_old/admin/schichtplan.1.php @@ -0,0 +1,5 @@ +<h4>Schichtplan</h4> +<ul class="content"> +<li><a href="./schichtplan.php">Ein-/Austragen</a></li> +<li><a href="./schichtplan_druck.php">Druckversion</a></li> +</ul>
\ No newline at end of file diff --git a/www-ssl_old/admin/schichtplan.php b/www-ssl_old/admin/schichtplan.php new file mode 100644 index 00000000..70ef5a6a --- /dev/null +++ b/www-ssl_old/admin/schichtplan.php @@ -0,0 +1,362 @@ +<?php +require_once ('../bootstrap.php'); + +$title = "Schichtplan"; +$header = "Neue Schichten erfassen"; +$submenus = 1; +include ("includes/header.php"); + +function executeSQL($SQL) { + global $debug, $con; + + $Erg = mysql_query($SQL, $con); + if ($debug) + echo "DEBUG SQL: $SQL<br />\n"; + if ($Erg == 1) { + echo "SQL war erfolgreich"; + } else { + echo "SQL Fehler (" . mysql_error($con) . ")"; + } +} + +if (!IsSet ($_GET["action"])) { + echo "Hallo " . $_SESSION['Nick'] . ",<br />\n"; + echo "hier kannst du Schichten anlegen, ändern oder löschen.<br /><br />"; + echo "<a href=\"./shiftadd.php\">Neue Schicht einplanen</a><br /><br />\n\n"; + + echo "<form action=\"" . $_SERVER['SCRIPT_NAME'] . "\" method=\"GET\" >\n"; +?> +<table width="100%" class="border" cellpadding="2" cellspacing="1"> + <tr class="contenttopic"> + <td></td> + <td>Datum</td> + <td>Raum</td> + <td>Dauer</td> + <td>Ändern</td> + </tr> +<?php + + + $sql = "SELECT `SID`, `DateS`, `RID`, `Len` FROM `Shifts` " . + "ORDER BY `RID`, `DateS` "; + $Erg = mysql_query($sql, $con); + $rowcount = mysql_num_rows($Erg); + for ($i = 0; $i < $rowcount; $i++) { + echo "\t<tr class=\"content\">\n"; + echo "\t\t<td><input type=\"checkbox\" name=\"SID" . mysql_result($Erg, $i, "SID") . "\" " . + "value=\"" . mysql_result($Erg, $i, "SID") . "\"></td>\n"; + echo "\t\t<td>" . mysql_result($Erg, $i, "DateS") . "</td>\n"; + + $sql2 = "SELECT `Name` FROM `Room` WHERE `RID`='" . mysql_result($Erg, $i, "RID") . "'"; + $Erg2 = mysql_query($sql2, $con); + if (mysql_num_rows($Erg2) > 0) + echo "\t\t<td>" . mysql_result($Erg2, 0, "Name") . "</td>\n"; + else + echo "\t\t<td>Unbenkannt (RID=" . mysql_result($Erg, $i, "RID") . ")</td>\n"; + echo "\t\t<td>" . mysql_result($Erg, $i, "Len") . " Std. </td>\n"; + echo "\t\t<td><a href=\"./schichtplan.php?action=change&SID=" . + mysql_result($Erg, $i, "SID") . "\">####</a></td>\n"; + echo "\t</tr>\n"; + } + echo "</table>\n"; + + echo "<input type=\"hidden\" name=\"action\" value=\"deleteShifs\">\n"; + echo "<input type=\"submit\" value=\"Löschen...\">\n"; + echo "</form>\n"; + +} else { + + // aus sicherheitzgr�nden wegen sp�terer genuzung + UnSet ($chSQL); + + switch ($_GET["action"]) { + + case 'change' : + if (!IsSet ($_GET["SID"])) { + echo "Fehlerhafter Aufruf!\n"; + } else { + + $sql = "SELECT * FROM `Shifts` WHERE (`SID` = '" . $_GET["SID"] . "' )"; + $Erg = mysql_query($sql, $con); + + echo "Schicht abändern: <br />\n"; + + // Anzeige Allgemeiner schaischt daten + echo "<form action=\"" . $_SERVER['SCRIPT_NAME'] . "\" method=\"GET\" >"; + echo "<table>\n"; + echo " <tr><td>Schichtbeginn</td>" . + "<td><input value=\"" . mysql_result($Erg, 0, "DateS") . + "\" type=\"text\" size=\"40\" name=\"eDate\"></td></tr>\n"; + echo " <tr><td>Raum</td><td>\n<select name=\"eRID\">\n"; + + $sql2 = "SELECT `RID`, `Name`, `FromPentabarf` FROM `Room`"; + $Erg2 = mysql_query($sql2, $con); + $rowcount = mysql_num_rows($Erg2); + $FromPentabarf = "N"; + for ($i = 0; $i < $rowcount; $i++) { + $RID = mysql_result($Erg2, $i, "RID"); + echo " <option value=\"" . $RID . "\""; + if ($RID == mysql_result($Erg, 0, "RID")) { + echo " selected"; + $FromPentabarf = mysql_result($Erg2, $i, "FromPentabarf"); + } + echo ">" . mysql_result($Erg2, $i, "Name") . "</option>\n"; + } + echo " </select>\n</td></tr>\n"; + + echo " <tr><td>Dauer in h</td>" . + "<td><input value=\"" . mysql_result($Erg, 0, "Len") . + "\" type=\"text\" size=\"40\" name=\"eDauer\"></td></tr>\n"; + echo " <tr><td>Beschreibung</td>" . + "<td><input value=\"" . mysql_result($Erg, 0, "Man") . + "\" type=\"text\" size=\"40\" name=\"eName\"></td></tr>\n"; + echo " <tr><td>URL</td>" . + "<td><input value=\"" . mysql_result($Erg, 0, "URL") . + "\" type=\"text\" size=\"40\" name=\"eURL\"></td></tr>\n"; + if ($FromPentabarf == "Y") { + echo " <tr><td></td>" . + "<td><h1>!!! Imported from Pentabarf !!!</h1></td></tr>\n"; + } + echo "</table>\n"; + + echo "<input type=\"hidden\" name=\"SID\" value=\"" . $_GET["SID"] . "\">\n"; + echo "<input type=\"hidden\" name=\"action\" value=\"changesave\">\n"; + echo "<input type=\"submit\" value=\"sichern...\">\n"; + echo "</form>\n\n"; + + // L�schen + echo "<form action=\"" . $_SERVER['SCRIPT_NAME'] . "\" method=\"GET\" >\n"; + echo "<input type=\"hidden\" name=\"SID\" value=\"" . $_GET["SID"] . "\">\n"; + echo "<input type=\"hidden\" name=\"action\" value=\"delete\">\n"; + echo "<input type=\"submit\" value=\"Löschen...\">\n"; + echo "</form>\n\n"; + + echo "<b>ACHTUNG:</b><br />\n"; + echo "Beim Löschen werden die bisher eingetragenen Engel für diese Schicht mitgelöscht.<br />\n"; + + echo "<br /><hr>\n\n\n\n"; + + //Freie Engelschichten + $sql3 = "SELECT `TID` FROM `ShiftEntry` WHERE `SID`='" . $_GET["SID"] . "' AND `UID`='0'"; + $Erg3 = mysql_query($sql3, $con); + $rowcount = mysql_num_rows($Erg3); + + echo "Folgende Engelschichten sind noch nicht vergeben.\n"; + echo "Und koenen, wenn diese nSchicht nicht benoetigt wird geloet werden:<br />\n"; + for ($j = 0; $j < $rowcount; $j++) { + $TID = mysql_result($Erg3, $j, 0); + echo "<a href=\"./schichtplan.php?action=engelshiftdel&SID=" . $_GET["SID"] . "&TID=$TID\">" . + "freie " . TID2Type($TID) . Get_Text("inc_schicht_Engel") . "schicht loeschen</a><br />\n"; + } + echo "<br /><hr>\n\n\n\n"; + + //Ausgabe eingetragener schischten + $sql3 = "SELECT * FROM `ShiftEntry` WHERE `SID`='" . $_GET["SID"] . "' AND NOT `UID`='0'"; + $Erg3 = mysql_query($sql3, $con); + $rowcount = mysql_num_rows($Erg3); + + echo "Folgende Engel Sind fuer die Schicht eingetargen.\n"; + echo "Und koennen, wenn diese nicht zu Schicht erschienen sind ausgetragen werden:<br />\n"; + echo "<table border=\"1\">\n" . + "<tr class=\"contenttopic\">" . + "<th>nick</th>" . + "<th>type</th>" . + "<th>normal</th>" . + "<th>freeloader :-(</th>" . + "</tr>"; + + for ($j = 0; $j < $rowcount; $j++) { + $userUID = mysql_result($Erg3, $j, "UID"); + echo "\t<tr>\n"; + echo "\t\t<td>" . UID2Nick($userUID) . "</td>\n"; + echo "\t\t<td>" . TID2Type(mysql_result($Erg3, $j, "TID")) . Get_Text("inc_schicht_Engel") . "</td>\n"; + echo "\t\t<td><a href=\"./schichtplan.php?action=engeldel&SID=" . $_GET["SID"] . "&UIDs=$userUID&freeloader=0\">###-austragen-###</a></td>\n"; + echo "\t\t<td><a href=\"./schichtplan.php?action=engeldel&SID=" . $_GET["SID"] . "&UIDs=$userUID&freeloader=1\">###-austragen-freeloader-###</a></td>\n"; + echo "\t</tr>\n"; + } // FOR + + echo "</table><br /><hr>\n\n\n\n"; + + //Nachtragen von Engeln + echo "Hat ein anderer Engel die Schicht übernommen, trage ihn bitte ein:"; + echo "<form action=\"" . $_SERVER['SCRIPT_NAME'] . "\" method=\"GET\" >\n"; + echo "<input type=\"hidden\" name=\"SID\" value=\"" . $_GET["SID"] . "\">\n"; + echo "<input type=\"hidden\" name=\"action\" value=\"engeladd\">\n"; + + // Listet alle Nicks auf + echo "<select name=\"UIDs\">\n"; + if ($FromPentabarf != "Y") { + echo "\t<option value=\"0\">--neu--</option>\n"; + } + + $usql = "SELECT * FROM `User` ORDER BY `Nick`"; + $uErg = mysql_query($usql, $con); + $urowcount = mysql_num_rows($uErg); + for ($k = 0; $k < $urowcount; $k++) { + echo "\t<option value=\"" . mysql_result($uErg, $k, "UID") . "\">" . + mysql_result($uErg, $k, "Nick") . + "</option>\n"; + } + echo "</select>\n"; + + echo " als \n"; + + // holt eine liste der ben�tigten Engel zu dieser Schischt + $sql3 = "SELECT Count(`TID`) AS `CTID`, `TID` FROM `ShiftEntry` "; + $sql3 .= "WHERE (`SID`='" . $_GET["SID"] . "' AND `UID`='0') "; + $sql3 .= "GROUP BY `SID`, `TID`, `UID` "; + $Erg3 = mysql_query($sql3, $con); + $i = -1; + while (++ $i < mysql_num_rows($Erg3)) { + $EngelNeed[mysql_result($Erg3, $i, "TID")] = mysql_result($Erg3, $i, "CTID"); + } + + // Gibt dei m�glich Engeltypen aus und zeigt w�efiel noch be�tigt werden + echo "<select name=\"TID\">\n"; + $SQL2 = "SELECT `TID`, `Name` FROM `EngelType` ORDER BY `Name`"; + $Erg2 = mysql_query($SQL2, $con); + for ($l = 0; $l < mysql_num_rows($Erg2); $l++) { + $EngelTID = mysql_result($Erg2, $l, "TID"); + echo "<option value=\"$EngelTID\">"; + echo mysql_result($Erg2, $l, "Name") . Get_Text("inc_schicht_engel"); + if (!isset ($EngelNeed[$EngelTID])) + echo " (0)"; + else + echo " (" . $EngelNeed[$EngelTID] . ")"; + echo "</option>\n"; + } + echo "</select>\n"; + + echo "<input type=\"submit\" value=\"eintragen...\">\n"; + + echo "<br />\n<input value=\"1\" type=\"text\" size=\"5\" name=\"eAnzahlNew\"> Anzahl New\n"; + + echo "</form>"; + + } // IF ISSET( + break; + + case 'engeladd' : + if ($_GET["UIDs"] > 0) { + + $SQL = "SELECT * FROM `ShiftEntry` " . + "WHERE (`SID`='" . $_GET["SID"] . "' AND `TID`='" . $_GET["TID"] . "' AND `UID`='0')"; + $ERG = mysql_query($SQL, $con); + if (mysql_num_rows($ERG) != 0) { + $chSQL = "UPDATE `ShiftEntry` SET " . + "`UID`='" . $_GET["UIDs"] . "', `Comment`='shift added by " . $_SESSION['Nick'] . "' " . + "WHERE (`SID`='" . $_GET["SID"] . "' AND " . + "`TID`='" . $_GET["TID"] . "' AND `UID`='0' ) LIMIT 1"; + } else { + $chSQL = "INSERT INTO `ShiftEntry` (`SID`, `TID`, `UID`, `Comment`) VALUES (" . + "'" . $_GET["SID"] . "', '" . $_GET["TID"] . "', " . + "'" . $_GET["UIDs"] . "', 'shift added by " . $_SESSION['Nick'] . "')"; + } + echo "Es wird folgende Schicht zusätzlich eingetragen:<br />\n"; + echo "Engel: " . UID2Nick($_GET["UIDs"]) . "<br />\n"; + echo "Bemerkung: Schicht eingetragen durch Erzengel " . $_SESSION['Nick'] . "<br />\n<br />\n"; + } else { + echo "Es wird folgende Schicht wurde " . $_GET["eAnzahlNew"] . "x zusätzlich eingetragen:<br />\n"; + for ($i = 0; $i < $_GET["eAnzahlNew"]; $i++) { + echo "$i. <br />\n"; + $SQL = "INSERT INTO `ShiftEntry` (`SID`, `TID`, `UID`, `Comment`) VALUES ("; + $SQL .= "'" . $_GET["SID"] . "', '" . $_GET["TID"] . "', '0', NULL)"; + $ERG = mysql_query($SQL, $con); + if ($debug) + echo "DEBUG SQL: $SQL<br />\n"; + if ($ERG == 1) { + echo "Änderung wurde gesichert...<br />"; + } else { + echo "Fehler beim speichern... bitte noch ein mal probieren :)<br />"; + echo mysql_error($con); + } + echo "Es wird eine weitere Schicht eingetragen:<br /><br />\n"; + } + } + break; + + case 'engeldel' : + $chSQL = "UPDATE `ShiftEntry` SET `UID`='0', `Comment`= 'NULL' WHERE (`SID`='" . $_GET["SID"] . + "' AND `UID`='" . $_GET["UIDs"] . "') LIMIT 1"; + if (isset ($_GET["freeloader"]) && $_GET["freeloader"] == 1) { + $sql = "SELECT * FROM `Shifts` WHERE (`SID` = '" . $_GET["SID"] . "' )"; + $Erg = mysql_query($sql, $con); + if (mysql_num_rows($Erg) == 1) { + $UID = $_GET["UIDs"]; + $Length = mysql_result($Erg, 0, "Len"); + $Comment = "Start: " . mysql_result($Erg, 0, "DateS") . "; " . + "Beschreibung: " . mysql_result($Erg, 0, "Man") . "; " . + "Removed by " . $_SESSION['Nick']; + $ch2SQL = "INSERT INTO `ShiftFreeloader` (`Remove_Time`, `UID`, `Length`, `Comment`) " . + "VALUES ( CURRENT_TIMESTAMP, '$UID', '$Length', '$Comment');"; + } + } + break; + + case 'engelshiftdel' : + $chSQL = "DELETE FROM `ShiftEntry` WHERE `SID`='" . $_GET["SID"] . "' AND `TID`='" . + $_GET["TID"] . "' AND `UID`='0' LIMIT 1"; + break; + + case 'changesave' : + $query = mysql_query("SELECT DATE_ADD('" . $_GET["eDate"] . "', INTERVAL '+0 " . $_GET["eDauer"] . "' DAY_HOUR)", $con); + $enddate = mysql_fetch_row($query); + + $chSQL = "UPDATE `Shifts` SET " . + "`DateS`='" . $_GET["eDate"] . "', " . + "`DateE`='" . $enddate[0] . "', " . + "`RID`='" . $_GET["eRID"] . "', " . + "`Len`='" . $_GET["eDauer"] . "', " . + "`Man`='" . $_GET["eName"] . "', " . + "`URL`='" . $_GET["eURL"] . "' " . + "WHERE `SID`='" . $_GET["SID"] . "'"; + SetHeaderGo2Back(); + break; + + case 'delete' : + $chSQL = "DELETE FROM `Shifts` WHERE `SID`='" . $_GET["SID"] . "' LIMIT 1"; + $ch2SQL = "DELETE FROM `ShiftEntry` WHERE `SID`='" . $_GET["SID"] . "'"; + SetHeaderGo2Back(); + break; + + case 'deleteShifs' : + foreach ($_GET as $k => $v) + if (strpos(" " . $k, "SID") == 1) { + echo "Shifts $v wird gel�scht..."; + executeSQL("DELETE FROM `Shifts` WHERE `SID`='$v' LIMIT 1"); + echo "<br />\n"; + echo "ShiftEntry $v wird gel�scht..."; + executeSQL("DELETE FROM `ShiftEntry` WHERE `SID`='$v'"); + echo "<br /><br />\n"; + } + break; + + } // end switch + + if (IsSet ($chSQL)) { + // echo $chSQL; + // hier muesste das SQL ausgefuehrt werden... + $Erg = mysql_query($chSQL, $con); + if ($debug) + echo "DEBUG SQL: $chSQL<br />\n"; + if ($Erg == 1) { + echo "Änderung wurde gesichert...<br />"; + if ($debug) + echo "DEBUG: ergebniss" . $Erg . "<br />\n"; + if (IsSet ($ch2SQL)) { + $Erg = mysql_query($ch2SQL, $con); + if ($debug) + echo "DEBUG SQL: $ch2SQL<br />\n"; + if ($debug) + echo "DEBUG: ergebniss" . $Erg . "<br />\n"; + } + } else { + echo "Fehler beim speichern... bitte noch ein mal probieren :)<br />"; + echo mysql_error($con); + } + } // Ende Update + +} + +include ("includes/footer.php"); +?> diff --git a/www-ssl_old/admin/schichtplan_druck.1.php b/www-ssl_old/admin/schichtplan_druck.1.php new file mode 100644 index 00000000..30761390 --- /dev/null +++ b/www-ssl_old/admin/schichtplan_druck.1.php @@ -0,0 +1,5 @@ +<h4 class="menu"> Schichtplan </h4> + +<li><a href="./schichtplan.php">Ein-/Austragen</a></li> +<li><a href="./schichtplan_druck.php">Druckversion</a></li> + diff --git a/www-ssl_old/admin/schichtplan_druck.php b/www-ssl_old/admin/schichtplan_druck.php new file mode 100644 index 00000000..3e856c5e --- /dev/null +++ b/www-ssl_old/admin/schichtplan_druck.php @@ -0,0 +1,119 @@ +<?php +require_once ('../bootstrap.php'); + +$title = "Himmel"; +$header = "Schichtpläne"; +$submenus = 1; + +if (!IsSet ($_GET["action"])) { + include ("includes/header.php"); + include ("includes/funktionen.php"); + include ("includes/funktion_schichtplan_aray.php"); + include ("includes/funktion_schichtplan.php"); + + echo "Hallo " . $_SESSION['Nick'] . "<br />\n" . + "auf dieser Seite kannst du dir den Schichtplan in einer Druckansicht generieren lassen. Wähle hierfür ein Datum und den Raum:\n" . + "<br />\n"; + + foreach ($VeranstaltungsTage as $k => $v) { + + $res = mysql_query("SELECT Name, RID FROM `Room` WHERE `show`!='N' ORDER BY `Name`;", $con); + for ($i = 0; $i < mysql_num_rows($res); $i++) { + $Tag = $VeranstaltungsTage[$k]; + $RID = mysql_result($res, $i, "RID"); + $Rname = mysql_result($res, $i, "Name"); + echo "\t<a href=\"./schichtplan_druck.php?action=1&Raum=$RID&ausdatum=$Tag\" target=\"_blank\">$Tag $Rname</a><br />\n"; + } + echo "<br />\n"; + } + echo "<br /><br />"; + + include ("includes/footer.php"); +} else //################################################################# + { + if (IsSet ($_GET["Raum"]) AND IsSet ($_GET["ausdatum"])) { + $Raum = $_GET["Raum"]; + $ausdatum = $_GET["ausdatum"]; + + include ("config/config_db.php"); + include ("config/config.php"); + include ("includes/secure.php"); + //var wird nur gesetzt immer edit auszublenden, achtung sesion darf nicht gestart sein !!! + $_SESSION['CVS']["admin/schichtplan.php"] = "N"; + include ("includes/funktion_lang.php"); + include ("includes/funktion_schichtplan.php"); + include ("includes/funktion_schichtplan_aray.php"); + include ("includes/funktion_user.php"); +?> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> +<title>Schichtplan</title> +<meta name="keywords" content="Engel, Himmelsverwaltung"> +<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> +<meta http-equiv="Content-Style-Type" content="text/css"> +<meta http-equiv="expires" content="0"> +<meta name="robots" content="index"> +<meta name="revisit-after" content="1 days"> +<meta http-equiv="content-language" content="de"> +</head> +<body> + +<h1>Schichtplan</h1> + +<table> + <tr> + <td width="250" align="left"> + <span style="font-weight:bold;font-size:100%">Datum:</span> + <span style="font-weight:bold;font-size:200%"><?php echo $ausdatum; ?></span> + </td> + <td width="350" align="right"> + <span style="font-weight:bold;font-size:100%">Raum:</span> + <span style="font-weight:bold;font-size:200%"><?php echo $RoomID[$Raum]; ?> </span> + </td> + </tr> +</table> + +<table border="2" width="650" class="border" cellpadding="2" cellspacing="1"> + +<!--Ausgabe Spalten �berschrift--> + + <tr class="contenttopic"> + <th bgcolor="#E0E0E0">Uhrzeit</th> + <th bgcolor="#E0E0E0">Schichtplanbelegung</th> + </tr> +<?php + + + //Zeit Ausgeben + for ($i = 0; $i < 24; $i++) + for ($j = 0; $j < $GlobalZeileProStunde; $j++) { + $Spalten[$i * $GlobalZeileProStunde + $j] = "\t<tr class=\"content\">\n"; + if ($j == 0) { + $Spalten[$i * $GlobalZeileProStunde + $j] .= "\t\t<td rowspan=\"$GlobalZeileProStunde\">"; + if ($i < 10) + $Spalten[$i * $GlobalZeileProStunde + $j] .= "0"; + $Spalten[$i * $GlobalZeileProStunde + $j] .= "$i:"; + if ((($j * 60) / $GlobalZeileProStunde) < 10) + $Spalten[$i * $GlobalZeileProStunde + $j] .= "0"; + $Spalten[$i * $GlobalZeileProStunde + $j] .= (($j * 60) / $GlobalZeileProStunde) . "</td>\n"; + + } + } + + CreateRoomShifts($Raum); + + // Ausgabe Zeilen + for ($i = 0; $i < (24 * $GlobalZeileProStunde); $i++) + echo $Spalten[$i]; + // Ende + echo "</table>\n"; + + echo "Stand: " . gmdate("Y-m-d H:i") . "\n"; + echo "</body>\n"; + echo "</html>\n"; + + } //isset($Vars) +} //isset($Action) +?> diff --git a/www-ssl_old/admin/shiftadd.php b/www-ssl_old/admin/shiftadd.php new file mode 100644 index 00000000..d6b1f8ff --- /dev/null +++ b/www-ssl_old/admin/shiftadd.php @@ -0,0 +1,350 @@ +<?php +require_once ('../bootstrap.php'); + +$title = "Schicht Hinzufügen"; +$header = "Neue Schichten erfassen"; + +include ("includes/header.php"); + +$Time = time() + 3600 + 3600; + +echo "Hallo " . $_SESSION['Nick'] . ",<br />\n"; + +// erstellt ein Array der Reume +$sql = "SELECT `RID`, `Name` FROM `Room` ORDER BY `Name`"; +$Erg = mysql_query($sql, $con); +$rowcount = mysql_num_rows($Erg); + +for ($i = 0; $i < $rowcount; $i++) { + $Room[$i]["RID"] = mysql_result($Erg, $i, "RID"); + $Room[$i]["Name"] = mysql_result($Erg, $i, "Name"); +} + +// erstellt ein Aray der Engeltypen +$sql = "SELECT `TID`, `Name` FROM `EngelType` ORDER BY `Name`"; +$Erg = mysql_query($sql, $con); +$rowcount = mysql_num_rows($Erg); + +for ($i = 0; $i < $rowcount; $i++) { + $EngelType[$i]["TID"] = mysql_result($Erg, $i, "TID"); + $EngelType[$i]["Name"] = mysql_result($Erg, $i, "Name") . Get_Text("inc_schicht_engel"); +} + +// sesion mit stanadrt werten bef�llen +if (!isset ($_SESSION['shiftadd.php']['SchichtName'])) { + $_SESSION['shiftadd.php']['SchichtName'] = "--???--"; + $_SESSION['shiftadd.php']['RID'] = ""; + $_SESSION['shiftadd.php']['MonthJahr'] = gmdate("Y-m", $Time); + $_SESSION['shiftadd.php']['SDatum'] = gmdate("d", $Time); + $_SESSION['shiftadd.php']['STime'] = "10"; + $_SESSION['shiftadd.php']['MoreThenOne'] = "ON"; + $_SESSION['shiftadd.php']['EDatum'] = gmdate("d", $Time); + $_SESSION['shiftadd.php']['ETime'] = "12"; + $_SESSION['shiftadd.php']['len'] = "2"; + $_SESSION['shiftadd.php']['NachtON'] = "OFF"; + $_SESSION['shiftadd.php']['len_night'] = "00-04-08-10-12-14-16-18-20-22-24"; +} +// wenn werte �bergeben in sesion eintragen +if (!isset ($_GET["NachtON"])) + $_GET["NachtON"] = "OFF"; +if (!isset ($_GET["MoreThenOne"])) + $_GET["MoreThenOne"] = "OFF"; +if (isset ($_GET["SchichtName"])) { + foreach ($_GET as $k => $v) { + $_SESSION['shiftadd.php'][$k] = $v; + } +} + +if (!IsSet ($_GET["action"])) + $_GET["action"] = "new"; + +switch ($_GET["action"]) { + case 'new' : +?> +Hier kannst du neue Schichten eintragen. Dazu musst du den Anfang und das Ende der Schichten eintragen. +Über die Länge der Schichten errechnet sich dadurch die Anzahl dieser. Dadurch können gleich +mehrere Schichten auf einmal erfasst werden: + +<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" > + <table> + <tr> + <td align="right">Name:</td> + <td><input type="text" name="SchichtName" size="50" value="<?php echo $_SESSION["shiftadd.php"]["SchichtName"]; ?>"></td> + </tr> + <tr> + <td align="right">Ort:</td> + <td><select name="RID"> +<?php + + + foreach ($Room As $RTemp) { + echo "\t<option value=\"" . $RTemp["RID"] . "\""; + if ($RTemp["RID"] == $_SESSION["shiftadd.php"]["RID"]) + echo " SELECTED"; + echo ">" . $RTemp["Name"] . "</option>\n"; + } +?> + </select></td> + </tr> + + <tr><td><u>Zeit:</u></td></tr> + <tr> + <td align="right">Month.Jahr:</td> + <td><input type="ext" name="MonthJahr" size="7" value="<?php echo $_SESSION["shiftadd.php"]["MonthJahr"]; ?>"></td> + </tr> + <tr> + <td align="right">Beginn:</td> + <td>Date<input type="text" name="SDatum" size="5" value="<?php echo $_SESSION["shiftadd.php"]["SDatum"]; ?>"> + Time<input type="text" name="STime" size="5" value="<?php echo $_SESSION["shiftadd.php"]["STime"]; ?>"></td> + </tr> + <tr> + <td align="right">More then One</td> + <td><input type="checkbox" name="MoreThenOne" value="ON" <?php + + + if ($_SESSION["shiftadd.php"]["MoreThenOne"] == "ON") + echo " CHECKED"; +?>></td> + </tr> + <tr> + <td align="right">End:</td> + <td>Date<input type="text" name="EDatum" size="5" value="<?php echo $_SESSION["shiftadd.php"]["EDatum"]; ?>"> + Time<input type="text" name="ETime" size="5" value="<?php echo $_SESSION["shiftadd.php"]["ETime"]; ?>"></td> + </tr> + <tr> + <td align="right">Länge in h:</td> + <td><input type="text" name="len" size="5" value="<?php echo $_SESSION["shiftadd.php"]["len"]; ?>"></td> + </tr> + <tr> + <td align="right">Sonderschichten ein:</td> + <td><input type="checkbox" name="NachtON" value="ON" <?php + + + if ($_SESSION["shiftadd.php"]["NachtON"] == "ON") + echo " CHECKED"; +?>></td> + </tr> + <tr> + <td align="right">Sonder in h (Time;Time):</td> + <td><input type="text" name="len_night" size="50" value="<?php echo $_SESSION["shiftadd.php"]["len_night"]; ?>"></td> + </tr> + + <tr><td><u>Anzahl Engel je Type:</u></td></tr> +<?php + + + foreach ($EngelType As $TTemp) { + echo " <tr><td align=\"right\">" . $TTemp["Name"] . ":</td>\n"; + echo " <td><input type=\"text\" name=\"EngelType" . $TTemp["TID"] . "\" size=\"5\" value=\""; + if (isset ($_SESSION["shiftadd.php"]["EngelType" . $TTemp["TID"]])) + echo $_SESSION["shiftadd.php"]["EngelType" . $TTemp["TID"]]; + else + echo "0"; + echo "\"></td>\n"; + } +?> +</table> + <br /> +<input type="hidden" name="OnlyShow" value="ON"> +<input type="hidden" name="action" value="newsave"> +<input type="submit" value="zeig mal Gabriel!"> +</form> + +<?php + + + break; // Ende new + + case 'newsave' : + if (isset ($_GET["SDatum"]) && ($_GET["len"] > 0)) { + $lenOrg = $_GET["len"]; + if ($_GET["NachtON"] == "ON") { + $lenArrayDummy = explode("-", $_GET["len_night"]); + foreach ($lenArrayDummy as $Temp) { + if (isset ($Temp2)) + $lenArray[intval($Temp2)] = intval($Temp) - intval($Temp2); + $Temp2 = $Temp; + } //foreach + } //IF( $NachtON == "ON" ) + + echo "<table border=\"1\">\n"; + echo "<tr>\n"; + echo "\t<td valign=\"top\" align=\"center\">Start</td>\n"; + echo "\t<td valign=\"top\" align=\"center\">End</td>\n"; + echo "\t<td valign=\"top\" align=\"center\">len</td>\n"; + echo "\t<td valign=\"top\" align=\"center\">RID</td>\n"; + echo "\t<td valign=\"top\" align=\"center\">Beschreibung</td>\n"; + echo "\t<td valign=\"top\" align=\"center\">Entry 'Shifts'</td>\n"; + echo "\t<td valign=\"top\" align=\"center\">SID</td>\n"; + echo "\t<td valign=\"top\" align=\"center\">Entrys</td>\n"; + echo "</tr>\n"; + + $DateEnd = $_GET["SDatum"]; + $TimeEnd = intval($_GET["STime"]); + $len = 0; + do { + // define Start time + $Date = $DateEnd; + $Time = $TimeEnd; + $_DateS = $_GET["MonthJahr"] . "-" . $Date . " " . $Time . ":00:00"; + + // define End time + if ($_GET["NachtON"] == "ON") { + if (!isset ($lenArray[$Time])) + die("Zeit $Time h nicht definiert."); + $_GET["len"] = $lenArray[$Time]; + if ($_GET["len"] < 1) + die("len <1"); + } + $TimeEnd = $Time + $_GET["len"]; + + //Tages�berschreitung + while ($TimeEnd >= 24) { + $TimeEnd -= 24; + $DateEnd += 1; + } + //ist schischt zu lang dan verk�rzen + if ($DateEnd > $_GET["EDatum"] || ($DateEnd == $_GET["EDatum"] && $TimeEnd >= $_GET["ETime"])) { + $_GET["len"] -= ($DateEnd - $_GET["EDatum"]) * 24; + $_GET["len"] -= ($TimeEnd - $_GET["ETime"]); // -(-) ->> + + $DateEnd = $_GET["EDatum"]; + $TimeEnd = $_GET["ETime"]; + } + $_DateE = $_GET["MonthJahr"] . "-" . $DateEnd . " " . $TimeEnd . ":00:00"; + + if ($_DateS != $_DateE) + CreateNewEntry(); + + if ($_GET["MoreThenOne"] != "ON") + break; + if ($DateEnd >= $_GET["EDatum"] && $TimeEnd >= intval($_GET["ETime"])) + break; + } + while (true); + echo "</table>"; + + if ($_GET["OnlyShow"] == "ON") { + echo "<form action=\"" . $_SERVER['SCRIPT_NAME'] . "\">"; + echo "\n\t<Input type=\"hidden\" name=\"SchichtName\" value=\"" . $_GET["SchichtName"] . "\">"; + echo "\n\t<input type=\"hidden\" name=\"MonthJahr\" value=\"" . $_GET["MonthJahr"] . "\">"; + echo "\n\t<input type=\"hidden\" name=\"SDatum\" value=\"" . $_GET["SDatum"] . "\">"; + echo "\n\t<input type=\"hidden\" name=\"STime\" value=\"" . $_GET["STime"] . "\">"; + echo "\n\t<input type=\"hidden\" name=\"MoreThenOne\" value=\"" . $_GET["MoreThenOne"] . "\">"; + echo "\n\t<input type=\"hidden\" name=\"EDatum\" value=\"" . $_GET["EDatum"] . "\">"; + echo "\n\t<input type=\"hidden\" name=\"ETime\" value=\"" . $_GET["ETime"] . "\">"; + echo "\n\t<input type=\"hidden\" name=\"len\" value=\"" . $lenOrg . "\">"; + echo "\n\t<input type=\"hidden\" name=\"RID\" value=\"" . $_GET["RID"] . "\">"; + echo "\n\t<input type=\"hidden\" name=\"NachtON\" value=\"" . $_GET["NachtON"] . "\">"; + echo "\n\t<input type=\"hidden\" name=\"len_night\" value=\"" . $_GET["len_night"] . "\">"; + echo "\n\t<input type=\"hidden\" name=\"OnlyShow\" value=\"OFF\">"; + foreach ($EngelType As $TTemp) { + $Temp = "EngelType" . $TTemp["TID"]; + echo "\n\t<input type=\"hidden\" name=\"" . $Temp . "\" value=\"" . $_GET[$Temp] . "\">"; + } + echo "\n\t<input type=\"hidden\" name=\"action\" value=\"newsave\">"; + echo "\n\t<input type=\"submit\" value=\"mach mal Gabriel!\">"; + echo "\n</form>"; + } //if + } //IF + break; + + case 'engeldel' : + break; + +} // end switch + +function CreateNewEntry() { + global $con, $_DateS, $_DateE, $EngelType, $debug; + foreach ($EngelType As $TTemp) { + $Temp = "EngelType" . $TTemp["TID"]; + global $$Temp; + } + + echo "<tr>\n"; + + echo "\t<td>$_DateS</td>\n"; + echo "\t<td>$_DateE</td>\n"; + echo "\t<td>" . $_GET["len"] . "</td>\n"; + echo "\t<td>" . $_GET["RID"] . "</td>\n"; + echo "\t<td>" . $_GET["SchichtName"] . "</td>\n"; + + // Ist eintarg schon vorhanden? + $SQL = "SELECT `SID` FROM `Shifts` "; + $SQL .= "WHERE (" . + "`DateS` = '" . $_DateS . "' AND " . + "`DateE` = '" . $_DateE . "' AND " . + "`RID` = '" . $_GET["RID"] . "');"; + $Erg = mysql_query($SQL, $con); + + if (mysql_num_rows($Erg) != 0) + echo "\t<td>exists</td>"; + elseif ($_GET["OnlyShow"] == "OFF") { + // erstellt Eintrag in Shifts f�r die algemeine schicht + $SQL = "INSERT INTO `Shifts` ( `DateS`, `DateE`, `Len`, `RID`, `Man`) VALUES ( "; + $SQL .= "'" . $_DateS . "', '" . $_DateE . "', "; + $SQL .= "'" . $_GET["len"] . "', '" . $_GET["RID"] . "', "; + $SQL .= "'" . $_GET["SchichtName"] . "');"; + $Erg = db_query($SQL, "create shift"); + + $SQLFail = "\n\t<br />[" . $SQL . "]"; + + if ($Erg == 1) + echo "\t<td>pass</td>\n"; + else + echo "\t<td>fail <br />\n<u>" . mysql_error($con) . "</u>$SQLFail</td>\n"; + + } else + echo "\t<td>only show</td>\n"; + + // sucht SID von eingetragennen schiten + $SQL = "SELECT SID FROM `Shifts` "; + $SQL .= "WHERE (" . + "`DateS` = '" . $_DateS . "' AND " . + "`DateE` = '" . $_DateE . "' AND " . + "`Len` = '" . $_GET["len"] . "' AND " . + "`RID` = '" . $_GET["RID"] . "');"; + $Erg = mysql_query($SQL, $con); + if (mysql_num_rows($Erg) == 0) + echo "\t<td>?</td>"; + else { + $SID = mysql_result($Erg, 0, "SID"); + echo "\t<td>" . $SID . "</td>"; + } + + // erstellt f�r jeden Engeltypen die eintrage in 'ShiftEntry' + echo "\t<td>"; + foreach ($EngelType As $TTemp) { + $Temp = "EngelType" . $TTemp["TID"]; + + if ($_GET[$Temp] > 0) { + $i = 0; + echo $_GET[$Temp] . " " . $TTemp["Name"] . "<br />\t"; + while ($i++ < $_GET[$Temp]) { + if ($_GET["OnlyShow"] == "OFF") { + $SQL = "INSERT INTO `ShiftEntry` (`SID`, `TID`) VALUES ("; + $SQL .= "'" . $SID . "', "; + $SQL .= "'" . $TTemp["TID"] . "');"; + + $Erg = mysql_query($SQL, $con); + + if ($debug) + $SQLFail = "\n\t<br />[" . $SQL . "]"; + + if ($Erg == 1) + echo "'pass' "; + else + echo "'fail' <u>" . mysql_error($con) . "</u>$SQLFail</td>\n"; + + } else + echo "+"; + } + echo "<br />"; + } // IF $$TEMP + } // FOREACH + echo "</td>"; + + echo "</tr>\n"; +} + +include ("includes/footer.php"); +?> diff --git a/www-ssl_old/admin/tshirt.php b/www-ssl_old/admin/tshirt.php new file mode 100644 index 00000000..9a8e7010 --- /dev/null +++ b/www-ssl_old/admin/tshirt.php @@ -0,0 +1,62 @@ +<?php +require_once ('../bootstrap.php'); + +$title = "T-Shirt-Ausgabe"; +$header = "T-Shirt-Ausgabe für aktiven Engel"; +include ("includes/header.php"); +include ("includes/funktion_db_list.php"); + +If (IsSet ($_GET["aktiv"])) { + + $SQL = "UPDATE `User` SET `Tshirt`='1' WHERE `UID`='" . $_GET["aktiv"] . "' limit 1"; + $Erg = mysql_query($SQL, $con); + if ($Erg == 1) { + } else { + echo "Fehler beim speichern bei Engel " . UID2Nick($_GET["aktive"]) . "<br />"; + } +} +?> + +Über die Suchen-Funktion des Browsers kann diese Liste schnell nach einem Nick abgesucht werden.<br /> +Hinter diesem erscheint ein Link, über den man eintragen kann, dass der Engel sein T-Shirt erhalten hat.<br /><br /> + +Liste aller aktiven Engel: + +<?php + + +$SQL = "SELECT * FROM `User` WHERE (`Aktiv`='1') ORDER BY `Nick` ASC"; +$Erg = mysql_query($SQL, $con); + +$rowcount = mysql_num_rows($Erg); +?> +<table width="100%" class="border" cellpadding="2" cellspacing="1"> + <tr class="contenttopic"> + <td>Nick</td> + <td>Aktiv?</td> + <td>Grösse</td> + <td>T-Shirt ausgeben:</td> + </td> +<?php + + +for ($i = 0; $i < $rowcount; $i++) { + echo "\t<tr class=\"content\">\n"; + $eUID = mysql_result($Erg, $i, "UID"); + echo "\t\t<td>" . UID2Nick($eUID) . "</td>\n"; + echo "\t\t<td>" . mysql_result($Erg, $i, "Aktiv") . "</td>\n"; + echo "\t\t<td>" . mysql_result($Erg, $i, "Size") . "</td>\n"; + + if (mysql_result($Erg, $i, "Tshirt") == "1") { + echo "\t\t<td>bereits erhalten</td>"; + } else { + echo "\t\t<td><a href=\"./tshirt.php?aktiv=$eUID\">XXXXXXXX</a></td>"; + } + echo "\t</tr>\n"; +} + +echo "</table>"; + +include ("includes/footer.php"); +?> + diff --git a/www-ssl_old/admin/userArrived.php b/www-ssl_old/admin/userArrived.php new file mode 100644 index 00000000..93857d2e --- /dev/null +++ b/www-ssl_old/admin/userArrived.php @@ -0,0 +1,53 @@ +<?php +require_once ('../bootstrap.php'); + +$title = "Engel Arrived"; +$header = "Engel was arrived"; +include ("includes/header.php"); +include ("includes/funktion_db_list.php"); + +If (IsSet ($_GET["arrived"])) { + + $SQL = "UPDATE `User` SET `Gekommen`='1' WHERE `UID`='" . $_GET["arrived"] . "' limit 1"; + $Erg = db_query($SQL, "Set User as Gekommen"); + if ($Erg == 1) { + echo "<h2>" . Get_Text("pri_userArrived_WriteOK") . " \"" . UID2Nick($_GET["arrived"]) . "\"</h2>"; + } else { + echo "<h1>" . Get_Text("pri_userArrived_WriteError") . " \"" . UID2Nick($_GET["arrived"]) . "\"</h1>"; + } +} + +echo Get_Text("pri_userArrived_Text1") . "<br />"; +echo Get_Text("pri_userArrived_Text2") . "<br /><br />"; + +echo Get_Text("pri_userArrived_TableToppic"); +$SQL = "SELECT * FROM `User` ORDER BY `Nick` ASC"; +$Erg = mysql_query($SQL, $con); + +$rowcount = mysql_num_rows($Erg); + +echo "<table width=\"100%\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n"; +echo "\t<tr class=\"contenttopic\">\n"; +echo "\t\t<td>" . Get_Text("pri_userArrived_TableTD_Nick") . "</td>\n"; +echo "\t\t<td>" . Get_Text("pri_userArrived_TableTD_ArrivedShow") . "</td>\n"; +echo "\t\t<td>" . Get_Text("pri_userArrived_TableTD_ArrivedSet") . "</td>\n"; +echo "\t</td>\n"; + +for ($i = 0; $i < $rowcount; $i++) { + echo "\t<tr class=\"content\">\n"; + $eUID = mysql_result($Erg, $i, "UID"); + echo "\t\t<td>" . UID2Nick($eUID) . "</td>\n"; + echo "\t\t<td>" . mysql_result($Erg, $i, "Gekommen") . "</td>\n"; + + if (mysql_result($Erg, $i, "Gekommen") == "1") { + echo "\t\t<td>" . Get_Text("pri_userArrived_TableEntry_Arrived") . "</td>"; + } else { + echo "\t\t<td><a href=\"./userArrived.php?arrived=$eUID\">" . Get_Text("pri_userArrived_TableEntry_Set") . "</a></td>"; + } + echo "\t</tr>\n"; +} +echo "</table>"; + +include ("includes/footer.php"); +?> + diff --git a/www-ssl_old/nonpublic/myschichtplan.php b/www-ssl_old/nonpublic/myschichtplan.php new file mode 100644 index 00000000..5d7b5da3 --- /dev/null +++ b/www-ssl_old/nonpublic/myschichtplan.php @@ -0,0 +1,178 @@ +<?php + +// Eigener Schichtplan +require_once ('../bootstrap.php'); + +$title = "Himmel"; +$header = "Mein Schichtplan"; + +include ("includes/header.php"); +include ("includes/funktionen.php"); +include ("includes/funktion_schichtplan.php"); +include ("includes/funktion_schichtplan_aray.php"); + +if (!isset ($_GET["action"])) { + echo Get_Text("Hello") . $_SESSION['Nick'] . ", <br />\n"; + echo Get_Text("pub_mywake_beschreibung1") . "<br />\n"; + echo Get_Text("pub_mywake_beschreibung2") . "<br /><br />\n"; + echo Get_Text("pub_mywake_beschreibung3") . ($LETZTES_AUSTRAGEN) . + Get_Text("pub_mywake_beschreibung4") . "<br /><br />\n"; + + $USER_ID = $_SESSION['UID']; + + if ($_SESSION['CVS']["admin/schichtplan.php"] == "Y") { + if (!isset ($_GET["UIDs"])) + $_GET["UIDs"] = $_SESSION['UID']; + else + $USER_ID = $_GET["UIDs"]; + + echo "<form action=\"" . $_SERVER['SCRIPT_NAME'] . "\" method=\"GET\" >"; + + echo "Liste von <select name=\"UIDs\">\n"; + + $usql = "SELECT * FROM `User` ORDER BY `Nick`"; + $uErg = mysql_query($usql, $con); + $urowcount = mysql_num_rows($uErg); + + for ($k = 0; $k < $urowcount; $k++) { + echo "<option value=\"" . mysql_result($uErg, $k, "UID") . "\" " . + (($_GET["UIDs"] == mysql_result($uErg, $k, "UID")) ? " selected" : "") . ">" . + mysql_result($uErg, $k, "Nick") . + "</option>\n"; + } + + echo "</select> anzeigen.\n"; + echo mysql_error($con); + + echo "<input type=\"submit\" value=\"zeigen\">\n"; + + echo "</form>"; + } + + $SQL = "SELECT *, `ShiftEntry`.`Comment`, `ShiftEntry`.`TID` FROM `Shifts` " . + "INNER JOIN `ShiftEntry` " . + "ON `Shifts`.`SID`=`ShiftEntry`.`SID` " . + "WHERE `ShiftEntry`.`UID`='$USER_ID' " . + "ORDER BY `DateS`"; + $erg = mysql_query($SQL, $con); +?> + <table border="0" class="border" cellpadding="2" cellspacing="1"> + <tr> + <td class="contenttopic"><b><?php echo Get_Text("pub_mywake_Datum");?></b></td> + <td class="contenttopic"><b><?php echo Get_Text("pub_mywake_Uhrzeit");?></b></td> + <td class="contenttopic"><b><?php echo Get_Text("pub_mywake_Len");?></b></td> + <td class="contenttopic"><b><?php echo Get_Text("pub_mywake_Name");?></b></td> + <td class="contenttopic"><b><?php echo Get_Text("pub_mywake_Ort");?></b></td> + <td class="contenttopic"><b><?php echo Get_Text("pub_mywake_Bemerkung");?></b></td> + <td class="contenttopic"><b><?php echo Get_Text("pub_mywake_Austragen");?></b></td> + </tr> + <?php + + + for ($i = 0; $i < mysql_num_rows($erg); $i++) { + echo "<tr class=\"content\">"; + + echo "<td>" . substr(mysql_result($erg, $i, "DateS"), 0, 10) . "</td>\n"; + echo "<td>" . substr(mysql_result($erg, $i, "DateS"), 11) . "</td>\n"; + echo "<td>" . mysql_result($erg, $i, "Len") . " h</td>\n"; + echo "<td>" . mysql_result($erg, $i, "Man") . "</td>\n"; + echo "<td>" . $RoomID[mysql_result($erg, $i, "RID")] . "<br />\n" . + "(" . TID2Type(mysql_result($erg, $i, "TID")) . Get_Text("inc_schicht_engel") . ")" . + "</td>\n"; + echo "<td><pre style=\"font-family:Fixedsys,Courier; padding:12x;\">\n" . + mysql_result($erg, $i, "Comment") . + "\n</pre>\n"; + echo "<br /><a href=\"./myschichtplan.php?action=edit&SID=\n" . + mysql_result($erg, $i, "SID") . "\"># vi #</a></td>\n"; + + // bis $LETZTES_AUSTRAGEN (aus dem config-file) soll es moeglich sein, seine Schichten + //// selber noch austragen zu koennen... + $schichtdate = mysql_result($erg, $i, "DateS"); + ereg("^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})", $schichtdate, $res); + $info["year"] = $res[1]; + $info["month"] = $res[2]; + $info["day"] = $res[3]; + $info["hour"] = $res[4]; + $info["min"] = $res[5]; + $info["sec"] = $res[6]; + $schichtdatum = (mktime($info["hour"], $info["min"], $info["sec"], $info["month"], $info["day"], $info["year"])); + $lastAustragen = $LETZTES_AUSTRAGEN * 3600; + $nowdate = time(); + // wenn Schichtbeginn > jetziges Datum + $LETZTES_AUSTRAGEN - Stunden soll ein Austragen + // noch m�glich sein + if ($schichtdatum > ($lastAustragen + $nowdate)) + echo "<td> <a href=\"./myschichtplan.php?action=austragen&SID=" . + mysql_result($erg, $i, "SID") . "\">" . + Get_Text("pub_mywake_austragen") . "</a></td>\n"; + else + echo "<td>" . Get_Text("pub_mywake_austragen_n_c") . "</td>\n"; + + echo "</tr>\n"; + } + echo "</table>\n\n"; + + if ($_SESSION['CVS']["nonpublic/myschichtplan_ical.php"] == "Y") { + echo "<br /><a href=\"./myschichtplan_ical.php\">" . Get_Text("pub_myschichtplan_ical") . "</a>\n"; + } + +} else { + If ($_GET["action"] == "austragen") { + echo Get_Text("pub_mywake_delate1") . "<br />\n"; + + $sql = "SELECT * FROM `Shifts` WHERE (`SID` = '" . $_GET["SID"] . "')"; + $Erg = mysql_query($sql, $con); + + $schichtdate = mysql_result($Erg, 0, "DateS"); + ereg("^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})", $schichtdate, $res); + $info["year"] = $res[1]; + $info["month"] = $res[2]; + $info["day"] = $res[3]; + $info["hour"] = $res[4]; + $info["min"] = $res[5]; + $info["sec"] = $res[6]; + $schichtdatum = (mktime($info["hour"], $info["min"], $info["sec"], $info["month"], $info["day"], $info["year"])); + $lastAustragen = $LETZTES_AUSTRAGEN * 3600; + $nowdate = time(); + // wenn Schichtbeginn > jetziges Datum + $LETZTES_AUSTRAGEN - Stunden soll ein Austragen + // noch m�glich sein + if ($schichtdatum > ($lastAustragen + $nowdate)) { + $sql2 = "UPDATE `ShiftEntry` " . + "SET `UID` = '0', `Comment` = NULL " . + "WHERE `SID` = '" . $_GET["SID"] . "' AND `UID` = '" . $_SESSION['UID'] . "' LIMIT 1;"; + $Erg2 = mysql_query($sql2, $con); + if ($Erg2 == 1) + echo Get_Text("pub_mywake_add_ok") . "\n"; + else + echo Get_Text("pub_mywake_add_ko") . "\n"; + } else + echo Get_Text("pub_mywake_after") . "\n"; + } + elseif ($_GET["action"] == "edit") { + echo Get_Text("pub_myshift_Edit_Text1") . "\n"; + + $sql = "SELECT * FROM `ShiftEntry` WHERE "; + $sql .= "(`SID`='" . $_GET["SID"] . "' AND `UID`='" . $_SESSION['UID'] . "')"; + $Erg = mysql_query($sql, $con); + + echo "<form action=\"./myschichtplan.php\" method=\"GET\">\n"; + echo "<textarea name='newtext' cols='50' rows='10'>" . mysql_result($Erg, 0, "Comment") . "</textarea><br /><br />\n"; + echo "<input type=\"submit\" value=\"save\">\n"; + echo "<input type=\"hidden\" name=\"SID\" value=\"" . $_GET["SID"] . "\">\n"; + echo "<input type=\"hidden\" name=\"action\" value=\"editSave\">\n"; + echo "</form>"; + } + elseif ($_GET["action"] == "editSave") { + echo Get_Text("pub_myshift_EditSave_Text1") . "<br />\n"; + $sql = "UPDATE `ShiftEntry` " . + "SET `Comment` = '" . $_GET["newtext"] . "' " . + "WHERE `SID`='" . $_GET["SID"] . "' AND `UID`='" . $_SESSION['UID'] . "' LIMIT 1;"; + $Erg = mysql_query($sql, $con); + if ($Erg == 1) + echo " ..." . Get_Text("pub_myshift_EditSave_OK") . "\n"; + else + echo " ..." . Get_Text("pub_myshift_EditSave_KO") . "\n"; + SetHeaderGo2Back(); + } +} +include ("includes/footer.php"); +?> diff --git a/www-ssl_old/nonpublic/myschichtplan_ical.php b/www-ssl_old/nonpublic/myschichtplan_ical.php new file mode 100644 index 00000000..ff74fef0 --- /dev/null +++ b/www-ssl_old/nonpublic/myschichtplan_ical.php @@ -0,0 +1,51 @@ +<?php +require_once ('../bootstrap.php'); + +include ("includes/header_start.php"); + +include ("includes/funktion_schichtplan_aray.php"); + +$SQL = "SELECT *, `ShiftEntry`.`Comment`, `ShiftEntry`.`TID` FROM `Shifts` " . +"INNER JOIN `ShiftEntry` " . +"ON `Shifts`.`SID`=`ShiftEntry`.`SID` " . +"WHERE `ShiftEntry`.`UID`='" . $_SESSION['UID'] . "' " . +"ORDER BY `DateS`"; +$erg = mysql_query($SQL, $con); + +//HEADER +header("Content-Type: text/x-vCalendar"); +header("Content-Disposition: attachment; filename=\"Schichtplan.ics\""); + +//DATA +echo "BEGIN:VCALENDAR\n"; +echo "PRODID:-//Engelsystem//DE-EN\n"; +echo "VERSION:2.0\n"; +echo "PRODID:" . md5('icalschichtplan:' . $_SESSION['UID']) . "\n"; +echo "METHOD:PUBLISH\n"; +echo "CALSCALE:GREGORIAN\n"; +echo "METHOD:PUBLISH\n"; +echo "X-WR-CALNAME;VALUE=TEXT:" . "Himmel - Schichtplan\n"; + +for ($i = 0; $i < mysql_num_rows($erg); $i++) { + echo "BEGIN:VEVENT\n"; + echo "UID:" . md5(mysql_result($erg, $i, "Man") . mysql_result($erg, $i, "DateS")) . "\n"; + echo "METHOD:PUBLISH\n"; + echo "DTSTART;TZID=Europe/Berlin:" . date('Ymd\THis', strtotime(mysql_result($erg, $i, "DateS"))) . "\n"; + echo "DTEND;TZID=Europe/Berlin:" . date('Ymd\THis', strtotime(mysql_result($erg, $i, "DateE"))) . "\n"; + echo "SUMMARY:" . str_replace(',', '\\,', mysql_result($erg, $i, "Man")) . "\n"; + echo "CLASS:PUBLIC\n"; + echo "STATUS:CONFIRMED\n"; + echo "URL:" . $url . $ENGEL_ROOT . "nonpublic/myschichtplan.php\n"; + echo "LOCATION:" . $RoomID[mysql_result($erg, $i, "RID")] . "\n"; + echo "BEGIN:VALARM\n"; + echo "TRIGGER;VALUE=DURATION:-PT5M\n"; + echo "DESCRIPTION:" . str_replace(',', '\\,', mysql_result($erg, $i, "Man")) . "\n"; + echo "ACTION:DISPLAY\n"; + echo "END:VALARM\n"; + echo "END:VEVENT\n"; +} +echo "END:VCALENDAR\n"; + +include ("includes/funktion_counter.php"); +?> + diff --git a/www-ssl_old/nonpublic/schichtplan.1.php b/www-ssl_old/nonpublic/schichtplan.1.php new file mode 100644 index 00000000..9c99c6ca --- /dev/null +++ b/www-ssl_old/nonpublic/schichtplan.1.php @@ -0,0 +1,20 @@ +<h4> Tage </h4> + +<?PHP +require_once ('../bootstrap.php'); + +include ("includes/funktion_schichtplan_aray.php"); + +function Printlink($Datum) { + GLOBAL $raum; + echo "\t<li><a href='./schichtplan.php?ausdatum=$Datum"; + // ist ein raum gesetzt? + if (IsSet ($raum)) + echo "&raum=$raum"; + echo "'>$Datum</a></li>\n"; +} //function Printlink( + +if (isset ($VeranstaltungsTage)) + foreach ($VeranstaltungsTage as $k => $v) + Printlink($v); +?> diff --git a/www-ssl_old/nonpublic/schichtplan.2.php b/www-ssl_old/nonpublic/schichtplan.2.php new file mode 100644 index 00000000..92443e13 --- /dev/null +++ b/www-ssl_old/nonpublic/schichtplan.2.php @@ -0,0 +1,22 @@ +<h4> Raumübersicht</h4> +<?php +require_once ('../bootstrap.php'); + +include ("includes/funktion_schichtplan_aray.php"); + +if (isset ($Room)) + foreach ($Room as $RoomEntry) { + if (isset ($ausdatum)) + echo "\t<li><a href='./schichtplan.php?ausdatum=$ausdatum&raum=" . $RoomEntry["RID"] . "'>" . + $RoomEntry["Name"] . "</a></li>\n"; + else + echo "\t<li><a href='./schichtplan.php?raum=" . $RoomEntry["RID"] . "'>" . + $RoomEntry["Name"] . "</a></li>\n"; + } +echo "<br />"; +if (isset ($ausdatum)) + echo "<li><a href='./schichtplan.php?ausdatum=$ausdatum&raum=-1'>alle</a></li>"; +else + echo "<li><a href='./schichtplan.php?raum=-1'>alle</a></li>"; +?> + diff --git a/www-ssl_old/nonpublic/schichtplan.php b/www-ssl_old/nonpublic/schichtplan.php new file mode 100644 index 00000000..2b9038a3 --- /dev/null +++ b/www-ssl_old/nonpublic/schichtplan.php @@ -0,0 +1,220 @@ +<?php +require_once ('../bootstrap.php'); + +$title = "Himmel"; +$header = "Schichtpläne"; +$submenus = 2; + +if (isset ($_GET["ausdatum"])) + $ausdatum = $_GET["ausdatum"]; +if (isset ($_GET["raum"])) { + $raum = $_GET["raum"]; + + if ($raum == -1 && isset ($_GET["show"])) { + $raum = ""; + foreach ($_GET as $k => $v) { + if (substr($k, 0, 5) == "raum_") { + $raum = $raum . ";" . $v; + } + } + } +} + +<<<<<<< HEAD +include ("../../includes/header.php"); +include ("../../includes/funktionen.php"); +include ("../../includes/funktion_schichtplan.php"); +include ("../../includes/funktion_schichtplan_array.php"); +?> +======= +include ("includes/header.php"); +include ("includes/funktionen.php"); +include ("includes/funktion_schichtplan.php"); +include ("includes/funktion_schichtplan_aray.php"); +>>>>>>> spezial_includes_camp + +echo Get_Text("Hello") . $_SESSION['Nick'] . ",<br />" . +Get_Text("pub_schicht_beschreibung") . "<br /><br />"; + +function ShowSwitchDay() { + global $VeranstaltungsTage, $VeranstaltungsTageMax, $ausdatum, $raum; + + echo "\n\n<table border=\"0\" width=\"100%\"><tr>\n"; + + if (isset ($VeranstaltungsTage)) + 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... +if (!isset ($ausdatum)) { + $sql = "SELECT `DateS` FROM `Shifts` WHERE `DateS` like '" . gmdate("Y-m-d", time() + $gmdateOffset) . "%' ORDER BY `DateS`"; + // $sql = "SELECT `DateS` FROM `Shifts` WHERE `DateS` like '2004-12-29%' ORDER BY `DateS`"; + $Erg = mysql_query($sql, $con); + if (mysql_num_rows($Erg) == 0) { + $sql = "SELECT `DateS` FROM `Shifts` ORDER BY `DateS` ASC LIMIT 0, 1"; + $Erg = mysql_query($sql, $con); + } + if (mysql_num_rows($Erg) > 0) + $ausdatum = substr(mysql_result($Erg, 0, "DateS"), 0, 10); + else + $ausdatum = gmdate("Y-m-d", time() + $gmdateOffset); + +} + +if (!isset ($raum)) { + // Ausgabe wenn kein Raum Ausgew�hlt: + echo Get_Text("pub_schicht_auswahl_raeume") . "<br /><br />\n"; + +<<<<<<< HEAD + +if ( !isset($raum) ) +{ + // Ausgabe wenn kein Raum Ausgew�hlt: + echo Get_Text("pub_schicht_auswahl_raeume"). "<br><br>\n"; + + if( isset($Room)) + { +======= + if (isset ($Room)) { +>>>>>>> spezial_includes_camp + echo "<form action=\"./schichtplan.php\" method=\"GET\">\n"; + foreach ($Room as $RoomEntry) { + echo "\t<li><input type=\"checkbox\" name=\"raum_" . $RoomEntry["RID"] . "\" value=\"" . $RoomEntry["RID"] . " \">"; + echo "<a href='./schichtplan.php?ausdatum=$ausdatum&raum=" . $RoomEntry["RID"] . "'>" . $RoomEntry["Name"] . "</a>"; + echo "</input></li>\n"; + } + echo "<input type=\"hidden\" name=\"ausdatum\" value=\"$ausdatum\">"; + echo "<input type=\"hidden\" name=\"raum\" value=\"-1\">"; + echo "<input type=\"submit\" name=\"show\" value=\"show\">\n"; + echo "</form>\n"; + } + + echo "<br /><br />"; + echo Get_Text("pub_schicht_alles_1") . "<a href='./schichtplan.php?ausdatum=$ausdatum&raum=-1'> <u>" . + Get_Text("pub_schicht_alles_2") . "</u> </a>" . Get_Text("pub_schicht_alles_3"); + echo "\n<br /><br />\n\n"; + echo "<hr>\n\n"; + echo Get_Text("pub_schicht_EmptyShifts") . "\n"; + + // zeit die naesten freien schichten +<<<<<<< HEAD + showEmptyShifts(); +} +else +{ // Wenn einraum Ausgew�hlt ist: + if( $raum == -1 ) + echo Get_Text("pub_schicht_Anzeige_1").$ausdatum.":<br><br>"; + elseif( substr( $raum, 0, 1) == ";" ) + echo Get_Text("pub_schicht_Anzeige_1").$ausdatum.":<br><br>"; + else + echo Get_Text("pub_schicht_Anzeige_1"). $ausdatum. + Get_Text("pub_schicht_Anzeige_2"). $RoomID[$raum]. "<br><br>"; +======= + showEmptyShifts(); +} else { // Wenn einraum Ausgew�hlt ist: + if ($raum == -1) + echo Get_Text("pub_schicht_Anzeige_1") . $ausdatum . ":<br /><br />"; + elseif (substr($raum, 0, 1) == ";") echo Get_Text("pub_schicht_Anzeige_1") . $ausdatum . ":<br /><br />"; + else + echo Get_Text("pub_schicht_Anzeige_1") . $ausdatum . + Get_Text("pub_schicht_Anzeige_2") . $RoomID[$raum] . "<br /><br />"; +>>>>>>> spezial_includes_camp + + 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"; + + //Ausgabe Spalten �berschrift +<<<<<<< HEAD + if( $raum == -1 ) + { + if( isset($Room)) + foreach( $Room as $RoomEntry ) + if (SummRoomShifts($RoomEntry["RID"]) > 0) + echo "\t\t<th>". $RoomEntry["Name"]. "</th>\n"; +======= + if ($raum == -1) { + if (isset ($Room)) + foreach ($Room as $RoomEntry) + if (SummRoomShifts($RoomEntry["RID"]) > 0) + echo "\t\t<th>" . $RoomEntry["Name"] . "</th>\n"; +>>>>>>> spezial_includes_camp + } + elseif (substr($raum, 0, 1) == ";") { + $words = preg_split("/;/", $raum); + foreach ($words as $word) { + if (strlen(trim($word)) > 0) + echo "\t\t<th>" . $RoomID[trim($word)] . "</th>\n"; + } + } else + echo "\t\t<th>" . $RoomID[$raum] . "</th>\n"; + echo "\t</tr>\n"; + + //Zeit Ausgeben + for ($i = 0; $i < 24; $i++) + for ($j = 0; $j < $GlobalZeileProStunde; $j++) { + $Spalten[$i * $GlobalZeileProStunde + $j] = "\t<tr class=\"content\">\n\t\t"; + + //Stunde: + $SpaltenTemp = ""; + $SpaltenTemp .= ($i < 10) ? "0$i:" : "$i:"; + + //Minute + $TempMinuten = (($j * 60) / $GlobalZeileProStunde); + $SpaltenTemp .= ($TempMinuten < 10) ? "0$TempMinuten" : "$TempMinuten"; + + //aktuelle stunde markieren + if (($j == 0) && ($i == gmdate("H", time() + $gmdateOffset)) && (gmdate("Y-m-d", time() + $gmdateOffset) == $ausdatum)) + $SpaltenTemp = "<h1>$SpaltenTemp</h1>"; + + $SpaltenTemp = "<td>$SpaltenTemp</td>\n"; + $Spalten[$i * $GlobalZeileProStunde + $j] .= $SpaltenTemp; + } + + if ($raum == -1) { + if (isset ($Room)) + foreach ($Room as $RoomEntry) + if (SummRoomShifts($RoomEntry["RID"]) > 0) + CreateRoomShifts($RoomEntry["RID"]); + } + elseif (substr($raum, 0, 1) == ";") { + if (isset ($Room)) { + $words = preg_split("/;/", $raum); + foreach ($words as $word) { + if (strlen(trim($word)) > 0) + if (SummRoomShifts($word) > 0) + CreateRoomShifts($word); + } + } + } else + CreateRoomShifts($raum); + + //Ausageb Zeilen + for ($i = 0; $i < (24 * $GlobalZeileProStunde); $i++) { + echo $Spalten[$i] . "\t</tr>\n"; + } + + echo "</table>\n"; + + ShowSwitchDay(); + +} //if (isset($raum)) + +echo "<a href=\"" . $_SESSION["newurl"] . "&Icon=0\">@</a>"; + +include ("includes/footer.php"); +?> diff --git a/www-ssl_old/nonpublic/schichtplan_add.php b/www-ssl_old/nonpublic/schichtplan_add.php new file mode 100644 index 00000000..1bbcdc4b --- /dev/null +++ b/www-ssl_old/nonpublic/schichtplan_add.php @@ -0,0 +1,114 @@ +<?php +require_once ('../bootstrap.php'); + +$title = "Himmel"; +$header = "Schichtpläne"; +include "includes/header.php"; +include "includes/funktion_schichtplan.php"; +include "includes/funktion_schichtplan_aray.php"; +include "includes/funktionen.php"; + +if (isset ($_POST["newtext"]) && isset ($_POST["SID"]) && isset ($_POST["TID"])) { + SetHeaderGo2Back(); + + // datum der einzutragenden Schicht heraussuhen... + $ShiftSQL = "SELECT `DateS`, `DateE` FROM `Shifts` WHERE `SID`='" . $_POST["SID"] . ".'"; + $ShiftErg = mysql_query($ShiftSQL, $con); + $beginSchicht = mysql_result($ShiftErg, 0, "DateS"); + $endSchicht = mysql_result($ShiftErg, 0, "DateE"); + + // wenn keien rechte definiert sind + if (!isset ($_SESSION['CVS'][$TID2Name[$_POST["TID"]]])) + $_SESSION['CVS'][$TID2Name[$_POST["TID"]]] = "Y"; + + if ($_SESSION['CVS'][$TID2Name[$_POST["TID"]]] == "Y") { + // Ueberpruefung, ob der Engel bereits fuer eine Schicht zu dieser Zeit eingetragen ist + $SSQL = "SELECT * FROM `Shifts`" . + " INNER JOIN `ShiftEntry` ON `ShiftEntry`.`SID` = `Shifts`.`SID`" . + " WHERE ((" . + " ((`Shifts`.`DateS` >= '$beginSchicht') and " . + " (`Shifts`.`DateS` < '$endSchicht'))" . + " OR " . + " ((`Shifts`.`DateE` > '$beginSchicht') and " . + " (`Shifts`.`DateE` <= '$endSchicht')) " . + ") and " . + "(`ShiftEntry`.`UID` = '" . $_SESSION['UID'] . "'));"; + $bErg = mysql_query($SSQL, $con); + + if (mysql_num_rows($bErg) != 0) + echo Get_Text("pub_schichtplan_add_AllreadyinShift"); + else { + // ermitteln der noch gesuchten + $SQL3 = "SELECT * FROM `ShiftEntry`" . + " WHERE ((`SID` = '" . $_POST["SID"] . "') AND (`TID` = '" . $_POST["TID"] . "') AND (`UID` = '0'));"; + $Erg3 = mysql_query($SQL3, $con); + + if (mysql_num_rows($Erg3) <= 0) + echo Get_Text("pub_schichtplan_add_ToManyYousers"); + else { + //write shift + $SQL = "UPDATE `ShiftEntry` SET " . + "`UID` = '" . $_SESSION['UID'] . "', " . + "`Comment` = '" . $_POST["newtext"] . "' " . + "WHERE ( (`SID` = '" . $_POST["SID"] . "') and " . + "(`TID` = '" . $_POST["TID"] . "') and " . + "(`UID` = '0')) LIMIT 1;"; + $Erg = mysql_query($SQL, $con); + + if ($Erg != 1) + echo Get_Text("pub_schichtplan_add_Error"); + else + echo Get_Text("pub_schichtplan_add_WriteOK"); + } + } + } else { + echo "<h1>:-(</h1>"; + array_push($error_messages, "Hack atteck\n"); + } +} +elseif (isset ($_GET["SID"]) && isset ($_GET["TID"])) { + //wenn keine Rechte definiert sind + if (!isset ($_SESSION['CVS'][$TID2Name[$_GET["TID"]]])) + $_SESSION['CVS'][$TID2Name[$_GET["TID"]]] = "Y"; + + if ($_SESSION['CVS'][$TID2Name[$_GET["TID"]]] == "Y") { + echo Get_Text("pub_schichtplan_add_Text1") . "<br /><br />\n\n" . + "<form action=\"./schichtplan_add.php\" method=\"post\">\n" . + "<table border=\"0\">\n"; + + $SQL = "SELECT * FROM `Shifts` WHERE "; + $SQL .= "(`SID` = '" . $_GET["SID"] . "')"; + $Erg = mysql_query($SQL, $con); + + echo "<tr><td>" . Get_Text("pub_schichtplan_add_Date") . ":</td> <td>" . + mysql_result($Erg, 0, "DateS") . "</td></tr>\n"; + + echo "<tr><td>" . Get_Text("pub_schichtplan_add_Place") . ":</td> <td>" . + $RoomID[mysql_result($Erg, 0, "RID")] . "</td></tr>\n"; + + echo "<tr><td>" . Get_Text("pub_schichtplan_add_Job") . ":</td> <td>" . + $EngelTypeID[$_GET["TID"]] . "</td></tr>\n"; + + echo "<tr><td>" . Get_Text("pub_schichtplan_add_Len") . ":</td> <td>" . + mysql_result($Erg, 0, "Len") . "h</td></tr>\n"; + + echo "<tr><td>" . Get_Text("pub_schichtplan_add_TextFor") . ":</td> <td>" . + mysql_result($Erg, 0, "Man") . "</td></tr>\n"; + + echo "<tr><td valign='top'>" . Get_Text("pub_schichtplan_add_Comment") . ":</td>\n <td>" . + "<textarea name='newtext' cols='50' rows='10'></textarea> </td></tr>\n"; + + echo "<tr><td> </td>\n" . + "<td><input type=\"submit\" value=\"" . Get_Text("pub_schichtplan_add_submit") . "\"> </td></tr>\n" . + "</table>\n" . + "<input type=\"hidden\" name=\"SID\" value=\"" . $_GET["SID"] . "\">\n" . + "<input type=\"hidden\" name=\"TID\" value=\"" . $_GET["TID"] . "\">\n" . + "</form>"; + } else { + echo "<h1>:-(</h1>"; + array_push($error_messages, "Hack atteck\n"); + } +} + +include "includes/footer.php"; +?> diff --git a/www-ssl_old/nonpublic/schichtplan_beamer.php b/www-ssl_old/nonpublic/schichtplan_beamer.php new file mode 100644 index 00000000..269660e1 --- /dev/null +++ b/www-ssl_old/nonpublic/schichtplan_beamer.php @@ -0,0 +1,59 @@ +<?php +require_once ('../bootstrap.php'); + +include "includes/header_start.php"; +include "includes/funktionen.php"; +include "includes/funktion_schichtplan_beamer.php"; + +$Time = time() + 3600 + 3600; +?> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> +<title>Schichtpläne für Beamer</title> +<meta http-equiv="refresh" content="30; URL=<?php echo $url . $_SERVER['PHP_SELF']; ?>" /> +</head> + +<body> + +<?php + + +echo "<table border=\"1\" width=\"100%\" height=\"100%\" cellpadding=\"0\" cellspacing=\"0\" frame=\"void\">\n"; + +echo "<colgroup span=\"4\" valign=\"center\"> + <col width=\"30\"> + <col width=\"3*\"> + <col width=\"3*\"> + <col width=\"3*\"> + </colgroup>\n"; + +echo "<tr align=\"center\">\n" . +"<td>" . gmdate("d.m.y", $Time) . "</td>\n" . +"<td>" . gmdate("H", $Time -3600) . ":00</td>\n" . +"<td>" . gmdate("H", $Time +0) . ":00</td>\n" . +"<td>" . gmdate("H", $Time +3600) . ":00</td>\n" . +"</tr>\n"; + +foreach ($Room as $RoomEntry) { + // var-init + $AnzahlEintraege = 0; + + $Out = ausgabe_Zeile($RoomEntry["RID"], $Time -3600, $AnzahlEintraege); + $Out .= ausgabe_Zeile($RoomEntry["RID"], $Time, $AnzahlEintraege); + $Out .= ausgabe_Zeile($RoomEntry["RID"], $Time +3600, $AnzahlEintraege); + + if ($AnzahlEintraege == 0) + $Out = ""; + else + $Out = "<tr>\n<td>_" . $RoomEntry["Name"] . "_</td>\n" . $Out . "</tr>\n"; + + echo $Out; +} +?> + +</table> + +</body> +</html> |