From e050c0dc7f4c70b13596f8e940a31a9678bb3b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Wed, 1 Jun 2011 15:02:00 +0200 Subject: [PATCH] bootstrapping --- config/.gitignore | 1 + www-ssl/admin/EngelType.php | 312 ++++++------- www-ssl/admin/Recentchanges.php | 20 +- www-ssl/admin/UserPicture.php | 220 ++++----- www-ssl/admin/aktiv.php | 121 +++-- www-ssl/admin/dbUpdateFromXLS.php | 449 ++++++++---------- www-ssl/admin/debug.php | 37 +- www-ssl/admin/dect.php | 99 ++-- www-ssl/admin/dect_call.php | 5 +- www-ssl/admin/faq.php | 418 ++++++++--------- www-ssl/admin/free.php | 72 ++- www-ssl/admin/free_DECT.php | 93 ++-- www-ssl/admin/group.php | 70 +-- www-ssl/admin/index.php | 12 +- www-ssl/admin/room.php | 331 +++++++------ www-ssl/admin/schichtplan.php | 669 +++++++++++++-------------- www-ssl/admin/schichtplan_druck.php | 138 +++--- www-ssl/admin/shiftadd.php | 516 ++++++++++----------- www-ssl/admin/sprache.php | 196 ++++---- www-ssl/admin/tshirt.php | 53 ++- www-ssl/admin/user.php | 179 ++++--- www-ssl/admin/userArrived.php | 59 ++- www-ssl/admin/userChangeNormal.php | 232 +++++----- www-ssl/admin/userChangeSecure.php | 178 ++++--- www-ssl/admin/userDefaultSetting.php | 184 ++++---- www-ssl/admin/userSaveNormal.php | 219 +++++---- www-ssl/admin/userSaveSecure.php | 309 ++++++------- 27 files changed, 2469 insertions(+), 2723 deletions(-) diff --git a/config/.gitignore b/config/.gitignore index 9b65d8f4..a99da95f 100644 --- a/config/.gitignore +++ b/config/.gitignore @@ -2,3 +2,4 @@ config_db.php config_jabber.php config_modem.php config.php +config_IAX.php diff --git a/www-ssl/admin/EngelType.php b/www-ssl/admin/EngelType.php index 1aec80dc..5d1a6cdc 100644 --- a/www-ssl/admin/EngelType.php +++ b/www-ssl/admin/EngelType.php @@ -1,191 +1,167 @@ "; - echo "[$SQL]
"; - return 1; - } - else - { - echo "Fehler beim speichern... bitte noch ein mal probieren :)"; - echo "

".mysql_error( $con ). "
"; - echo "[$SQL]
"; - return 0; - } +function runSQL($SQL) { + global $con; + // hier muesste das SQL ausgefuehrt werden... + $Erg = mysql_query($SQL, $con); + if ($Erg) { + echo "Änderung wurde gesichert...
"; + echo "[$SQL]
"; + return 1; + } else { + echo "Fehler beim speichern... bitte noch ein mal probieren :)"; + echo "

" . mysql_error($con) . "
"; + echo "[$SQL]
"; + return 0; + } } -function runSQL_log( $SQL, $commed) -{ - global $con; - // hier muesste das SQL ausgefuehrt werden... - $Erg = db_query($SQL, $commed); - if ($Erg) - { - echo "Änderung wurde gesichert...
"; - echo "[$SQL]
"; - return 1; - } - else - { - echo "Fehler beim speichern... bitte noch ein mal probieren :)"; - echo "

".mysql_error( $con ). "
"; - echo "[$SQL]
"; - return 0; - } +function runSQL_log($SQL, $commed) { + global $con; + // hier muesste das SQL ausgefuehrt werden... + $Erg = db_query($SQL, $commed); + if ($Erg) { + echo "Änderung wurde gesichert...
"; + echo "[$SQL]
"; + return 1; + } else { + echo "Fehler beim speichern... bitte noch ein mal probieren :)"; + echo "

" . mysql_error($con) . "
"; + echo "[$SQL]
"; + return 0; + } } - - $Sql = "SELECT * FROM `EngelType` ORDER BY `NAME`"; $Erg = mysql_query($Sql, $con); -if( !IsSet($_GET["action"]) ) -{ - echo "Hallo ".$_SESSION['Nick']. - ",
\nhier hast du die Möglichkeit, neue Engeltypen für die Schichtpläne einzutragen ". - "oder vorhandene abzuändern:

\n"; +if (!IsSet ($_GET["action"])) { + echo "Hallo " . $_SESSION['Nick'] . + ",
\nhier hast du die Möglichkeit, neue Engeltypen für die Schichtpläne einzutragen " . + "oder vorhandene abzuändern:

\n"; - echo "- Neuen EngelType eintragen
\n"; - - echo "\n"; - echo "\n"; + echo "- Neuen EngelType eintragen
\n"; - for( $i = 1; $i < mysql_num_fields($Erg); $i++ ) - { - echo "\t"; - } - echo "\t"; - echo ""; + echo "
". mysql_field_name($Erg, $i). "Ändern
\n"; + echo "\n"; - for( $t = 0; $t < mysql_num_rows($Erg); $t++ ) - { - echo "\t\n"; - for ($j = 1; $j < mysql_num_fields($Erg); $j++) - { - echo "\t\t\n"; - } - echo "\t\t\n"; - echo "\t\n"; - } // ende Auflistung Raeume - echo "
".mysql_result($Erg, $t, $j)."###
"; -} -else -{ + for ($i = 1; $i < mysql_num_fields($Erg); $i++) { + echo "\t" . mysql_field_name($Erg, $i) . ""; + } + echo "\tÄndern"; + echo ""; -switch ($_GET["action"]) { + for ($t = 0; $t < mysql_num_rows($Erg); $t++) { + echo "\t\n"; + for ($j = 1; $j < mysql_num_fields($Erg); $j++) { + echo "\t\t" . mysql_result($Erg, $t, $j) . "\n"; + } + echo "\t\t###\n"; + echo "\t\n"; + } // ende Auflistung Raeume + echo ""; +} else { -case 'new': - echo "Neuen EngelType einrichten:
"; - echo "
\n"; - echo "\n"; - - for( $Uj = 1; $Uj < mysql_num_fields($Erg); $Uj++ ) - { - echo "". - "\n"; - } - echo "
".mysql_field_name($Erg, $Uj)."
\n"; - echo "\n"; - echo "\n"; - echo "
"; - break; + switch ($_GET["action"]) { -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'"; - } - - if( runSQL_log( "INSERT INTO `EngelType` (". substr($Keys, 2). ") VALUES (". substr($Values, 2). ")", - "save new EngelType") ) - { - SetHeaderGo2Back(); - - $SQL2 = "SELECT * FROM `EngelType` WHERE `Name`='". $_GET["Name"]. "'"; - $ERG = mysql_query($SQL2, $con); - - if( mysql_num_rows($ERG) == 1) - runSQL_log( "ALTER TABLE `Room` ADD `DEFAULT_EID_". mysql_result( $ERG, 0, 0). - "` INT DEFAULT '0' NOT NULL;", - "add new EngelType in Romm Table"); - } - break; + case 'new' : + echo "Neuen EngelType einrichten:
"; + echo "
\n"; + echo "\n"; -case 'change': - if (! IsSet($_GET["TID"])) - echo "Fehlerhafter Aufruf!"; - else - { - echo "Raum abändern:\n"; - echo "Hier kannst du eintragen, den EngelType ändern."; - echo "\n"; - echo "
\n"; - - $SQL2 = "SELECT * FROM `EngelType` WHERE `TID`='". $_GET["TID"]. "'"; - $ERG = mysql_query($SQL2, $con); - - for ($Uj = 1; $Uj < mysql_num_fields($ERG); $Uj++) - echo "". - "\n"; + for ($Uj = 1; $Uj < mysql_num_fields($Erg); $Uj++) { + echo "" . + "\n"; + } + echo "
". mysql_field_name($ERG, $Uj). "
" . mysql_field_name($Erg, $Uj) . "
\n"; + echo "\n"; + echo "\n"; + echo "
"; + break; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "
\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "
"; - } - break; - -case 'changesave': - $vars = $_GET; - $count = count($vars) - 2; - $vars = array_splice($vars, 0, $count); - $keys=""; - $sql=""; - foreach($vars as $key => $value) - { - $keys = substr( $key, 1); - $sql .= ", `". $keys. "`='". $value. "'"; - } - runSQL_log( "UPDATE `EngelType` SET ". substr($sql, 2). " WHERE `TID`='". $_GET["eTID"]. "'", - "Save Change EngelType"); - SetHeaderGo2Back(); - 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'"; + } -case 'delete': - if (IsSet($_GET["TID"])) - { - if( runSQL_log( "DELETE FROM `EngelType` WHERE `TID`='". $_GET["TID"]. "'", "delete EngelType")) - runSQL_log( "ALTER TABLE `Room` DROP `DEFAULT_EID_". $_GET["TID"]. "`;", - "delete EngelType in Room Table"); - } - else - echo "Fehlerhafter Aufruf"; - SetHeaderGo2Back(); - break; -} + if (runSQL_log("INSERT INTO `EngelType` (" . substr($Keys, 2) . ") VALUES (" . substr($Values, 2) . ")", "save new EngelType")) { + SetHeaderGo2Back(); + + $SQL2 = "SELECT * FROM `EngelType` WHERE `Name`='" . $_GET["Name"] . "'"; + $ERG = mysql_query($SQL2, $con); + + if (mysql_num_rows($ERG) == 1) + runSQL_log("ALTER TABLE `Room` ADD `DEFAULT_EID_" . mysql_result($ERG, 0, 0) . + "` INT DEFAULT '0' NOT NULL;", "add new EngelType in Romm Table"); + } + break; + + case 'change' : + if (!IsSet ($_GET["TID"])) + echo "Fehlerhafter Aufruf!"; + else { + echo "Raum abändern:\n"; + echo "Hier kannst du eintragen, den EngelType ändern."; + echo "
\n"; + echo "\n"; + + $SQL2 = "SELECT * FROM `EngelType` WHERE `TID`='" . $_GET["TID"] . "'"; + $ERG = mysql_query($SQL2, $con); + + for ($Uj = 1; $Uj < mysql_num_fields($ERG); $Uj++) + echo "" . + "\n"; + + echo "
" . mysql_field_name($ERG, $Uj) . "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo ""; + echo "
"; + } + break; + + case 'changesave' : + $vars = $_GET; + $count = count($vars) - 2; + $vars = array_splice($vars, 0, $count); + $keys = ""; + $sql = ""; + foreach ($vars as $key => $value) { + $keys = substr($key, 1); + $sql .= ", `" . $keys . "`='" . $value . "'"; + } + runSQL_log("UPDATE `EngelType` SET " . substr($sql, 2) . " WHERE `TID`='" . $_GET["eTID"] . "'", "Save Change EngelType"); + SetHeaderGo2Back(); + break; + + case 'delete' : + if (IsSet ($_GET["TID"])) { + if (runSQL_log("DELETE FROM `EngelType` WHERE `TID`='" . $_GET["TID"] . "'", "delete EngelType")) + runSQL_log("ALTER TABLE `Room` DROP `DEFAULT_EID_" . $_GET["TID"] . "`;", "delete EngelType in Room Table"); + } else + echo "Fehlerhafter Aufruf"; + SetHeaderGo2Back(); + break; + } } -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/Recentchanges.php b/www-ssl/admin/Recentchanges.php index 6bb8f59d..26324406 100644 --- a/www-ssl/admin/Recentchanges.php +++ b/www-ssl/admin/Recentchanges.php @@ -1,8 +1,9 @@ \n"; echo "\n\tTime\n\tUser\n\tCommend\n\tSQL Commad\n\n"; -for ($n = 0 ; $n < mysql_num_rows($Erg) ; $n++) -{ - echo "\n"; - echo "\t". mysql_result( $Erg, $n, "Time"). "\n"; - echo "\t". UID2Nick(mysql_result( $Erg, $n, "UID")). displayavatar(mysql_result( $Erg, $n, "UID")). "\n"; - echo "\t". mysql_result( $Erg, $n, "Commend"). "\n"; - echo "\t". mysql_result( $Erg, $n, "SQLCommad"). "\n"; - echo "\n"; +for ($n = 0; $n < mysql_num_rows($Erg); $n++) { + echo "\n"; + echo "\t" . mysql_result($Erg, $n, "Time") . "\n"; + echo "\t" . UID2Nick(mysql_result($Erg, $n, "UID")) . displayavatar(mysql_result($Erg, $n, "UID")) . "\n"; + echo "\t" . mysql_result($Erg, $n, "Commend") . "\n"; + echo "\t" . mysql_result($Erg, $n, "SQLCommad") . "\n"; + echo "\n"; } echo "\n"; -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/UserPicture.php b/www-ssl/admin/UserPicture.php index 00716329..102d551d 100644 --- a/www-ssl/admin/UserPicture.php +++ b/www-ssl/admin/UserPicture.php @@ -1,120 +1,104 @@ \n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t(max " . get_cfg_var("post_max_size") . "Byte)
\n"; + echo "\t\n"; + echo "\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"]))); - switch ($_GET["action"]) - { - case 'FormUpload': - echo "Hier kannst Du ein Foto hochladen för:"; - echo "
\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t(max ". get_cfg_var("post_max_size"). "Byte)
\n"; - echo "\t\n"; - echo "
\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'] . "'"; - 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; - 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:
"; + $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:
"; + $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? " . + "Yes"; + break; + case 'delYes' : + if (IsSet ($_GET["UID"])) { + echo "Bild von '" . UID2Nick($_GET["UID"]) . "' wurde gelöscht:
"; + $SQL = "DELETE FROM `UserPicture` WHERE `UID`='" . $_GET["UID"] . "' LIMIT 1"; + } else + echo "Fehlerhafter Aufruf"; + break; + default : + echo "Fehlerhafter Aufruf"; - case 'SetN': - if (IsSet($_GET["UID"])) - { - echo "Bild von '". UID2Nick( $_GET["UID"]). "' wurde gesperrt:
"; - $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:
"; - $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? ". - "Yes"; - break; - case 'delYes': - if (IsSet($_GET["UID"])) - { - echo "Bild von '". UID2Nick( $_GET["UID"]). "' wurde gelöscht:
"; - $SQL = "DELETE FROM `UserPicture` WHERE `UID`='". $_GET["UID"]. "' LIMIT 1"; - } - else - echo "Fehlerhafter Aufruf"; - break; - default: - echo "Fehlerhafter Aufruf"; - - } //switch + } //switch - // Update ??? - if (IsSet($SQL)) - { - // hier muesste das SQL ausgefuehrt werden... - $Erg = mysql_query($SQL, $con); - if ($Erg == 1) - echo "Änderung wurde gesichert...
"; - else - { - echo "Fehler beim speichern... bitte noch ein mal probieren :)"; - echo "

".mysql_error( $con ). "
($SQL)
"; - } - } // Ende Update - echo "
\n
\n
\n\n"; + // Update ??? + if (IsSet ($SQL)) { + // hier muesste das SQL ausgefuehrt werden... + $Erg = mysql_query($SQL, $con); + if ($Erg == 1) + echo "Änderung wurde gesichert...
"; + else { + echo "Fehler beim speichern... bitte noch ein mal probieren :)"; + echo "

" . mysql_error($con) . "
($SQL)
"; + } + } // Ende Update + echo "
\n
\n
\n\n"; } //IF IsSet($action) - //ausgabe der Liste $Sql = "SELECT * FROM `UserPicture` WHERE `UID`>0;"; $Erg = mysql_query($Sql, $con); - -echo "Hallo ". $_SESSION['Nick']. ",
\nhier hast du die Möglichkeit, die Bilder der Engel freizugeben:

\n"; + +echo "Hallo " . $_SESSION['Nick'] . ",
\nhier hast du die Möglichkeit, die Bilder der Engel freizugeben:

\n"; echo "\n"; echo "\n"; @@ -124,26 +108,24 @@ echo "\t\n"; echo "\t\n"; echo ""; -for( $t = 0; $t < mysql_num_rows($Erg); $t++ ) -{ - $UIDs = mysql_result($Erg, $t, "UID"); - echo "\t\n"; - - echo "\t\t\n"; - echo "\t\t\n"; - - if( GetPicturShow( $UIDs) == "Y") - echo "\t\t\n"; - elseif( GetPicturShow( $UIDs) == "N") - echo "\t\t\n"; - else - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\n"; +for ($t = 0; $t < mysql_num_rows($Erg); $t++) { + $UIDs = mysql_result($Erg, $t, "UID"); + echo "\t\n"; + + echo "\t\t\n"; + echo "\t\t\n"; + + if (GetPicturShow($UIDs) == "Y") + echo "\t\t\n"; + elseif (GetPicturShow($UIDs) == "N") echo "\t\t\n"; + else + echo "\t\t\n"; + echo "\t\t\n"; + echo "\t\n"; } // ende Auflistung Raeume echo "
StatusLöschen
". UID2Nick(mysql_result($Erg, $t, "UID")). "". displayPictur( $UIDs, 0). "sperrenfreigebenERROR: show='". GetPicturShow( $UIDs). "'del
" . UID2Nick(mysql_result($Erg, $t, "UID")) . "" . displayPictur($UIDs, 0) . "sperrenfreigebenERROR: show='" . GetPicturShow($UIDs) . "'del
"; echo "
picture upload\n"; -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/aktiv.php b/www-ssl/admin/aktiv.php index 68199cfa..8db62f98 100644 --- a/www-ssl/admin/aktiv.php +++ b/www-ssl/admin/aktiv.php @@ -1,57 +1,57 @@ "; -echo Get_Text("pub_aktive_Text1")."
\n"; -echo Get_Text("pub_aktive_Text2")."

\n"; - +echo Get_Text("pub_aktive_Text1") . "
\n"; +echo Get_Text("pub_aktive_Text2") . "

\n"; + // auswahlbox -echo Get_Text("pub_aktive_Text31")."\n"; +echo Get_Text("pub_aktive_Text31") . "\n"; echo ""; -echo Get_Text("pub_aktive_Text32")."

\n"; +echo Get_Text("pub_aktive_Text32") . "

\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; - echo "\t
\n"; +echo "\t
\n"; echo "
\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["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 "
\n\n".Get_Text("pub_aktive_Text5_1"). $_POST["Anzahl"]. Get_Text("pub_aktive_Text5_2"). ":"; +if (IsSet ($_POST["Anzahl"])) + echo "
\n\n" . Get_Text("pub_aktive_Text5_1") . $_POST["Anzahl"] . Get_Text("pub_aktive_Text5_2") . ":"; echo "

\n\n"; //ausgabe tabelle echo "\n"; echo "\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; +echo "\t\n"; +echo "\t\n"; +echo "\t\n"; +echo "\t\n"; +echo "\t\n"; +echo "\t\n"; +echo "\t\n"; +echo "\t\n"; echo "\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 @@ -65,46 +65,41 @@ $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\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; +$aktivecount = 0; +for ($i = 0; $i < $rowcount; $i++) { + echo "\n\n\t\n"; + echo "\t\t\n"; + echo "\t\t\n"; + echo "\t\t\n"; + echo "\t\t\n"; + echo "\t\t\n"; + echo "\t\t\n"; + echo "\t\t\n"; - - echo "\t\t\n"; - echo "\t\n"; + echo "\t\t\n"; + echo "\t\n"; } // ende Auflistung aktive Engel echo "
". Get_Text("pub_aktive_Nick"). "". Get_Text("pub_aktive_Anzahl"). "". Get_Text("pub_aktive_Time"). "". Get_Text("pub_aktive_Time"). " WeightFreeloader ". Get_Text("pub_aktive_Anzahl"). "Freeloader ". Get_Text("pub_aktive_Time"). "". Get_Text("pub_aktive_Time"). " result". Get_Text("pub_aktive_Active"). "" . Get_Text("pub_aktive_Nick") . "" . Get_Text("pub_aktive_Anzahl") . "" . Get_Text("pub_aktive_Time") . "" . Get_Text("pub_aktive_Time") . " WeightFreeloader " . Get_Text("pub_aktive_Anzahl") . "Freeloader " . Get_Text("pub_aktive_Time") . "" . Get_Text("pub_aktive_Time") . " result" . Get_Text("pub_aktive_Active") . "
". UID2Nick(mysql_result($Erg, $i, "UID")). "". mysql_result($Erg, $i, "nr"). "x". mysql_result($Erg, $i, "len"). "h". mysql_result($Erg, $i, "lenWeight"). "h". mysql_result($Erg, $i, "nrFree"). "x". mysql_result($Erg, $i, "lenFree"). "h". mysql_result($Erg, $i, "lenReal"). "h
" . UID2Nick(mysql_result($Erg, $i, "UID")) . "" . mysql_result($Erg, $i, "nr") . "x" . mysql_result($Erg, $i, "len") . "h" . mysql_result($Erg, $i, "lenWeight") . "h" . mysql_result($Erg, $i, "nrFree") . "x" . mysql_result($Erg, $i, "lenFree") . "h" . mysql_result($Erg, $i, "lenReal") . "h"; - 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 "
"; + 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 "
"; echo "
Anzahl eintraege: $aktivecount / $rowcount (Aktive/Mitschichten)

"; -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/dbUpdateFromXLS.php b/www-ssl/admin/dbUpdateFromXLS.php index 9a329355..88879de7 100644 --- a/www-ssl/admin/dbUpdateFromXLS.php +++ b/www-ssl/admin/dbUpdateFromXLS.php @@ -1,8 +1,10 @@ \n

XML File:

\n"; -if( isset($_POST["PentabarfUser"]) && isset($_POST["password"]) && isset($_POST["PentabarfURL"])) -{ - echo "Update XCAL-File from Pentabarf.."; - if($PentabarfGetWith=="fsockopen") - { +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 "

fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath". $_POST["PentabarfURL"]. "' not readable!". - "[$errstr ($errno)]

"; - } - 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; + //backup error messeges and delate + $Backuperror_messages = $error_messages; + $fp = fsockopen("ssl://$PentabarfXMLhost", 443, $errno, $errstr, 30); + // $error_messages = $Backuperror_messages; - 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 "
Es wurden $Zeilen Zeilen eingelesen
"; - } - else - echo "

fail: File '$Tempdir/engelXML' not writeable!

"; - fclose($fp); - } - } - elseif($PentabarfGetWith=="fopen") - { - //user uns password in url einbauen - $FileNameIn = "https://". $_POST["PentabarfUser"]. ':'. $_POST["password"]. "@". - $PentabarfXMLhost. "/". $PentabarfXMLpath. $_POST["PentabarfURL"]; + if (!$fp) { + echo "

fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . "' not readable!" . + "[$errstr ($errno)]

"; + } 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 = ""; + } - 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 "
Es wurden $Zeilen Zeilen eingelesen
"; - } - else - echo "

fail: File '$Tempdir/engelXML' not writeable!

"; - fclose( $fileIn); - } - else - echo "

fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath". $_POST["PentabarfURL"]. "' not readable!

"; - } - 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.
"; - else - echo "fail ($Status)($Command).
"; - } - 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.
"; - else - echo "fail ($Status)($Command).
"; - } - elseif($PentabarfGetWith=="fopen") - { - //user uns password in url einbauen - $FileNameIn = "https://". $_POST["PentabarfUser"]. ':'. $_POST["password"]. "@". - $PentabarfXMLhost. "/". $PentabarfXMLpath. $_POST["PentabarfURL"]; + //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); - 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 "
Es wurden $Zeilen Zeilen eingelesen
"; - } - else - echo "

fail: File '$Tempdir/engelXML' not writeable!

"; - fclose( $fileIn); - } - else - echo "

fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath". $_POST["PentabarfURL"]. "' not readable!

"; - } - 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.
"; - else - echo "fail ($Status)($Command).
"; - } - 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.
"; - else - echo "fail ($Status)($Command).
"; - } - else - echo "

The PentabarfGetWith='$PentabarfGetWith' not supported

"; + echo "
Es wurden $Zeilen Zeilen eingelesen
"; + } else + echo "

fail: File '$Tempdir/engelXML' not writeable!

"; + 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 "
Es wurden $Zeilen Zeilen eingelesen
"; + } else + echo "

fail: File '$Tempdir/engelXML' not writeable!

"; + fclose($fileIn); + } else + echo "

fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . "' not readable!

"; + } + 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.
"; + else + echo "fail ($Status)($Command).
"; + } + 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.
"; + else + echo "fail ($Status)($Command).
"; + } + 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 "
Es wurden $Zeilen Zeilen eingelesen
"; + } else + echo "

fail: File '$Tempdir/engelXML' not writeable!

"; + fclose($fileIn); + } else + echo "

fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . "' not readable!

"; + } + 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.
"; + else + echo "fail ($Status)($Command).
"; + } + 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.
"; + else + echo "fail ($Status)($Command).
"; + } else + echo "

The PentabarfGetWith='$PentabarfGetWith' not supported

"; +} else { + echo "
\n"; + echo "\n"; + echo "\t" . + "\n"; + echo "\t" . + "\n"; + echo "\t" . + "\n"; + echo "\t\n"; + echo "
XCAL-File: https://$PentabarfXMLhost/$PentabarfXMLpath
Username:
Password:
\n"; + echo "
\n"; } -else -{ - echo "
\n"; - echo "\n"; - echo "\t". - "\n"; - echo "\t". - "\n"; - echo "\t". - "\n"; - echo "\t\n"; - echo "
XCAL-File: https://$PentabarfXMLhost/$PentabarfXMLpath
Username:
Password:
\n"; - echo "
\n"; -} - - //readXMLfile("xml.php.xml"); -if( readXMLfile("$Tempdir/engelXML") == 0) -{ -$XMLmain = getXMLsubPease( $XMLmain, "VCALENDAR"); +if (readXMLfile("$Tempdir/engelXML") == 0) { + $XMLmain = getXMLsubPease($XMLmain, "VCALENDAR"); + if ($ShowDataStrukture) { + echo "

"; + echo $XMLmain->name; + echo "
"; + print_r(array_values($XMLmain->sub)); + echo "
"; + } -if( $ShowDataStrukture) -{ - echo "

"; - echo $XMLmain->name; - echo "
"; - print_r(array_values ($XMLmain->sub)); - echo "
"; -} + /* + echo "
"; + $Feld=7; + echo "$Feld#". $XMLmain->sub[$Feld]->name. "
"; + 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 ""; + */ -/* -echo "
"; -$Feld=7; -echo "$Feld#". $XMLmain->sub[$Feld]->name. "
"; -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 ""; -*/ + /*############################################################################################## + V e r s i o n + ##############################################################################################*/ + echo "
\n"; + $XMLrelease = getXMLsubPease($XMLmain, "X-WR-CALDESC"); + echo "release: " . $XMLrelease->data . "
\n"; + //$XMLreleaseDate = getXMLsubPease( $XMLmain, "RELEASE-DATE"); + //echo "release date: ". $XMLreleaseDate->data. "
\n"; + echo "
\n"; -/*############################################################################################## - V e r s i o n - ##############################################################################################*/ + /*############################################################################################## + V e r s i o n + ##############################################################################################*/ + if ($EnableRoomFunctions) + include ("includes/funktion_xml_room.php"); -echo "
\n"; -$XMLrelease = getXMLsubPease( $XMLmain, "X-WR-CALDESC"); -echo "release: ". $XMLrelease->data. "
\n"; -//$XMLreleaseDate = getXMLsubPease( $XMLmain, "RELEASE-DATE"); -//echo "release date: ". $XMLreleaseDate->data. "
\n"; -echo "
\n"; + if ($EnableSchudleFunctions) + include ("includes/funktion_xml_schudle.php"); + /*############################################################################################## + U P D A T E A L L + ##############################################################################################*/ + echo "\n\n
\n

Update ALL:

\n"; - -/*############################################################################################## - V e r s i o n - ##############################################################################################*/ -if( $EnableRoomFunctions) - include("../../../camp2011/includes/funktion_xml_room.php"); - -if( $EnableSchudleFunctions) - include("../../../camp2011/includes/funktion_xml_schudle.php"); - - -/*############################################################################################## - U P D A T E A L L - ##############################################################################################*/ -echo "\n\n
\n

Update ALL:

\n"; - -echo "
\n"; -echo "\t\n"; -echo "
\n"; + echo "
\n"; + echo "\t\n"; + echo "
\n"; } //if XMLopenOOK -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/debug.php b/www-ssl/admin/debug.php index b2c6357f..ec1b2c9f 100644 --- a/www-ssl/admin/debug.php +++ b/www-ssl/admin/debug.php @@ -1,9 +1,10 @@ Web Counter"; funktion_db_list("Counter"); @@ -31,39 +32,27 @@ echo "Deaktiviert"; */ echo "
\n"; -funktion_db_element_list_2row( "Tshirt-Size aller engel", - "SELECT `Size`, COUNT(`Size`) FROM `User` GROUP BY `Size`"); +funktion_db_element_list_2row("Tshirt-Size aller engel", "SELECT `Size`, COUNT(`Size`) FROM `User` GROUP BY `Size`"); echo "
\n"; -funktion_db_element_list_2row( "Tshirt ausgegeben", - "SELECT `Size`, COUNT(`Size`) FROM `User` WHERE `Tshirt`='1' GROUP BY `Size`"); +funktion_db_element_list_2row("Tshirt ausgegeben", "SELECT `Size`, COUNT(`Size`) FROM `User` WHERE `Tshirt`='1' GROUP BY `Size`"); echo "
\n"; -funktion_db_element_list_2row( "Tshirt nicht ausgegeben (Gekommen=1)", - "SELECT COUNT(`Size`), `Size` FROM `User` WHERE `Gekommen`='1' and `Tshirt`='0' GROUP BY `Size`"); +funktion_db_element_list_2row("Tshirt nicht ausgegeben (Gekommen=1)", "SELECT COUNT(`Size`), `Size` FROM `User` WHERE `Gekommen`='1' and `Tshirt`='0' GROUP BY `Size`"); echo "
\n"; -funktion_db_element_list_2row( "Hometown", - "SELECT COUNT(`Hometown`), `Hometown` FROM `User` GROUP BY `Hometown`"); +funktion_db_element_list_2row("Hometown", "SELECT COUNT(`Hometown`), `Hometown` FROM `User` GROUP BY `Hometown`"); echo "
\n"; -funktion_db_element_list_2row( "Engeltypen", - "SELECT COUNT(`Art`), `Art` FROM `User` GROUP BY `Art`"); +funktion_db_element_list_2row("Engeltypen", "SELECT COUNT(`Art`), `Art` FROM `User` GROUP BY `Art`"); echo "
\n"; -funktion_db_element_list_2row( "Gesamte Arbeit", - "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID)"); +funktion_db_element_list_2row("Gesamte Arbeit", "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID)"); echo "
\n"; -funktion_db_element_list_2row( "Geleisteter Arbeit", - "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID) WHERE (ShiftEntry.UID!=0)"); +funktion_db_element_list_2row("Geleisteter Arbeit", "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID) WHERE (ShiftEntry.UID!=0)"); echo "
\n"; -funktion_db_element_list_2row( "Gesamte Arbeit (Ohne Raum aufabau (RID=7)", - "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID) WHERE (Shifts.RID!=7)"); +funktion_db_element_list_2row("Gesamte Arbeit (Ohne Raum aufabau (RID=7)", "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID) WHERE (Shifts.RID!=7)"); echo "
\n"; -funktion_db_element_list_2row( "Geleisteter Arbeit (Ohne Raum aufabau (RID=7)", - "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID) WHERE (ShiftEntry.UID!=0) AND (Shifts.RID!=7)"); +funktion_db_element_list_2row("Geleisteter Arbeit (Ohne Raum aufabau (RID=7)", "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID) WHERE (ShiftEntry.UID!=0) AND (Shifts.RID!=7)"); - - - -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/dect.php b/www-ssl/admin/dect.php index 76409cc6..6ad98c81 100644 --- a/www-ssl/admin/dect.php +++ b/www-ssl/admin/dect.php @@ -1,70 +1,69 @@ \n"; +echo "\n"; - echo "\n"; - echo "
\n"; +echo "\n"; - echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "
Numberh:m
Numberh:m
\n"; +// Listet alle Nicks auf +echo "
\n"; - // Listet alle Nicks auf - echo "\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\n"; - } - echo "\n"; - - echo "\n"; - echo ":"; - echo "
\n"; - - echo ""; +echo ":"; +echo "\n"; +echo "\n"; +echo ""; +echo "\n"; +echo ""; -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/dect_call.php b/www-ssl/admin/dect_call.php index 58c7cfe1..0799c2be 100644 --- a/www-ssl/admin/dect_call.php +++ b/www-ssl/admin/dect_call.php @@ -1,7 +1,8 @@ diff --git a/www-ssl/admin/faq.php b/www-ssl/admin/faq.php index 217e9188..779d8822 100644 --- a/www-ssl/admin/faq.php +++ b/www-ssl/admin/faq.php @@ -1,28 +1,28 @@ Alle Anfragen:
@@ -37,142 +37,132 @@ case "all": \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - else - { - echo "Nein\n"; - echo "\n"; - echo "\n"; - } - echo ""; - echo "\n"; - } - echo "
".mysql_result($Erg, $n, "Question")."".UID2Nick(mysql_result($Erg, $n, "UID")).""; - if (mysql_result($Erg, $n, "AID")>0) - { - echo "Ja".mysql_result($Erg, $n, "Answer")."".UID2Nick(mysql_result($Erg, $n, "AID"))."  xxx
\n"; - break; - -case "open": - $SQL="SELECT * FROM `Questions` WHERE `AID`='0' ORDER BY `QID` DESC"; - $quest_bearb=1; // Fragenliste anzeigen - echo "\t\tOffene Anfragen:
\n"; - break; - -case "edit": - if (!IsSet($_GET["QID"])) - echo "\t\tFehlerhafter Aufruf...
Bitte die Bearbeitung nochmals beginnen :)\n"; - else - { - $SQL = "SELECT * FROM `Questions` WHERE `QID`='". $_GET["QID"]. "'"; - $Erg = mysql_query($SQL, $con); - echo "\t\t
\n"; - echo "\t\tAnfrage von ". UID2NICK(mysql_result($Erg, 0, "UID")). ":
\n"; - echo "\t\t\n"; - echo "

Antwort der Erzengel:
\n"; - if (mysql_result($Erg, 0, "Answer")=="") - echo "\t\t
\n"; - else - echo "\t\t\n
\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t
\n"; - if (mysql_result($Erg, 0, "AID")<>"0") - { - echo "\tDu kannst diese Anfrage so wie sie ist, als Engel-FAQ eintrag übernehmen.
\n"; - echo "Als FAQ-Eintrag sichern...\n"; - } - } // Abfrage der QID - break; -case "save": - if (!IsSet($_GET["QID"])) - echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten..."; - else - { - $SQL = "UPDATE `Questions` SET `Question`='". $_GET["Question"]. - "', `AID`='". $_SESSION['UID']. "' , `Answer`='". $_GET["Answer"]. "' ". - "WHERE `QID`='". $_GET["QID"]. "' LIMIT 1"; - $Erg = db_query($SQL, "save Question"); - if ($Erg == 1) - { - echo "\tDer Eintrag wurde geändert
\n"; - SetHeaderGo2Back(); - } - else - echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n"; - } - break; + $Erg = mysql_query($SQL, $con); + // anzahl zeilen + $Zeilen = mysql_num_rows($Erg); + for ($n = 0; $n < $Zeilen; $n++) { + echo "\n"; + echo "" . mysql_result($Erg, $n, "Question") . "\n"; + echo "" . UID2Nick(mysql_result($Erg, $n, "UID")) . "\n"; + echo ""; + if (mysql_result($Erg, $n, "AID") > 0) { + echo "Ja\n"; + echo "" . mysql_result($Erg, $n, "Answer") . "\n"; + echo "" . UID2Nick(mysql_result($Erg, $n, "AID")) . "\n"; + } else { + echo "Nein\n"; + echo " \n"; + echo " \n"; + } + echo "xxx"; + echo "\n"; + } + echo "\n"; + break; -case "transfer": - if (!IsSet($_GET["QID"])) - echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...\n"; - else - { - $SQL1="SELECT * FROM `Questions` WHERE `QID`='". $_GET["QID"]. "'"; - $Erg = mysql_query($SQL1, $con); - $SQL2="INSERT INTO `FAQ` Values ('', '". - mysql_result($Erg, 0, "Question")."', '".mysql_result($Erg, 0, "Answer")."')"; - $Erg = db_query($SQL2, "trasfert to request to the FAQ"); - if ($Erg == 1) - echo "\tDer Eintrag wurde übertragen.
\n"; - else - echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n"; - } - - break; + case "open" : + $SQL = "SELECT * FROM `Questions` WHERE `AID`='0' ORDER BY `QID` DESC"; + $quest_bearb = 1; // Fragenliste anzeigen + echo "\t\tOffene Anfragen:
\n"; + break; -// *--------------------------------------------------------------------------- -// * FAQ - Bearbeitung -// *--------------------------------------------------------------------------- -// * je nach Übergabeoption ($quest) koennen FAQ's erfasst werden, -// * geaendert oder geloscht werden... -// *--------------------------------------------------------------------------- -case "faq": - $quest_bearb=0; // keine Fragenliste anzeigen, FAQ editieren... - echo "\tFAQ-Liste:
"; - echo "Neuen Eintrag"; - - $SQL = "SELECT * FROM `FAQ`"; - $Erg = mysql_query($SQL, $con); + case "edit" : + if (!IsSet ($_GET["QID"])) + echo "\t\tFehlerhafter Aufruf...
Bitte die Bearbeitung nochmals beginnen :)\n"; + else { + $SQL = "SELECT * FROM `Questions` WHERE `QID`='" . $_GET["QID"] . "'"; + $Erg = mysql_query($SQL, $con); + echo "\t\t
\n"; + echo "\t\tAnfrage von " . UID2NICK(mysql_result($Erg, 0, "UID")) . ":
\n"; + echo "\t\t\n"; + echo "

Antwort der Erzengel:
\n"; + if (mysql_result($Erg, 0, "Answer") == "") + echo "\t\t
\n"; + else + echo "\t\t\n
\n"; + echo "\t\t\n"; + echo "\t\t\n"; + echo "\t\t\n"; + echo "\t
\n"; + if (mysql_result($Erg, 0, "AID") <> "0") { + echo "\tDu kannst diese Anfrage so wie sie ist, als Engel-FAQ eintrag übernehmen.
\n"; + echo "Als FAQ-Eintrag sichern...\n"; + } + } // Abfrage der QID + break; - // anzahl zeilen - $Zeilen = mysql_num_rows($Erg); + case "save" : + if (!IsSet ($_GET["QID"])) + echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten..."; + else { + $SQL = "UPDATE `Questions` SET `Question`='" . $_GET["Question"] . + "', `AID`='" . $_SESSION['UID'] . "' , `Answer`='" . $_GET["Answer"] . "' " . + "WHERE `QID`='" . $_GET["QID"] . "' LIMIT 1"; + $Erg = db_query($SQL, "save Question"); + if ($Erg == 1) { + echo "\tDer Eintrag wurde geändert
\n"; + SetHeaderGo2Back(); + } else + echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n"; + } + break; - for ($n = 0 ; $n < $Zeilen ; $n++) - if (mysql_result($Erg, $n, "Antwort")!="") - { - echo "\t

". mysql_result($Erg, $n, "Frage"). "

\n"; - echo "\t

". mysql_result($Erg, $n, "Antwort")."

\n"; - echo "\tBearbeiten\n
---
\n"; - } - break; + case "transfer" : + if (!IsSet ($_GET["QID"])) + echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...\n"; + else { + $SQL1 = "SELECT * FROM `Questions` WHERE `QID`='" . $_GET["QID"] . "'"; + $Erg = mysql_query($SQL1, $con); + $SQL2 = "INSERT INTO `FAQ` Values ('', '" . + mysql_result($Erg, 0, "Question") . "', '" . mysql_result($Erg, 0, "Answer") . "')"; + $Erg = db_query($SQL2, "trasfert to request to the FAQ"); + if ($Erg == 1) + echo "\tDer Eintrag wurde übertragen.
\n"; + else + echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n"; + } -case "faqedit": - if (!IsSet($_GET["FAQID"])) - echo "\tFehlerhafter Aufruf...
Bitte die Bearbeitung nochmals beginnen :)\n"; - else - { - $SQL = "SELECT * FROM `FAQ` WHERE `FID`='". $_GET["FAQID"]. "'"; - $Erg = mysql_query($SQL, $con); + break; - // anzahl zeilen - $Zeilen = mysql_num_rows($Erg); + // *--------------------------------------------------------------------------- + // * FAQ - Bearbeitung + // *--------------------------------------------------------------------------- + // * je nach �bergabeoption ($quest) koennen FAQ's erfasst werden, + // * geaendert oder geloscht werden... + // *--------------------------------------------------------------------------- + case "faq" : + $quest_bearb = 0; // keine Fragenliste anzeigen, FAQ editieren... + echo "\tFAQ-Liste:
"; + echo "Neuen Eintrag"; + + $SQL = "SELECT * FROM `FAQ`"; + $Erg = mysql_query($SQL, $con); + + // anzahl zeilen + $Zeilen = mysql_num_rows($Erg); + + for ($n = 0; $n < $Zeilen; $n++) + if (mysql_result($Erg, $n, "Antwort") != "") { + echo "\t

" . mysql_result($Erg, $n, "Frage") . "

\n"; + echo "\t

" . mysql_result($Erg, $n, "Antwort") . "

\n"; + echo "\tBearbeiten\n
---
\n"; + } + break; + + case "faqedit" : + if (!IsSet ($_GET["FAQID"])) + echo "\tFehlerhafter Aufruf...
Bitte die Bearbeitung nochmals beginnen :)\n"; + else { + $SQL = "SELECT * FROM `FAQ` WHERE `FID`='" . $_GET["FAQID"] . "'"; + $Erg = mysql_query($SQL, $con); + + // anzahl zeilen + $Zeilen = mysql_num_rows($Erg); ?>
Frage:
@@ -189,40 +179,40 @@ case "faqedit":
-\n"; - else - echo "\tEin Fehler ist aufgetreten. Ist der Eintag bereits gelöscht gewesen?\n"; - } - break; -case "faqsave"; - if (!IsSet($_GET["FAQID"])) - echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...\n"; - else - { - $SQL = "UPDATE `FAQ` SET `Frage`='". $_GET["Frage"]. "', `Antwort`='". $_GET["Antwort"]. - "' WHERE `FID`='". $_GET["FAQID"]. "' LIMIT 1"; - $Erg = db_query($SQL, $con); - if ($Erg == 1) - echo "\tDer Eintrag wurde geändert
\n"; - else - echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n"; - } - break; + } + break; -case "faqnew": + case "faqdelete"; + if (!IsSet ($_GET["FAQID"])) + echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...\n"; + else { + $SQL = "DELETE FROM `FAQ` WHERE `FID`='" . $_GET["FAQID"] . "' LIMIT 1"; + $Erg = db_query($SQL, "delate faq item"); + if ($Erg == 1) + echo "\tDer Eintrag wurde gelöscht
\n"; + else + echo "\tEin Fehler ist aufgetreten. Ist der Eintag bereits gelöscht gewesen?\n"; + } + break; + + case "faqsave"; + if (!IsSet ($_GET["FAQID"])) + echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...\n"; + else { + $SQL = "UPDATE `FAQ` SET `Frage`='" . $_GET["Frage"] . "', `Antwort`='" . $_GET["Antwort"] . + "' WHERE `FID`='" . $_GET["FAQID"] . "' LIMIT 1"; + $Erg = db_query($SQL, $con); + if ($Erg == 1) + echo "\tDer Eintrag wurde geändert
\n"; + else + echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n"; + } + break; + + case "faqnew" : ?>
Frage:
@@ -233,51 +223,49 @@ case "faqnew":
\n"; - else - echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n"; - break; - -} //switch ($_GET["quest"]) -// Hilfsroutine für die Anfragen: -// Fragenliste anzeigen??? -if ($quest_bearb==1) -{ - $Erg = mysql_query($SQL, $con); - // anzahl zeilen - $Zeilen = mysql_num_rows($Erg); + break; - if ($Zeilen==0) - echo "\tkeine vorhanden...\n"; - else - for ($n = 0 ; $n < $Zeilen ; $n++) - { - echo "\t

". nl2br(mysql_result($Erg, $n, "Question"))."\n


\n"; - echo "\tBearbeiten\n"; - echo "
---
\n"; - } - -} + case "faqnewsave"; + $SQL = "INSERT INTO `FAQ` VALUES ('', '" . $_GET["Frage"] . "', '" . $_GET["Antwort"] . "')"; + $Erg = db_query($SQL, "Save new FAQ entry"); + if ($Erg == 1) + echo "\tDer Eintrag wurde erfasst.
\n"; + else + echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n"; + break; + + } //switch ($_GET["quest"]) + + // Hilfsroutine f�r die Anfragen: + // Fragenliste anzeigen??? + if ($quest_bearb == 1) { + $Erg = mysql_query($SQL, $con); + // anzahl zeilen + $Zeilen = mysql_num_rows($Erg); + + if ($Zeilen == 0) + echo "\tkeine vorhanden...\n"; + else + for ($n = 0; $n < $Zeilen; $n++) { + echo "\t

" . nl2br(mysql_result($Erg, $n, "Question")) . "\n


\n"; + echo "\tBearbeiten\n"; + echo "
---
\n"; + } + + } } //if (IsSet($_GET["quest"])) -else -{ - echo "Bitte wähle aus, ob du:\n"; - echo "\n"; +else { + echo "Bitte wähle aus, ob du:\n"; + echo "\n"; } -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/free.php b/www-ssl/admin/free.php index 577ef7be..b45fadcf 100644 --- a/www-ssl/admin/free.php +++ b/www-ssl/admin/free.php @@ -1,16 +1,15 @@ \n"; +echo "Hallo " . $_SESSION['Nick'] . ",
\n"; echo "

\n\nHier findest du alle Engel, welche zur Zeit in keiner Schicht verplant sind:

\n"; - ####################################################### # Ermitteln freier Engel # @@ -33,22 +32,20 @@ $SQL = "SELECT Shifts.*, ShiftEntry.*, User.Nick ". "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);"; +$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 "
$SQL
"; $Erg = mysql_query($SQL, $con); -$Zeilen = mysql_num_rows($Erg); +$Zeilen = mysql_num_rows($Erg); // for ($i = 1; $i < mysql_num_fields($Erg); $i++) // echo "|".mysql_field_name($Erg, $i); - - echo "\n"; echo "\t\n"; echo "\t\t\n"; @@ -58,47 +55,44 @@ echo "\t\t\n"; echo "\t\t\n"; echo "\t\n"; +$inuse = ""; +for ($i = 0; $i < $Zeilen; $i++) { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; -$inuse=""; -for ($i=0; $i < $Zeilen; $i++) -{ - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - if ($inuse!="") - $inuse.= " OR "; - $inuse.= "(Nick = \"". UID2Nick(mysql_result($Erg, $i, "UID")). "\")"; + if ($inuse != "") + $inuse .= " OR "; + $inuse .= "(Nick = \"" . UID2Nick(mysql_result($Erg, $i, "UID")) . "\")"; } -if ($inuse!="") - $inuse=" WHERE NOT (".$inuse.")"; +if ($inuse != "") + $inuse = " WHERE NOT (" . + $inuse . ")"; echo "
NickVonBis
" . + UID2Nick(mysql_result($Erg, $i, "UID")) . "" . mysql_result($Erg, $i, "RID") . "" . mysql_result($Erg, $i, "DateS") . "" . mysql_result($Erg, $i, "DateE") . "
". - UID2Nick(mysql_result($Erg, $i, "UID")). "". mysql_result($Erg, $i, "RID"). "". mysql_result($Erg, $i, "DateS"). "". mysql_result($Erg, $i, "DateE"). "
\n"; - //########################################################################################################## echo "

\n\nhier findest du alle Engel, welche zur Zeit in keiner Schichten verplant sind:

\n"; echo "\n"; echo "\t\n\t\t\n\t\t\n\t\n"; -$SQL = "SELECT Nick, UID, DECT FROM User".$inuse.";"; +$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\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\n\n"; +$Zeilen = mysql_num_rows($Erg); +for ($i = 0; $i < $Zeilen; $i++) { + echo "\t\n"; + echo "\t\t\n"; + echo "\t\t\n"; + echo "\n\n"; } echo "
NickDECT
". - mysql_result($Erg, $i, "Nick"). "". mysql_result($Erg, $i, "DECT"). "
" . + mysql_result($Erg, $i, "Nick") . "" . mysql_result($Erg, $i, "DECT") . "
\n"; -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/free_DECT.php b/www-ssl/admin/free_DECT.php index 83a4123f..4b4e3085 100644 --- a/www-ssl/admin/free_DECT.php +++ b/www-ssl/admin/free_DECT.php @@ -1,9 +1,9 @@ =Now() AND ShiftEntry.UID>0);"; +$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); +$Zeilen = mysql_num_rows($Erg); -$inuse=""; -for ($i=0; $i < $Zeilen; $i++) -{ - if ($inuse!="") - $inuse.= " OR "; - $inuse.= "(UID = \"". mysql_result($Erg, $i, "UID"). "\")"; +$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!='')"; +if ($inuse != "") { + $inuse = " WHERE (NOT (" . $inuse . ")) AND (DECT!='')"; +} else { + $inuse = " WHERE (DECT!='')"; } -else -{ - $inuse=" WHERE (DECT!='')"; -} - //########################################################################################################## -$SQL = "SELECT * FROM User".$inuse.";"; +$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"; +$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); + // 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"; - } - } + 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"; - } + // 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 "
"; + echo "\n"; + // echo "
"; } - ?> diff --git a/www-ssl/admin/group.php b/www-ssl/admin/group.php index f42fea97..b8a52ec2 100644 --- a/www-ssl/admin/group.php +++ b/www-ssl/admin/group.php @@ -1,49 +1,49 @@ \n"; - echo "\n"; - echo "\tGroupname\n"; - echo "\tLink\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\t\n"; + echo "\t\n"; + echo "\n"; - for ($n = 0 ; $n < $Zeilen ; $n++) { - echo "\n"; - echo "\t\n"; - - echo "\n"; - echo "\n"; - } - - // new form - echo "\n"; - echo "\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\n"; - echo "\n"; + for ($n = 0; $n < $Zeilen; $n++) { + echo "\n"; + echo "\t\n"; - echo "\t
GroupnameLink
".mysql_result($Erg, $n, "Name")."change
" . mysql_result($Erg, $n, "Name") . "
\n"; - // Ende Userliste -} + echo "change\n"; + echo "\n"; + } -include ("../../../camp2011/includes/footer.php"); + // new form + echo "\n"; + echo "\t
\n"; + echo "\t\t\n"; + echo "\t\t\n"; + echo "\t
\n"; + echo "\n"; + + echo "\t\n"; + // Ende Userliste +} + +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/index.php b/www-ssl/admin/index.php index e7be285c..4e761078 100644 --- a/www-ssl/admin/index.php +++ b/www-ssl/admin/index.php @@ -1,12 +1,12 @@ \n"; +include ("includes/header.php"); +include ("includes/funktion_db_list.php"); +echo "Hallo Erzengel " . $_SESSION['Nick'] . ",
\n"; ?> du bist jetzt im Erzengel-Bereich. Hier kannst du die Engel-Verwaltung vornehmen.

@@ -14,6 +14,8 @@ du bist jetzt im Erzengel-Bereich. Hier kannst du die Engel-Verwaltung vornehmen Bitte melde dich hier nach getaner Arbeit immer ab, damit kein anderer hier Änderungen vornehmen kann. diff --git a/www-ssl/admin/room.php b/www-ssl/admin/room.php index 09006675..e3defb23 100644 --- a/www-ssl/admin/room.php +++ b/www-ssl/admin/room.php @@ -1,199 +1,180 @@ \nhier hast du die Möglichkeit, neue Räume für die Schichtpläne einzutragen ". - "oder vorhandene abzuändern:

\n"; +if (!IsSet ($_GET["action"])) { + echo "Hallo " . $_SESSION['Nick'] . + ",
\nhier hast du die Möglichkeit, neue Räume für die Schichtpläne einzutragen " . + "oder vorhandene abzuändern:

\n"; - echo "- Neuen Raum/Ort eintragen
\n"; - - echo "\n"; - echo "\n"; + echo "- Neuen Raum/Ort eintragen
\n"; - for( $i = 1; $i < mysql_num_fields($Erg); $i++ ) - { - if( substr( mysql_field_name($Erg, $i), 0, 12) == "DEFAULT_EID_") - echo "\t"; - else - echo "\t"; - } - echo "\t"; - echo ""; + echo "
Anzahl ". $EngelTypeID[substr( mysql_field_name($Erg, $i), 12)]. "". mysql_field_name($Erg, $i)."Ändern
\n"; + echo "\n"; - for( $t = 0; $t < mysql_num_rows($Erg); $t++ ) - { - echo "\t\n"; - for ($j = 1; $j < mysql_num_fields($Erg); $j++) - { - echo "\t\t\n"; - } - echo "\t\t\n"; - echo "\t\n"; - } // ende Auflistung Raeume - echo "
".mysql_result($Erg, $t, $j)."###
"; -} -else -{ + for ($i = 1; $i < mysql_num_fields($Erg); $i++) { + if (substr(mysql_field_name($Erg, $i), 0, 12) == "DEFAULT_EID_") + echo "\t Anzahl " . $EngelTypeID[substr(mysql_field_name($Erg, $i), 12)] . ""; + else + echo "\t" . mysql_field_name($Erg, $i) . ""; + } + echo "\tÄndern"; + echo ""; -UnSet($SQL); + for ($t = 0; $t < mysql_num_rows($Erg); $t++) { + echo "\t\n"; + for ($j = 1; $j < mysql_num_fields($Erg); $j++) { + echo "\t\t" . mysql_result($Erg, $t, $j) . "\n"; + } + echo "\t\t###\n"; + echo "\t\n"; + } // ende Auflistung Raeume + echo ""; +} else { -switch ($_GET["action"]) { + UnSet ($SQL); -case 'new': - echo "Neuen Raum einrichten:
"; - echo "
\n"; - echo "\n"; - - for( $Uj = 1; $Uj < mysql_num_fields($Erg); $Uj++ ) - { - if( (mysql_field_name($Erg, $Uj) == "show") || (mysql_field_name($Erg, $Uj) == "FromPentabarf") ) - { - echo "". - "\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 "". - "\n"; - } - } - echo "
". mysql_field_name($Erg, $Uj). "". - "Yes". - "No". - "
$FeldName"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "
"; - break; + switch ($_GET["action"]) { -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 'new' : + echo "Neuen Raum einrichten:
"; + echo "
\n"; + echo "\n"; -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 "\n"; - echo "
\n"; - - for ($Uj = 1; $Uj < mysql_num_fields($ERG); $Uj++) - { - if( (mysql_field_name($ERG, $Uj) == "show") || (mysql_field_name($ERG, $Uj) == "FromPentabarf") ) - { - echo "". - "\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 "". - "\n"; - } - } - echo "
". mysql_field_name($Erg, $Uj). "". - "Yes". - "No". - "
$FeldName". - "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "
"; - } - 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; + for ($Uj = 1; $Uj < mysql_num_fields($Erg); $Uj++) { + if ((mysql_field_name($Erg, $Uj) == "show") || (mysql_field_name($Erg, $Uj) == "FromPentabarf")) { + echo "" . mysql_field_name($Erg, $Uj) . "" . + "" . + "Yes" . + "No" . + "\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); -case 'delete': - if (IsSet($_GET["RID"])) { - $SQL="DELETE FROM `Room` WHERE `RID`='". $_GET["RID"]. "'"; - } else { - echo "Fehlerhafter Aufruf"; - } - SetHeaderGo2Back(); - break; + echo "$FeldName" . + ""; + echo "\n"; + } + } + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + break; -} //switch + 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); -// Update ??? + 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 "
\n"; + echo "\n"; -if (IsSet($SQL)){ -// echo $SQL; - // hier muesste das SQL ausgefuehrt werden... - $Erg = db_query($SQL, "exec SQL"); - if ($Erg == 1) - echo "Änderung wurde gesichert...
"; - else - { - echo "Fehler beim speichern... bitte noch ein mal probieren :)"; - echo "

".mysql_error( $con ). "
($SQL)
"; - } -} // Ende Update + for ($Uj = 1; $Uj < mysql_num_fields($ERG); $Uj++) { + if ((mysql_field_name($ERG, $Uj) == "show") || (mysql_field_name($ERG, $Uj) == "FromPentabarf")) { + echo "" . + "\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 "" . + "\n"; + } + } + echo "
" . mysql_field_name($Erg, $Uj) . "" . + "Yes" . + "No" . + "
$FeldName" . + "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo ""; + echo "
"; + } 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...
"; + else { + echo "Fehler beim speichern... bitte noch ein mal probieren :)"; + echo "

" . mysql_error($con) . "
($SQL)
"; + } + } // Ende Update } //IF IsSet($action) -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/schichtplan.php b/www-ssl/admin/schichtplan.php index af3cd7d4..70ef5a6a 100644 --- a/www-ssl/admin/schichtplan.php +++ b/www-ssl/admin/schichtplan.php @@ -1,32 +1,30 @@ \n"; - if ($Erg == 1) - { - echo "SQL war erfolgreich"; - } - else - { - echo "SQL Fehler (". mysql_error($con).")" ; - } +function executeSQL($SQL) { + global $debug, $con; + + $Erg = mysql_query($SQL, $con); + if ($debug) + echo "DEBUG SQL: $SQL
\n"; + if ($Erg == 1) { + echo "SQL war erfolgreich"; + } else { + echo "SQL Fehler (" . mysql_error($con) . ")"; + } } -if (!IsSet($_GET["action"])) { -echo "Hallo ".$_SESSION['Nick'].",
\n"; -echo "hier kannst du Schichten anlegen, ändern oder löschen.

"; -echo "Neue Schicht einplanen

\n\n"; +if (!IsSet ($_GET["action"])) { + echo "Hallo " . $_SESSION['Nick'] . ",
\n"; + echo "hier kannst du Schichten anlegen, ändern oder löschen.

"; + echo "Neue Schicht einplanen

\n\n"; -echo "
\n"; + echo "\n"; ?> @@ -38,358 +36,327 @@ echo "\n"; \n"; - echo "\t\t\n"; - echo "\t\t\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\n"; - else - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\n"; -} -echo "
".mysql_result($Erg, $i, "DateS")."".mysql_result($Erg2, 0, "Name")."Unbenkannt (RID=". mysql_result($Erg, $i, "RID"). ")".mysql_result($Erg, $i, "Len")." Std. ####
\n"; -echo "\n"; -echo "\n"; -echo "
\n"; + $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\n"; + echo "\t\t\n"; + echo "\t\t" . mysql_result($Erg, $i, "DateS") . "\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" . mysql_result($Erg2, 0, "Name") . "\n"; + else + echo "\t\tUnbenkannt (RID=" . mysql_result($Erg, $i, "RID") . ")\n"; + echo "\t\t" . mysql_result($Erg, $i, "Len") . " Std. \n"; + echo "\t\t####\n"; + echo "\t\n"; + } + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; } else { -// aus sicherheitzgründen wegen späterer genuzung -UnSet($chSQL); + // aus sicherheitzgr�nden wegen sp�terer genuzung + UnSet ($chSQL); -switch ($_GET["action"]){ + 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); + case 'change' : + if (!IsSet ($_GET["SID"])) { + echo "Fehlerhafter Aufruf!\n"; + } else { - echo "Schicht abändern:
\n"; + $sql = "SELECT * FROM `Shifts` WHERE (`SID` = '" . $_GET["SID"] . "' )"; + $Erg = mysql_query($sql, $con); - // Anzeige Allgemeiner schaischt daten - echo "
"; - echo "\n"; - echo " ". - "\n"; - echo " \n"; - - echo " ". - "\n"; - echo " ". - "\n"; - echo " ". - "\n"; - if( $FromPentabarf == "Y") - { - echo " ". - "\n"; - } - echo "
Schichtbeginn
Raum\n\n
Dauer in h
Beschreibung
URL

!!! Imported from Pentabarf !!!

\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n\n"; - - // Löschen - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n\n"; - - echo "ACHTUNG:
\n"; - echo "Beim Löschen werden die bisher eingetragenen Engel für diese Schicht mitgelöscht.
\n"; + echo "Schicht abändern:
\n"; - echo "

\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:
\n"; - for ($j=0; $j < $rowcount; $j++) - { - $TID = mysql_result($Erg3, $j, 0); - echo "". - "freie ". TID2Type($TID). Get_Text("inc_schicht_Engel"). "schicht loeschen
\n"; - } - echo "

\n\n\n\n"; + // Anzeige Allgemeiner schaischt daten + echo "
"; + echo "\n"; + echo " " . + "\n"; + echo " " . + "\n"; + echo " " . + "\n"; + echo " " . + "\n"; + if ($FromPentabarf == "Y") { + echo " " . + "\n"; + } + echo "
Schichtbeginn
Raum\n\n". - "". - "". - "". - "". - "". - ""; - - for ($j=0; $j < $rowcount; $j++) - { - $userUID=mysql_result($Erg3, $j, "UID"); - echo "\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\n"; - } // FOR + $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 " \n"; + } + echo " \n\n"; - echo "
nicktypenormalfreeloader :-(
". UID2Nick($userUID). "". TID2Type(mysql_result($Erg3, $j, "TID")). Get_Text("inc_schicht_Engel"). "###-austragen-######-austragen-freeloader-###


\n\n\n\n"; + echo "
Dauer in h
Beschreibung
URL

!!! Imported from Pentabarf !!!

\n"; - //Nachtragen von Engeln - echo "Hat ein anderer Engel die Schicht übernommen, trage ihn bitte ein:"; - echo "\n"; - echo "\n"; - echo "\n"; - - // Listet alle Nicks auf - echo "\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 "\n"; - - echo "\n"; - - echo "
\n Anzahl New\n"; - - echo "
"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n\n"; - } // IF ISSET( - break; + // L�schen + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n\n"; -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:
\n"; - echo "Engel: ".UID2Nick($_GET["UIDs"])."
\n"; - echo "Bemerkung: Schicht eingetragen durch Erzengel ".$_SESSION['Nick']."
\n
\n"; - } - else - { - echo "Es wird folgende Schicht wurde ". $_GET["eAnzahlNew"]. "x zusätzlich eingetragen:
\n"; - for( $i=0; $i<$_GET["eAnzahlNew"]; $i++) - { - echo "$i.
\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
\n"; - if ($ERG == 1) - { - echo "Änderung wurde gesichert...
"; - } - else - { - echo "Fehler beim speichern... bitte noch ein mal probieren :)
"; - echo mysql_error($con); - } - echo "Es wird eine weitere Schicht eingetragen:

\n"; - } - } - break; + echo "ACHTUNG:
\n"; + echo "Beim Löschen werden die bisher eingetragenen Engel für diese Schicht mitgelöscht.
\n"; -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; + echo "

\n\n\n\n"; -case 'engelshiftdel': - $chSQL = "DELETE FROM `ShiftEntry` WHERE `SID`='". $_GET["SID"]. "' AND `TID`='". - $_GET["TID"]. "' AND `UID`='0' LIMIT 1"; - break; + //Freie Engelschichten + $sql3 = "SELECT `TID` FROM `ShiftEntry` WHERE `SID`='" . $_GET["SID"] . "' AND `UID`='0'"; + $Erg3 = mysql_query($sql3, $con); + $rowcount = mysql_num_rows($Erg3); -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; + echo "Folgende Engelschichten sind noch nicht vergeben.\n"; + echo "Und koenen, wenn diese nSchicht nicht benoetigt wird geloet werden:
\n"; + for ($j = 0; $j < $rowcount; $j++) { + $TID = mysql_result($Erg3, $j, 0); + echo "" . + "freie " . TID2Type($TID) . Get_Text("inc_schicht_Engel") . "schicht loeschen
\n"; + } + echo "

\n\n\n\n"; -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 "
\n"; - echo "ShiftEntry $v wird gelöscht..."; - executeSQL( "DELETE FROM `ShiftEntry` WHERE `SID`='$v'"); - echo "

\n"; - } - break; + //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); -} // end switch + echo "Folgende Engel Sind fuer die Schicht eingetargen.\n"; + echo "Und koennen, wenn diese nicht zu Schicht erschienen sind ausgetragen werden:
\n"; + echo "\n" . + "" . + "" . + "" . + "" . + "" . + ""; -if (IsSet($chSQL)){ -// echo $chSQL; - // hier muesste das SQL ausgefuehrt werden... - $Erg = mysql_query($chSQL, $con); - if( $debug ) - echo "DEBUG SQL: $chSQL
\n"; - if ($Erg == 1) - { - echo "Änderung wurde gesichert...
"; - if( $debug ) - echo "DEBUG: ergebniss". $Erg. "
\n"; - if (IsSet($ch2SQL)) - { - $Erg = mysql_query($ch2SQL, $con); - if( $debug ) - echo "DEBUG SQL: $ch2SQL
\n"; - if( $debug ) echo "DEBUG: ergebniss". $Erg. "
\n"; - } - } - else - { - echo "Fehler beim speichern... bitte noch ein mal probieren :)
"; - echo mysql_error($con); - } -} // Ende Update + for ($j = 0; $j < $rowcount; $j++) { + $userUID = mysql_result($Erg3, $j, "UID"); + echo "\t\n"; + echo "\t\t\n"; + echo "\t\t\n"; + echo "\t\t\n"; + echo "\t\t\n"; + echo "\t\n"; + } // FOR + + echo "
nicktypenormalfreeloader :-(
" . UID2Nick($userUID) . "" . TID2Type(mysql_result($Erg3, $j, "TID")) . Get_Text("inc_schicht_Engel") . "###-austragen-######-austragen-freeloader-###


\n\n\n\n"; + + //Nachtragen von Engeln + echo "Hat ein anderer Engel die Schicht übernommen, trage ihn bitte ein:"; + echo "
\n"; + echo "\n"; + echo "\n"; + + // Listet alle Nicks auf + echo "\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 "\n"; + + echo "\n"; + + echo "
\n Anzahl New\n"; + + echo "
"; + + } // 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:
\n"; + echo "Engel: " . UID2Nick($_GET["UIDs"]) . "
\n"; + echo "Bemerkung: Schicht eingetragen durch Erzengel " . $_SESSION['Nick'] . "
\n
\n"; + } else { + echo "Es wird folgende Schicht wurde " . $_GET["eAnzahlNew"] . "x zusätzlich eingetragen:
\n"; + for ($i = 0; $i < $_GET["eAnzahlNew"]; $i++) { + echo "$i.
\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
\n"; + if ($ERG == 1) { + echo "Änderung wurde gesichert...
"; + } else { + echo "Fehler beim speichern... bitte noch ein mal probieren :)
"; + echo mysql_error($con); + } + echo "Es wird eine weitere Schicht eingetragen:

\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 "
\n"; + echo "ShiftEntry $v wird gel�scht..."; + executeSQL("DELETE FROM `ShiftEntry` WHERE `SID`='$v'"); + echo "

\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
\n"; + if ($Erg == 1) { + echo "Änderung wurde gesichert...
"; + if ($debug) + echo "DEBUG: ergebniss" . $Erg . "
\n"; + if (IsSet ($ch2SQL)) { + $Erg = mysql_query($ch2SQL, $con); + if ($debug) + echo "DEBUG SQL: $ch2SQL
\n"; + if ($debug) + echo "DEBUG: ergebniss" . $Erg . "
\n"; + } + } else { + echo "Fehler beim speichern... bitte noch ein mal probieren :)
"; + echo mysql_error($con); + } + } // Ende Update } - -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/schichtplan_druck.php b/www-ssl/admin/schichtplan_druck.php index ef097043..3e856c5e 100644 --- a/www-ssl/admin/schichtplan_druck.php +++ b/www-ssl/admin/schichtplan_druck.php @@ -1,54 +1,50 @@ \n" . + "auf dieser Seite kannst du dir den Schichtplan in einer Druckansicht generieren lassen. Wähle hierfür ein Datum und den Raum:\n" . + "
\n"; - echo "Hallo ". $_SESSION['Nick']. "
\n". - "auf dieser Seite kannst du dir den Schichtplan in einer Druckansicht generieren lassen. Wähle hierfür ein Datum und den Raum:\n". - "
\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$Tag $Rname
\n"; - } - echo "
\n"; - } - echo "

"; - - include ("../../../camp2011/includes/footer.php"); -} -else //################################################################# -{ - if (IsSet($_GET["Raum"]) AND IsSet($_GET["ausdatum"])) - { - $Raum = $_GET["Raum"]; - $ausdatum = $_GET["ausdatum"]; + foreach ($VeranstaltungsTage as $k => $v) { - include ("../../../camp2011/includes/config_db.php"); - include ("../../../camp2011/includes/config.php"); - include ("../../../camp2011/includes/secure.php"); - //var wird nur gesetzt immer edit auszublenden, achtung sesion darf nicht gestart sein !!! - $_SESSION['CVS'][ "admin/schichtplan.php" ] = "N"; - include ("../../../camp2011/includes/funktion_lang.php"); - include ("../../../camp2011/includes/funktion_schichtplan.php"); - include ("../../../camp2011/includes/funktion_schichtplan_aray.php"); - include ("../../../camp2011/includes/funktion_user.php"); - ?> + $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$Tag $Rname
\n"; + } + echo "
\n"; + } + echo "

"; + + 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"); +?> @@ -81,7 +77,7 @@ else //################################################################# - + @@ -89,41 +85,35 @@ else //################################################################# \n"; - if( $j==0) - { - $Spalten[$i * $GlobalZeileProStunde + $j].= - "\t\t\n"; - - } - } + //Zeit Ausgeben + for ($i = 0; $i < 24; $i++) + for ($j = 0; $j < $GlobalZeileProStunde; $j++) { + $Spalten[$i * $GlobalZeileProStunde + $j] = "\t\n"; + if ($j == 0) { + $Spalten[$i * $GlobalZeileProStunde + $j] .= "\t\t\n"; -CreateRoomShifts( $Raum ); + } + } + CreateRoomShifts($Raum); -// Ausgabe Zeilen - for ($i = 0; $i < (24 * $GlobalZeileProStunde); $i++) echo $Spalten[$i]; -// Ende -echo "
Uhrzeit
"; - 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). "
"; + 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) . "
\n"; + // Ausgabe Zeilen + for ($i = 0; $i < (24 * $GlobalZeileProStunde); $i++) + echo $Spalten[$i]; + // Ende + echo "\n"; -echo "Stand: ". gmdate("Y-m-d H:i"). "\n"; -echo "\n"; -echo "\n"; + echo "Stand: " . gmdate("Y-m-d H:i") . "\n"; + echo "\n"; + echo "\n"; -} //isset($Vars) + } //isset($Vars) } //isset($Action) - ?> diff --git a/www-ssl/admin/shiftadd.php b/www-ssl/admin/shiftadd.php index 34c248fa..d6b1f8ff 100644 --- a/www-ssl/admin/shiftadd.php +++ b/www-ssl/admin/shiftadd.php @@ -1,70 +1,65 @@ \n"; +echo "Hallo " . $_SESSION['Nick'] . ",
\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); +$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"); - } +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); +$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; - } +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"; +if (!IsSet ($_GET["action"])) + $_GET["action"] = "new"; -switch( $_GET["action"]) -{ -case '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 @@ -80,14 +75,15 @@ mehrere Schichten auf einmal erfasst werden: Ort: @@ -103,10 +99,12 @@ mehrere Schichten auf einmal erfasst werden: More then One - > + > End: @@ -119,10 +117,12 @@ mehrere Schichten auf einmal erfasst werden: Sonderschichten ein: - > + > Sonder in h (Time;Time): @@ -131,16 +131,17 @@ mehrere Schichten auf einmal erfasst werden: Anzahl Engel je Type: ". $TTemp["Name"]. ":\n"; - echo " \n"; - } + + + foreach ($EngelType As $TTemp) { + echo " " . $TTemp["Name"] . ":\n"; + echo " \n"; + } ?>
@@ -150,209 +151,200 @@ mehrere Schichten auf einmal erfasst werden: 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 "\n"; - echo "\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\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"; + break; // Ende new - if( $_DateS != $_DateE ) - CreateNewEntry(); - - if( $_GET["MoreThenOne"]!="ON" ) break; - if( $DateEnd >= $_GET["EDatum"] && $TimeEnd >= intval($_GET["ETime"]) ) break; - } while( true ); - echo "
StartEndlenRIDBeschreibungEntry 'Shifts'SIDEntrys
"; - - if( $_GET["OnlyShow"]=="ON" ) - { - echo "
"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - foreach ($EngelType As $TTemp) - { - $Temp = "EngelType".$TTemp["TID"]; - echo "\n\t"; - } - echo "\n\t"; - echo "\n\t"; - echo "\n
"; - } //if - } //IF - break; + 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" ) -case 'engeldel': - break; + echo "\n"; + echo "\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\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 "
StartEndlenRIDBeschreibungEntry 'Shifts'SIDEntrys
"; + + if ($_GET["OnlyShow"] == "ON") { + echo "
"; + echo "\n\t"; + echo "\n\t"; + echo "\n\t"; + echo "\n\t"; + echo "\n\t"; + echo "\n\t"; + echo "\n\t"; + echo "\n\t"; + echo "\n\t"; + echo "\n\t"; + echo "\n\t"; + echo "\n\t"; + foreach ($EngelType As $TTemp) { + $Temp = "EngelType" . $TTemp["TID"]; + echo "\n\t"; + } + echo "\n\t"; + echo "\n\t"; + echo "\n
"; + } //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 "\n"; -function CreateNewEntry() -{ - global $con, $_DateS, $_DateE, $EngelType, $debug; - foreach ($EngelType As $TTemp) - { - $Temp = "EngelType".$TTemp["TID"]; - global $$Temp; - } + echo "\t$_DateS\n"; + echo "\t$_DateE\n"; + echo "\t" . $_GET["len"] . "\n"; + echo "\t" . $_GET["RID"] . "\n"; + echo "\t" . $_GET["SchichtName"] . "\n"; - echo "\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); - echo "\t$_DateS\n"; - echo "\t$_DateE\n"; - echo "\t". $_GET["len"]. "\n"; - echo "\t". $_GET["RID"]. "\n"; - echo "\t". $_GET["SchichtName"]. "\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 "\texists"; - 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"); + if (mysql_num_rows($Erg) != 0) + echo "\texists"; + 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
[".$SQL. "]"; + $SQLFail = "\n\t
[" . $SQL . "]"; - if ($Erg == 1) echo "\tpass\n"; - else echo "\tfail
\n". mysql_error($con). "$SQLFail\n"; + if ($Erg == 1) + echo "\tpass\n"; + else + echo "\tfail
\n" . mysql_error($con) . "$SQLFail\n"; - } else - echo "\tonly show\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?"; - else - { - $SID = mysql_result($Erg, 0, "SID"); - echo "\t". $SID. ""; - } + } else + echo "\tonly show\n"; - // erstellt für jeden Engeltypen die eintrage in 'ShiftEntry' - echo "\t"; - foreach ($EngelType As $TTemp) - { - $Temp = "EngelType".$TTemp["TID"]; - - if( $_GET[$Temp] > 0 ) - { - $i = 0; - echo $_GET[$Temp]. " ".$TTemp["Name"]. "
\t"; - while( $i++ < $_GET[$Temp] ) - { - if( $_GET["OnlyShow"] == "OFF" ) - { - $SQL = "INSERT INTO `ShiftEntry` (`SID`, `TID`) VALUES ("; - $SQL .= "'". $SID. "', "; - $SQL .= "'". $TTemp["TID"]. "');"; + // 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?"; + else { + $SID = mysql_result($Erg, 0, "SID"); + echo "\t" . $SID . ""; + } - $Erg = mysql_query($SQL, $con); + // erstellt f�r jeden Engeltypen die eintrage in 'ShiftEntry' + echo "\t"; + foreach ($EngelType As $TTemp) { + $Temp = "EngelType" . $TTemp["TID"]; - if( $debug ) $SQLFail = "\n\t
[".$SQL. "]"; + if ($_GET[$Temp] > 0) { + $i = 0; + echo $_GET[$Temp] . " " . $TTemp["Name"] . "
\t"; + while ($i++ < $_GET[$Temp]) { + if ($_GET["OnlyShow"] == "OFF") { + $SQL = "INSERT INTO `ShiftEntry` (`SID`, `TID`) VALUES ("; + $SQL .= "'" . $SID . "', "; + $SQL .= "'" . $TTemp["TID"] . "');"; - if ($Erg == 1) echo "'pass' "; - else echo "'fail' ". mysql_error($con). "$SQLFail\n"; + $Erg = mysql_query($SQL, $con); - } - else - echo "+"; - } - echo "
"; - } // IF $$TEMP - } // FOREACH - echo ""; - - echo "\n"; + if ($debug) + $SQLFail = "\n\t
[" . $SQL . "]"; + + if ($Erg == 1) + echo "'pass' "; + else + echo "'fail' " . mysql_error($con) . "$SQLFail\n"; + + } else + echo "+"; + } + echo "
"; + } // IF $$TEMP + } // FOREACH + echo ""; + + echo "\n"; } -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/sprache.php b/www-ssl/admin/sprache.php index ebf1db32..a36bf694 100644 --- a/www-ssl/admin/sprache.php +++ b/www-ssl/admin/sprache.php @@ -1,122 +1,110 @@ \n"; + echo Get_Text("pub_sprache_text1") . "

\n"; -if( !isset( $_GET["TextID"] ) ) -{ - echo Get_Text("Hello").$_SESSION['Nick'].",
\n"; - echo Get_Text("pub_sprache_text1")."

\n"; + echo "" . Get_Text("pub_sprache_ShowEntry") . ""; + // ausgabe Tabellenueberschift + $SQL_Sprachen = "SELECT `Sprache` FROM `Sprache` GROUP BY `Sprache`;"; + $erg_Sprachen = mysql_query($SQL_Sprachen, $con); + echo mysql_error($con); - echo "". Get_Text("pub_sprache_ShowEntry"). ""; - // ausgabe Tabellenueberschift - $SQL_Sprachen = "SELECT `Sprache` FROM `Sprache` GROUP BY `Sprache`;"; - $erg_Sprachen = mysql_query($SQL_Sprachen, $con); - echo mysql_error($con); - - for( $i=0; $i\n\t\t"; - echo "\t\t". Get_Text("pub_sprache_TextID"). ""; - foreach( $Sprachen as $Name => $Value ) - echo "". - Get_Text("pub_sprache_Sprache"). " ". $Name. - ""; - echo "\t\t". Get_Text("pub_sprache_Edit"). ""; - echo "\t\t"; + echo "\t\n\t\t"; + echo "\t\t"; + foreach ($Sprachen as $Name => $Value) + echo ""; + echo "\t\t"; + echo "\t\t"; + if (isset ($_GET["ShowEntry"])) { + // ausgabe eintraege + $SQL = "SELECT * FROM `Sprache` ORDER BY `TextID`;"; + $erg = mysql_query($SQL, $con); + echo mysql_error($con); - if( isset($_GET["ShowEntry"])) - { - // ausgabe eintraege - $SQL = "SELECT * FROM `Sprache` ORDER BY `TextID`;"; - $erg = mysql_query($SQL, $con); - echo mysql_error($con); + $TextID_Old = mysql_result($erg, 0, "TextID"); + for ($i = 0; $i < mysql_num_rows($erg); $i++) { + $TextID_New = mysql_result($erg, $i, "TextID"); + if ($TextID_Old != $TextID_New) { + echo ""; + echo "\n"; + echo "\t\t\n"; - $TextID_Old = mysql_result( $erg, 0, "TextID" ); - for( $i=0; $i"; - echo "\n"; - echo "\t\t\n"; - - foreach( $Sprachen as $Name => $Value ) - { - $Value = html_entity_decode( $Value, ENT_QUOTES); - echo "\t\t\n"; - $Sprachen[ $Name ] = ""; - } - - echo "\t\t\n"; - echo ""; - echo "\n"; - $TextID_Old = $TextID_New; - } - $Sprachen[ mysql_result( $erg, $i, "Sprache" ) ] = mysql_result( $erg, $i, "Text" ); - } /*FOR*/ - } - - //fuer neu eintraege - echo ""; - echo "\n"; - echo "\t\t\n"; - - foreach( $Sprachen as $Name => $Value ) - echo "\t\t\n"; + foreach ($Sprachen as $Name => $Value) { + $Value = html_entity_decode($Value, ENT_QUOTES); + echo "\t\t\n"; + $Sprachen[$Name] = ""; + } - echo "\t\t\n"; - echo ""; - echo "\n"; - - - echo "
" . Get_Text("pub_sprache_TextID") . "" . + Get_Text("pub_sprache_Sprache") . " " . $Name . + "" . Get_Text("pub_sprache_Edit") . "
$TextID_Old " . + "
$TextID_Old ". - "
\n"; + echo "\t\t\n"; + echo ""; + echo "\n"; + $TextID_Old = $TextID_New; + } + $Sprachen[mysql_result($erg, $i, "Sprache")] = mysql_result($erg, $i, "Text"); + } /*FOR*/ + } + + //fuer neu eintraege + echo "
"; + echo "\n"; + echo "\t\t \n"; + + foreach ($Sprachen as $Name => $Value) + echo "\t\t\n"; + + echo "\t\t\n"; + echo ""; + echo "
\n"; + + echo "\n"; } /*if( !isset( $TextID ) )*/ -else -{ - echo "edit: ". $_GET["TextID"]. "

"; - foreach ($_GET as $k => $v) { - if( $k != "TextID" ) - { - $sql_test = "SELECT * FROM `Sprache` ". - "WHERE `TextID`='". $_GET["TextID"]. "' AND `Sprache`='$k'"; - $erg_test = mysql_query($sql_test, $con); +else { + echo "edit: " . $_GET["TextID"] . "

"; + foreach ($_GET as $k => $v) { + if ($k != "TextID") { + $sql_test = "SELECT * FROM `Sprache` " . + "WHERE `TextID`='" . $_GET["TextID"] . "' AND `Sprache`='$k'"; + $erg_test = mysql_query($sql_test, $con); + + if (mysql_num_rows($erg_test) == 0) { + $sql_save = "INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) " . + "VALUES ('" . $_GET["TextID"] . "', '$k', '$v')"; + echo $sql_save . "
"; + $Erg = mysql_query($sql_save, $con); + if ($Erg == 1) + echo "\t $k Save: OK
\n"; + else + echo "\t $k Save: KO
\n"; + } else + if (mysql_result($erg_test, 0, "Text") != $v) { + $sql_save = "UPDATE `Sprache` SET `Text`='$v' " . + "WHERE `TextID`='" . $_GET["TextID"] . "' AND `Sprache`='$k' "; + echo $sql_save . "
"; + $Erg = mysql_query($sql_save, $con); + if ($Erg == 1) + echo "\t $k Update: OK
\n"; + else + echo "\t $k Update: KO
\n"; + } else + echo "\t $k no changes
\n"; + } + } - if( mysql_num_rows($erg_test)==0 ) - { - $sql_save = "INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) ". - "VALUES ('". $_GET["TextID"]. "', '$k', '$v')"; - echo $sql_save."
"; - $Erg = mysql_query($sql_save, $con); - if ($Erg == 1) - echo "\t $k Save: OK
\n"; - else - echo "\t $k Save: KO
\n"; - } - else if( mysql_result($erg_test, 0, "Text")!=$v ) - { - $sql_save = "UPDATE `Sprache` SET `Text`='$v' ". - "WHERE `TextID`='". $_GET["TextID"]. "' AND `Sprache`='$k' "; - echo $sql_save."
"; - $Erg = mysql_query($sql_save, $con); - if ($Erg == 1) - echo "\t $k Update: OK
\n"; - else - echo "\t $k Update: KO
\n"; - } - else - echo "\t $k no changes
\n"; - } - } - } -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/tshirt.php b/www-ssl/admin/tshirt.php index 6fc3551e..9a8e7010 100644 --- a/www-ssl/admin/tshirt.php +++ b/www-ssl/admin/tshirt.php @@ -1,21 +1,20 @@ "; - } + $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"]) . "
"; + } } - ?> Über die Suchen-Funktion des Browsers kann diese Liste schnell nach einem Nick abgesucht werden.
@@ -24,7 +23,9 @@ Hinter diesem erscheint ein Link, über den man eintragen kann, dass der Eng Liste aller aktiven Engel: T-Shirt ausgeben: \n"; - $eUID=mysql_result($Erg, $i, "UID"); - echo "\t\t".UID2Nick($eUID)."\n"; - echo "\t\t".mysql_result($Erg, $i, "Aktiv")."\n"; - echo "\t\t".mysql_result($Erg, $i, "Size")."\n"; - if (mysql_result($Erg, $i, "Tshirt") =="1") { - echo "\t\tbereits erhalten"; - } else { - echo "\t\tXXXXXXXX"; - } - echo "\t\n"; + +for ($i = 0; $i < $rowcount; $i++) { + echo "\t\n"; + $eUID = mysql_result($Erg, $i, "UID"); + echo "\t\t" . UID2Nick($eUID) . "\n"; + echo "\t\t" . mysql_result($Erg, $i, "Aktiv") . "\n"; + echo "\t\t" . mysql_result($Erg, $i, "Size") . "\n"; + + if (mysql_result($Erg, $i, "Tshirt") == "1") { + echo "\t\tbereits erhalten"; + } else { + echo "\t\tXXXXXXXX"; + } + echo "\t\n"; } echo ""; -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/user.php b/www-ssl/admin/user.php index 7d7c3a62..0b31c97c 100644 --- a/www-ssl/admin/user.php +++ b/www-ssl/admin/user.php @@ -1,30 +1,30 @@ Neuen Engel eintragen

\n"; - - if( !isset($_GET["OrderBy"]) ) $_GET["OrderBy"] = "Nick"; - $SQL = "SELECT User.*, UserGroups.Name AS 'Group' FROM `User` ". - "LEFT JOIN `UserCVS` ON User.UID = UserCVS.UID ". - "LEFT JOIN `UserGroups` ON UserGroups.UID = UserCVS.GroupID ". - "ORDER BY `". $_GET["OrderBy"]. "` ASC"; - $Erg = mysql_query($SQL, $con); - echo mysql_error($con); + echo "Neuen Engel eintragen

\n"; - // anzahl zeilen - $Zeilen = mysql_num_rows($Erg); + if (!isset ($_GET["OrderBy"])) + $_GET["OrderBy"] = "Nick"; + $SQL = "SELECT User.*, UserGroups.Name AS 'Group' FROM `User` " . + "LEFT JOIN `UserCVS` ON User.UID = UserCVS.UID " . + "LEFT JOIN `UserGroups` ON UserGroups.UID = UserCVS.GroupID " . + "ORDER BY `" . $_GET["OrderBy"] . "` ASC"; + $Erg = mysql_query($SQL, $con); + echo mysql_error($con); - echo "Anzahl Engel: $Zeilen

\n"; + // anzahl zeilen + $Zeilen = mysql_num_rows($Erg); - ?> + echo "Anzahl Engel: $Zeilen

\n"; +?>
\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - $Gekommen += mysql_result($Erg, $n, "Gekommen"); - echo "\t\n"; - $Active += mysql_result($Erg, $n, "Aktiv"); - echo "\t\n"; - $Tshirt += mysql_result($Erg, $n, "Tshirt"); - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\n"; - } - echo "". - "". - "\n"; - echo "\t
?OrderBy=Nick">Nick | @@ -53,88 +53,81 @@ if (!IsSet($_GET["enterUID"])) \n"; - echo "\t".mysql_result($Erg, $n, "Nick"). "
(Create: ". mysql_result($Erg, $n, "CreateDate"). ")
".mysql_result($Erg, $n, "Name")."".mysql_result($Erg, $n, "Vorname")."".mysql_result($Erg, $n, "Alter").""; - if( strlen( mysql_result($Erg, $n, "Telefon"))>0) - echo "\n\t\tTel: ". mysql_result($Erg, $n, "Telefon"). "
"; - if( strlen( mysql_result($Erg, $n, "Handy"))>0) - echo "\n\t\tHandy: ". mysql_result($Erg, $n, "Handy"). "
"; - if( strlen( mysql_result($Erg, $n, "DECT"))>0) - echo "\n\t\tDECT: ". - mysql_result($Erg, $n, "DECT"). "
"; - if( strlen( mysql_result($Erg, $n, "email"))>0) - echo "\n\t\temail: ". - mysql_result($Erg, $n, "email")."
"; - if( strlen( mysql_result($Erg, $n, "Hometown"))>0) - echo "\n\t\tHometown: ". mysql_result($Erg, $n, "Hometown"). "
"; - if( strlen( mysql_result($Erg, $n, "lastLogIn"))>0) - echo "\n\t\tlastLogIn: ". mysql_result($Erg, $n, "lastLogIn"). "
"; - if( strlen( mysql_result($Erg, $n, "Art"))>0) - echo "\n\t\tType: ". mysql_result($Erg, $n, "Art"). "
"; - if( strlen( mysql_result($Erg, $n, "ICQ"))>0) - echo "\n\t\tICQ: ". mysql_result($Erg, $n, "ICQ"). "
"; - if( strlen( mysql_result($Erg, $n, "jabber"))>0) - echo "\n\t\tjabber: ". mysql_result($Erg, $n, "jabber"). "
"; - echo "\n\t\tGroup: ". mysql_result($Erg, $n, "Group"). "
"; - echo "
".mysql_result($Erg, $n, "Size")."".mysql_result($Erg, $n, "Gekommen")."".mysql_result($Erg, $n, "Aktiv")."".mysql_result($Erg, $n, "Tshirt")."". funktion_isLinkAllowed_addLink_OrEmpty( - "admin/userChangeNormal.php?enterUID=". - mysql_result($Erg, $n, "UID")."&Type=Normal", - "Änd."). - "". funktion_isLinkAllowed_addLink_OrEmpty( - "admin/userChangeSecure.php?enterUID=". - mysql_result($Erg, $n, "UID")."&Type=Secure", - "Secure"). - "
$Gekommen$Active$Tshirt
\n"; - // Ende Userliste - echo "

Statistics

"; - funktion_db_element_list_2row( "Hometown", - "SELECT COUNT(`Hometown`), `Hometown` FROM `User` GROUP BY `Hometown`"); - echo "
\n"; + $Gekommen = 0; + $Active = 0; + $Tshirt = 0; - funktion_db_element_list_2row( "Engeltypen", - "SELECT COUNT(`Art`), `Art` FROM `User` GROUP BY `Art`"); + for ($n = 0; $n < $Zeilen; $n++) { + echo "\n"; + echo "\t" . mysql_result($Erg, $n, "Nick") . "
(Create: " . mysql_result($Erg, $n, "CreateDate") . ")\n"; + echo "\t" . mysql_result($Erg, $n, "Name") . "\n"; + echo "\t" . mysql_result($Erg, $n, "Vorname") . "\n"; + echo "\t" . mysql_result($Erg, $n, "Alter") . "\n"; + echo "\t"; + if (strlen(mysql_result($Erg, $n, "Telefon")) > 0) + echo "\n\t\tTel: " . mysql_result($Erg, $n, "Telefon") . "
"; + if (strlen(mysql_result($Erg, $n, "Handy")) > 0) + echo "\n\t\tHandy: " . mysql_result($Erg, $n, "Handy") . "
"; + if (strlen(mysql_result($Erg, $n, "DECT")) > 0) + echo "\n\t\tDECT: " . + mysql_result($Erg, $n, "DECT") . "
"; + if (strlen(mysql_result($Erg, $n, "email")) > 0) + echo "\n\t\temail: " . + mysql_result($Erg, $n, "email") . "
"; + if (strlen(mysql_result($Erg, $n, "Hometown")) > 0) + echo "\n\t\tHometown: " . mysql_result($Erg, $n, "Hometown") . "
"; + if (strlen(mysql_result($Erg, $n, "lastLogIn")) > 0) + echo "\n\t\tlastLogIn: " . mysql_result($Erg, $n, "lastLogIn") . "
"; + if (strlen(mysql_result($Erg, $n, "Art")) > 0) + echo "\n\t\tType: " . mysql_result($Erg, $n, "Art") . "
"; + if (strlen(mysql_result($Erg, $n, "ICQ")) > 0) + echo "\n\t\tICQ: " . mysql_result($Erg, $n, "ICQ") . "
"; + if (strlen(mysql_result($Erg, $n, "jabber")) > 0) + echo "\n\t\tjabber: " . mysql_result($Erg, $n, "jabber") . "
"; + echo "\n\t\tGroup: " . mysql_result($Erg, $n, "Group") . "
"; + echo "\n"; + echo "\t" . mysql_result($Erg, $n, "Size") . "\n"; + $Gekommen += mysql_result($Erg, $n, "Gekommen"); + echo "\t" . mysql_result($Erg, $n, "Gekommen") . "\n"; + $Active += mysql_result($Erg, $n, "Aktiv"); + echo "\t" . mysql_result($Erg, $n, "Aktiv") . "\n"; + $Tshirt += mysql_result($Erg, $n, "Tshirt"); + echo "\t" . mysql_result($Erg, $n, "Tshirt") . "\n"; + echo "\t" . funktion_isLinkAllowed_addLink_OrEmpty("admin/userChangeNormal.php?enterUID=" . + mysql_result($Erg, $n, "UID") . "&Type=Normal", "Änd.") . + "\n"; + echo "\t" . funktion_isLinkAllowed_addLink_OrEmpty("admin/userChangeSecure.php?enterUID=" . + mysql_result($Erg, $n, "UID") . "&Type=Secure", "Secure") . + "\n"; + echo "\n"; + } + echo "" . + "" . + "$Gekommen$Active$Tshirt\n"; + echo "\t\n"; + // Ende Userliste - echo "
\n"; + echo "

Statistics

"; + funktion_db_element_list_2row("Hometown", "SELECT COUNT(`Hometown`), `Hometown` FROM `User` GROUP BY `Hometown`"); - funktion_db_element_list_2row( "Used Groups", - "SELECT UserGroups.Name AS 'GroupName', COUNT(UserGroups.Name) AS Count FROM `UserCVS` ". - "LEFT JOIN `UserGroups` ON UserGroups.UID = UserCVS.GroupID ". - "WHERE (UserCVS.GroupID!='NULL') ". - "GROUP BY `GroupName` ". - ""); -} -else -{ - echo "error"; + echo "
\n"; + + funktion_db_element_list_2row("Engeltypen", "SELECT COUNT(`Art`), `Art` FROM `User` GROUP BY `Art`"); + + echo "
\n"; + + funktion_db_element_list_2row("Used Groups", "SELECT UserGroups.Name AS 'GroupName', COUNT(UserGroups.Name) AS Count FROM `UserCVS` " . + "LEFT JOIN `UserGroups` ON UserGroups.UID = UserCVS.GroupID " . + "WHERE (UserCVS.GroupID!='NULL') " . + "GROUP BY `GroupName` " . + ""); +} else { + echo "error"; } -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/userArrived.php b/www-ssl/admin/userArrived.php index a8fdb71e..93857d2e 100644 --- a/www-ssl/admin/userArrived.php +++ b/www-ssl/admin/userArrived.php @@ -1,54 +1,53 @@ ". Get_Text("pri_userArrived_WriteOK"). " \"". UID2Nick($_GET["arrived"]). "\""; - } else { - echo "

". Get_Text("pri_userArrived_WriteError"). " \"". UID2Nick($_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 "

" . Get_Text("pri_userArrived_WriteOK") . " \"" . UID2Nick($_GET["arrived"]) . "\"

"; + } else { + echo "

" . Get_Text("pri_userArrived_WriteError") . " \"" . UID2Nick($_GET["arrived"]) . "\"

"; + } } -echo Get_Text("pri_userArrived_Text1"). "
"; -echo Get_Text("pri_userArrived_Text2"). "

"; +echo Get_Text("pri_userArrived_Text1") . "
"; +echo Get_Text("pri_userArrived_Text2") . "

"; echo Get_Text("pri_userArrived_TableToppic"); -$SQL = "SELECT * FROM `User` ORDER BY `Nick` ASC"; +$SQL = "SELECT * FROM `User` ORDER BY `Nick` ASC"; $Erg = mysql_query($SQL, $con); $rowcount = mysql_num_rows($Erg); echo "\n"; echo "\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; +echo "\t\t\n"; echo "\t\n"; -for ($i=0; $i<$rowcount; $i++){ - echo "\t\n"; - $eUID=mysql_result($Erg, $i, "UID"); - echo "\t\t\n"; - echo "\t\t\n"; +for ($i = 0; $i < $rowcount; $i++) { + echo "\t\n"; + $eUID = mysql_result($Erg, $i, "UID"); + echo "\t\t\n"; + echo "\t\t\n"; - if (mysql_result($Erg, $i, "Gekommen") =="1") - { - echo "\t\t"; - } else { - echo "\t\t"; - } - echo "\t\n"; + if (mysql_result($Erg, $i, "Gekommen") == "1") { + echo "\t\t"; + } else { + echo "\t\t"; + } + echo "\t\n"; } echo "
". Get_Text("pri_userArrived_TableTD_Nick"). "". Get_Text("pri_userArrived_TableTD_ArrivedShow"). "". Get_Text("pri_userArrived_TableTD_ArrivedSet"). "" . Get_Text("pri_userArrived_TableTD_Nick") . "" . Get_Text("pri_userArrived_TableTD_ArrivedShow") . "" . Get_Text("pri_userArrived_TableTD_ArrivedSet") . "
".UID2Nick($eUID)."".mysql_result($Erg, $i, "Gekommen")."
" . UID2Nick($eUID) . "" . mysql_result($Erg, $i, "Gekommen") . "". Get_Text("pri_userArrived_TableEntry_Arrived"). "". Get_Text("pri_userArrived_TableEntry_Set"). "
" . Get_Text("pri_userArrived_TableEntry_Arrived") . "" . Get_Text("pri_userArrived_TableEntry_Set") . "
"; -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/userChangeNormal.php b/www-ssl/admin/userChangeNormal.php index 6785a030..36eb4b6d 100644 --- a/www-ssl/admin/userChangeNormal.php +++ b/www-ssl/admin/userChangeNormal.php @@ -1,137 +1,133 @@ Aendern... +if (IsSet ($_GET["enterUID"])) { + // UserID wurde mit uebergeben --> Aendern... - echo "Hallo,
". - "hier kannst du den Eintrag ändern. Unter dem Punkt 'Gekommen' ". - "wird der Engel als anwesend markiert, ein Ja bei Aktiv bedeutet, ". - "dass der Engel aktiv war und damit ein Anspruch auf ein T-Shirt hat. ". - "Wenn T-Shirt ein 'Ja' enthält, bedeutet dies, dass der Engel ". - "bereits sein T-Shirt erhalten hat.

\n"; + echo "Hallo,
" . + "hier kannst du den Eintrag ändern. Unter dem Punkt 'Gekommen' " . + "wird der Engel als anwesend markiert, ein Ja bei Aktiv bedeutet, " . + "dass der Engel aktiv war und damit ein Anspruch auf ein T-Shirt hat. " . + "Wenn T-Shirt ein 'Ja' enthält, bedeutet dies, dass der Engel " . + "bereits sein T-Shirt erhalten hat.

\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; - $SQL = "SELECT * FROM `User` WHERE `UID`='". $_GET["enterUID"]. "'"; - $Erg = mysql_query($SQL, $con); - - if (mysql_num_rows($Erg) != 1) - echo ""; - else - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; + echo " \n"; - - echo "
"; - funktion_db_element_list_2row( - "Freeloader Shifts", - "SELECT `Remove_Time`, `Length`, `Comment` FROM `ShiftFreeloader` WHERE UID=". $_GET["enterUID"]); + echo "
Sorry, der Engel (UID=". $_GET["enterUID"]. - ") wurde in der Liste nicht gefunden.
\n"; - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - - // Gekommen? - echo " \n"; + $SQL = "SELECT * FROM `User` WHERE `UID`='" . $_GET["enterUID"] . "'"; + $Erg = mysql_query($SQL, $con); - // Aktiv? - echo " \n"; + if (mysql_num_rows($Erg) != 1) + echo ""; + else { + echo ""; - } + // Aktiv? + echo " \n"; - echo "\n"; - echo "
Nick". - "
lastLogIn". - "
Name". - "
Vorname". - "
Alter". - "
Telefon". - "
Handy". - "
DECT". - "
email". - "
ICQ". - "
jabber". - "
Size". - "
Passwort". - "neues Kennwort setzen
Gekommen\n"; - echo " No \n"; - echo " Yes \n"; - echo "
Aktiv\n"; - echo " No \n"; - echo " Yes \n"; - echo "
Sorry, der Engel (UID=" . $_GET["enterUID"] . + ") wurde in der Liste nicht gefunden.
\n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; - // T-Shirt bekommen? - echo " \n"; + // Gekommen? + echo " \n"; - echo " \n"; - - echo "
Nick" . + "
lastLogIn" . + "
Name" . + "
Vorname" . + "
Alter" . + "
Telefon" . + "
Handy" . + "
DECT" . + "
email" . + "
ICQ" . + "
jabber" . + "
Size" . + "
Passwort" . + "neues Kennwort setzen
T-Shirt\n"; - echo " No \n"; - echo " Yes \n"; - echo "
Gekommen\n"; + echo " No \n"; + echo " Yes \n"; + echo "
Hometown". - "
\n
". displayavatar($_GET["enterUID"], FALSE). "
Aktiv\n"; + echo " No \n"; + echo " Yes \n"; + echo "
\n
\n"; - echo "\n"; - echo "\n"; - echo ""; + // T-Shirt bekommen? + echo "
T-Shirt\n"; + echo " No \n"; + echo " Yes \n"; + echo "
Hometown" . + "
\n" . displayavatar($_GET["enterUID"], FALSE) . ""; + } + + echo "\n"; + echo "\n
\n"; + echo "\n"; + echo "\n"; + echo ""; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "
"; + + echo "
"; + funktion_db_element_list_2row("Freeloader Shifts", "SELECT `Remove_Time`, `Length`, `Comment` FROM `ShiftFreeloader` WHERE UID=" . $_GET["enterUID"]); } -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/userChangeSecure.php b/www-ssl/admin/userChangeSecure.php index 2eb84b85..69c4601d 100644 --- a/www-ssl/admin/userChangeSecure.php +++ b/www-ssl/admin/userChangeSecure.php @@ -1,112 +1,104 @@ Aendern... +if (IsSet ($_GET["enterUID"])) { + // UserID wurde mit uebergeben --> Aendern... - echo "Hallo,
". - "hier kannst du den Eintrag ändern. Unter dem Punkt 'Gekommen' ". - "wird der Engel als anwesend markiert, ein Ja bei Aktiv bedeutet, ". - "dass der Engel aktiv war und damit ein Anspruch auf ein T-Shirt hat. ". - "Wenn T-Shirt ein 'Ja' enthält, bedeutet dies, dass der Engel ". - "bereits sein T-Shirt erhalten hat.

\n"; + echo "Hallo,
" . + "hier kannst du den Eintrag ändern. Unter dem Punkt 'Gekommen' " . + "wird der Engel als anwesend markiert, ein Ja bei Aktiv bedeutet, " . + "dass der Engel aktiv war und damit ein Anspruch auf ein T-Shirt hat. " . + "Wenn T-Shirt ein 'Ja' enthält, bedeutet dies, dass der Engel " . + "bereits sein T-Shirt erhalten hat.

\n"; + $SQL_CVS = "SELECT * FROM `UserCVS` WHERE `UID`='" . $_GET["enterUID"] . "'"; + $Erg_CVS = mysql_query($SQL_CVS, $con); - $SQL_CVS = "SELECT * FROM `UserCVS` WHERE `UID`='". $_GET["enterUID"]. "'"; - $Erg_CVS = mysql_query($SQL_CVS, $con); - - if( mysql_num_rows($Erg_CVS) != 1) - echo "Sorry, der Engel (UID=". $_GET["enterUID"]. ") wurde in der Liste nicht gefunden."; - else - { - // Rename if is an group - if( $_GET["enterUID"] < 0 ) { - $SQLname = "SELECT `Name` FROM `UserGroups` WHERE `UID`='". $_GET["enterUID"]. "'"; - $ErgName = mysql_query($SQLname, $con); - echo mysql_error($con); + if (mysql_num_rows($Erg_CVS) != 1) + echo "Sorry, der Engel (UID=" . $_GET["enterUID"] . ") wurde in der Liste nicht gefunden."; + else { + // Rename if is an group + if ($_GET["enterUID"] < 0) { + $SQLname = "SELECT `Name` FROM `UserGroups` WHERE `UID`='" . $_GET["enterUID"] . "'"; + $ErgName = mysql_query($SQLname, $con); + echo mysql_error($con); - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
"; - } + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
"; + } - echo "
\n"; - echo "\n"; - echo "\n"; - echo " \n"; + echo "\n"; + echo "

Rights of \"". UID2Nick($_GET["enterUID"]). "\":
\n"; + echo "\n"; + echo " \n"; + $CVS_Data = mysql_fetch_array($Erg_CVS); + $CVS_Data_i = 1; + foreach ($CVS_Data as $CVS_Data_Name => $CVS_Data_Value) { + $CVS_Data_i++; + //nur jeder zweiter sonst wird f�r jeden text noch die position (Zahl) ausgegeben + if ($CVS_Data_i % 2 && $CVS_Data_Name != "UID") { + if ($CVS_Data_Name == "GroupID") { + if ($_GET["enterUID"] > 0) { + echo "\n" . + "\n". - ""; + } + } else { + echo "\n"; + } + } + } //IF + } //Foreach + echo "\n"; - $SQL_Group = "SELECT * FROM `UserGroups`"; - $Erg_Group = mysql_query($SQL_Group, $con); - for ($n = 0 ; $n < mysql_num_rows($Erg_Group) ; $n++) - { - $UID = mysql_result($Erg_Group, $n, "UID"); - echo "\t\n"; - } - echo ""; - } - } else { - echo "\n"; - } - } - } //IF - } //Foreach - echo "\n"; - - // Ende Formular - echo "\n"; - echo "

Rights of \"" . UID2Nick($_GET["enterUID"]) . "\":
Group
Group
$CVS_Data_Name"; + echo "allow \n"; + echo "denied \n"; + if ($_GET["enterUID"] > 0) { + echo "group-setting \n"; + echo "
$CVS_Data_Name"; - echo "allow \n"; - echo "denied \n"; - if( $_GET["enterUID"] > 0 ) - { - echo "group-setting \n"; - echo "
\n
\n"; - echo "\n"; - echo "\n"; - echo "
"; + // Ende Formular + echo "\n"; + echo "\n
\n"; + echo "\n"; + echo "\n"; + echo ""; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "
"; - } + echo "
\n"; + echo "\n"; + echo "\n"; + echo "
"; + } } -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/userDefaultSetting.php b/www-ssl/admin/userDefaultSetting.php index d4a230de..e7a69925 100644 --- a/www-ssl/admin/userDefaultSetting.php +++ b/www-ssl/admin/userDefaultSetting.php @@ -1,72 +1,70 @@ \nhier hast du die Möglichkeit, die Defaulteinstellungen für neue User einzustellen:

\n"; -echo "Hallo ".$_SESSION['Nick']. - ",
\nhier hast du die Möglichkeit, die Defaulteinstellungen für neue User einzustellen:

\n"; - echo "\n"; echo "\t\n"; echo "\t\t\n\t\t\n\t\t\n"; echo "\t\n"; -if( isset( $_GET["Field"]) && isset( $_GET["Default"]) && isset( $_GET["Send"])) -{ - switch( $_GET["Send"]) - { - case "New": - $SQL = "ALTER TABLE `UserCVS` ADD `". $_GET["Field"]. "` ". - "CHAR( 1 ) DEFAULT '". $_GET["Default"]. "' NOT NULL"; - $Erg = db_query( $SQL, "New user default setting"); - if( $Erg == 1) - echo "

Create ".$_GET["Field"]. " = ". $_GET["Default"]. " succesfull

\n"; - else - echo "

Create ".$_GET["Field"]. " = ". $_GET["Default"]. " error...

\n". - "[". mysql_error(). "]

"; - break; - case "Del": - echo "\t\n"; - echo "\t\t\n"; - echo "\t\t\t\n"; - echo "\t\t\t\n"; - echo "\t\t\t\n"; - echo "\t\t\n"; - echo "\t\n"; - break; - case "Del sure": - $SQL = "ALTER TABLE `UserCVS` DROP `". $_GET["Field"]. "` "; - $Erg = db_query( $SQL, "del user default setting"); - if( $Erg == 1) - echo "

Delete ".$_GET["Field"]. " succesfull

\n"; - else - echo "

Delete ".$_GET["Field"]. " error...

\n". - "[". mysql_error(). "]

"; - break; - case "SetForAllUser": - $SQL = "UPDATE `UserCVS` SET `". $_GET["Field"]. "`='". $_GET["Default"]. "' WHERE UID>0"; - $Erg = db_query( $SQL, "Set new user default setting for all user"); - if( $Erg == 1) - echo "

UPDATE ".$_GET["Field"]. " = ". $_GET["Default"]. " for all Users succesfull

\n"; - else - echo "

UPDATE ".$_GET["Field"]. " = ". $_GET["Default"]. " for all Users error...

\n". - "[". mysql_error(). "]

"; - case "Save": - $SQL = "ALTER TABLE `UserCVS` CHANGE `". $_GET["Field"]. "` ". - "`". $_GET["Field"]. "` CHAR( 1 ) NOT NULL DEFAULT '". $_GET["Default"]. "'"; - $Erg = db_query( $SQL, "Save user default setting"); - if( $Erg == 1) - echo "

Write ".$_GET["Field"]. " = ". $_GET["Default"]. " succesfull

\n"; - else - echo "

Write ".$_GET["Field"]. " = ". $_GET["Default"]. " error...

\n". - "[". mysql_error(). "]

"; - break; - } //SWITCH +if (isset ($_GET["Field"]) && isset ($_GET["Default"]) && isset ($_GET["Send"])) { + switch ($_GET["Send"]) { + case "New" : + $SQL = "ALTER TABLE `UserCVS` ADD `" . $_GET["Field"] . "` " . + "CHAR( 1 ) DEFAULT '" . $_GET["Default"] . "' NOT NULL"; + $Erg = db_query($SQL, "New user default setting"); + if ($Erg == 1) + echo "

Create " . $_GET["Field"] . " = " . $_GET["Default"] . " succesfull

\n"; + else + echo "

Create " . $_GET["Field"] . " = " . $_GET["Default"] . " error...

\n" . + "[" . mysql_error() . "]

"; + break; + case "Del" : + echo "\t\n"; + echo "\t\t\n"; + echo "\t\t\t\n"; + echo "\t\t\t\n"; + echo "\t\t\t\n"; + echo "\t\t\n"; + echo "\t\n"; + break; + case "Del sure" : + $SQL = "ALTER TABLE `UserCVS` DROP `" . $_GET["Field"] . "` "; + $Erg = db_query($SQL, "del user default setting"); + if ($Erg == 1) + echo "

Delete " . $_GET["Field"] . " succesfull

\n"; + else + echo "

Delete " . $_GET["Field"] . " error...

\n" . + "[" . mysql_error() . "]

"; + break; + case "SetForAllUser" : + $SQL = "UPDATE `UserCVS` SET `" . $_GET["Field"] . "`='" . $_GET["Default"] . "' WHERE UID>0"; + $Erg = db_query($SQL, "Set new user default setting for all user"); + if ($Erg == 1) + echo "

UPDATE " . $_GET["Field"] . " = " . $_GET["Default"] . " for all Users succesfull

\n"; + else + echo "

UPDATE " . $_GET["Field"] . " = " . $_GET["Default"] . " for all Users error...

\n" . + "[" . mysql_error() . "]

"; + case "Save" : + $SQL = "ALTER TABLE `UserCVS` CHANGE `" . $_GET["Field"] . "` " . + "`" . $_GET["Field"] . "` CHAR( 1 ) NOT NULL DEFAULT '" . $_GET["Default"] . "'"; + $Erg = db_query($SQL, "Save user default setting"); + if ($Erg == 1) + echo "

Write " . $_GET["Field"] . " = " . $_GET["Default"] . " succesfull

\n"; + else + echo "

Write " . $_GET["Field"] . " = " . $_GET["Default"] . " error...

\n" . + "[" . mysql_error() . "]

"; + break; + } //SWITCH } //IF( - $erg = mysql_query("SHOW COLUMNS FROM `UserCVS`"); echo mysql_error(); echo "\t\n"; @@ -76,14 +74,13 @@ echo "\t\t\t\n"; echo "\t\t\t\n"; echo "\t\t\t\n"; -for( $i=2; $i\n"; - echo "\t\t
\n"; - echo "\t\t\t\n"; - echo "\t\t\t
\n"; - echo "\t\t\t\n"; + echo "\t\t\n"; + echo "\t\t\t\n"; + echo "\t\t\t\n"; + echo "\t\t\t\n"; - echo "\t\t\t\n"; - echo "\t\t\n"; - echo "\t\n"; + echo "\t\t\t\tgroup-setting\n"; + + echo "\t\t\t\n"; + echo "\t\t\t\n"; + echo "\t\t\n"; + echo "\t\n"; } - + echo "\t\n"; echo "\t\t\n"; echo "\t\t\t\n"; @@ -135,10 +131,8 @@ echo "\t\t\t\n"; echo "\t\t\n"; echo "\t\n"; - - echo "
PageShow
Group\n"; @@ -91,37 +88,36 @@ echo "\t\t\t \n"; echo "\t
". mysql_result( $erg, $i, "Field"). "\n"; - - echo "\t\t\t\tallow\n"; +for ($i = 2; $i < mysql_num_rows($erg); $i++) { + echo "\t
" . mysql_result($erg, $i, "Field") . "\n"; - echo "\t\t\t\tdenied\n"; + echo "\t\t\t\tallow\n"; - echo "\t\t\t\tgroup-setting\n"; + echo "\t\t\t\tdenied\n"; - echo "\t\t\t\n"; - echo "\t\t\t \n"; - echo "\t\t\t
\n"; + echo "\t\t\t \n"; + echo "\t\t\t
\n"; -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/userSaveNormal.php b/www-ssl/admin/userSaveNormal.php index b1b42f96..deaf96d9 100644 --- a/www-ssl/admin/userSaveNormal.php +++ b/www-ssl/admin/userSaveNormal.php @@ -1,130 +1,119 @@ "; +if (IsSet ($_GET["action"])) { + SetHeaderGo2Back(); + echo "Gesendeter Befehl: " . $_GET["action"] . "
"; - switch ($_GET["action"]) - { - case "change": - if (IsSet($_POST["enterUID"])) - { - if ($_POST["Type"] == "Normal") - { - $SQL = "UPDATE `User` SET "; - $SQL.= " `Nick` = '". $_POST["eNick"]. "', `Name` = '". $_POST["eName"]. "', ". - "`Vorname` = '". $_POST["eVorname"]. "', ". - "`Telefon` = '". $_POST["eTelefon"]. "', ". - "`Handy` = '". $_POST["eHandy"]. "', ". - "`DECT` = '". $_POST["eDECT"]. "', ". - "`email` = '". $_POST["eemail"]. "', ". - "`ICQ` = '". $_POST["eICQ"]. "', ". - "`jabber` = '". $_POST["ejabber"]. "', ". - "`Size` = '". $_POST["eSize"]. "', ". - "`Gekommen`= '". $_POST["eGekommen"]. "', ". - "`Aktiv`= '". $_POST["eAktiv"]. "', ". - "`Tshirt` = '". $_POST["eTshirt"]. "', ". - "`Hometown` = '". $_POST["Hometown"]. "' ". - "WHERE `UID` = '". $_POST["enterUID"]. - "' LIMIT 1;"; - echo "User-"; - $Erg = db_query($SQL, "change user details"); - if ($Erg == 1) { - echo "Änderung wurde gesichert...\n"; - } else { - echo "Fehler beim speichern...\n(". mysql_error($con). ")"; - } - } - else - echo "

Fehler: Unbekanter Type (". $_POST["Type"]. ") übergeben\n

\n"; - } - else - echo "

Fehler: UserID (enterUID) wurde nicht per POST übergeben

\n"; - break; + switch ($_GET["action"]) { + case "change" : + if (IsSet ($_POST["enterUID"])) { + if ($_POST["Type"] == "Normal") { + $SQL = "UPDATE `User` SET "; + $SQL .= " `Nick` = '" . $_POST["eNick"] . "', `Name` = '" . $_POST["eName"] . "', " . + "`Vorname` = '" . $_POST["eVorname"] . "', " . + "`Telefon` = '" . $_POST["eTelefon"] . "', " . + "`Handy` = '" . $_POST["eHandy"] . "', " . + "`DECT` = '" . $_POST["eDECT"] . "', " . + "`email` = '" . $_POST["eemail"] . "', " . + "`ICQ` = '" . $_POST["eICQ"] . "', " . + "`jabber` = '" . $_POST["ejabber"] . "', " . + "`Size` = '" . $_POST["eSize"] . "', " . + "`Gekommen`= '" . $_POST["eGekommen"] . "', " . + "`Aktiv`= '" . $_POST["eAktiv"] . "', " . + "`Tshirt` = '" . $_POST["eTshirt"] . "', " . + "`Hometown` = '" . $_POST["Hometown"] . "' " . + "WHERE `UID` = '" . $_POST["enterUID"] . + "' LIMIT 1;"; + echo "User-"; + $Erg = db_query($SQL, "change user details"); + if ($Erg == 1) { + echo "Änderung wurde gesichert...\n"; + } else { + echo "Fehler beim speichern...\n(" . mysql_error($con) . ")"; + } + } else + echo "

Fehler: Unbekanter Type (" . $_POST["Type"] . ") �bergeben\n

\n"; + } else + echo "

Fehler: UserID (enterUID) wurde nicht per POST �bergeben

\n"; + break; - case "delete": - if (IsSet($_POST["enterUID"])) - { - echo "delate User..."; - $SQL="DELETE FROM `User` WHERE `UID`='". $_POST["enterUID"]. "' LIMIT 1;"; - $Erg = db_query($SQL, "User delete"); - if ($Erg == 1) { - echo "Änderung wurde gesichert...\n"; - } else { - echo "Fehler beim speichern...\n(". mysql_error($con). ")"; - } - - echo "
\ndelate UserCVS..."; - $SQL2="DELETE FROM `UserCVS` WHERE `UID`='". $_POST["enterUID"]. "' LIMIT 1;"; - $Erg = db_query($SQL2, "User CVS delete"); - if ($Erg == 1) { - echo "Änderung wurde gesichert...\n"; - } else { - echo "Fehler beim speichern...\n(". mysql_error($con). ")"; - } - - echo "
\ndelate UserEntry..."; - $SQL3="UPDATE `ShiftEntry` SET `UID`='0', `Comment`=NULL ". - "WHERE `UID`='". $_POST["enterUID"]. "';"; - $Erg = db_query($SQL3, "delate UserEntry"); - if ($Erg == 1) { - echo "Änderung wurde gesichert...\n"; - } else { - echo "Fehler beim speichern...\n(". mysql_error($con). ")"; - } - } - break; + case "delete" : + if (IsSet ($_POST["enterUID"])) { + echo "delate User..."; + $SQL = "DELETE FROM `User` WHERE `UID`='" . $_POST["enterUID"] . "' LIMIT 1;"; + $Erg = db_query($SQL, "User delete"); + if ($Erg == 1) { + echo "Änderung wurde gesichert...\n"; + } else { + echo "Fehler beim speichern...\n(" . mysql_error($con) . ")"; + } + echo "
\ndelate UserCVS..."; + $SQL2 = "DELETE FROM `UserCVS` WHERE `UID`='" . $_POST["enterUID"] . "' LIMIT 1;"; + $Erg = db_query($SQL2, "User CVS delete"); + if ($Erg == 1) { + echo "Änderung wurde gesichert...\n"; + } else { + echo "Fehler beim speichern...\n(" . mysql_error($con) . ")"; + } - case "newpw": - echo "Bitte neues Kennwort für "; - // Get Nick - $USQL = "SELECT * FROM `User` WHERE `UID`='". $_GET["eUID"]. "'"; - $Erg = mysql_query($USQL, $con); - echo mysql_result($Erg, 0, "Nick"); - echo " eingeben:
"; - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "
"; - break; + echo "
\ndelate UserEntry..."; + $SQL3 = "UPDATE `ShiftEntry` SET `UID`='0', `Comment`=NULL " . + "WHERE `UID`='" . $_POST["enterUID"] . "';"; + $Erg = db_query($SQL3, "delate UserEntry"); + if ($Erg == 1) { + echo "Änderung wurde gesichert...\n"; + } else { + echo "Fehler beim speichern...\n(" . mysql_error($con) . ")"; + } + } + break; - case "newpwsave": - if ($_POST["ePasswort"] == $_POST["ePasswort2"]) - { // beide Passwoerter passen... - $_POST["ePasswort"] = PassCrypt($_POST["ePasswort"]); - $SQL = "UPDATE `User` SET `Passwort`='". $_POST["ePasswort"]. "' ". - "WHERE `UID`='". $_POST["eUID"]. "'"; - $Erg = db_query($SQL, "User new passwort"); - if ($Erg == 1) { - echo "Änderung wurde gesichert...\n"; - } else { - echo "Fehler beim speichern...\n(". mysql_error($con). ")"; - } - } - else - echo "Das Passwort wurde nicht übereinstimmend eingegeben!"; - break; - } // end switch + case "newpw" : + echo "Bitte neues Kennwort für "; + // Get Nick + $USQL = "SELECT * FROM `User` WHERE `UID`='" . $_GET["eUID"] . "'"; + $Erg = mysql_query($USQL, $con); + echo mysql_result($Erg, 0, "Nick"); + echo " eingeben:
"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "
"; + break; -// ende - Action ist gesetzt -} -else -{ - // kein Action gesetzt -> abbruch - echo "Unzulässiger Aufruf.
Bitte neu editieren..."; + case "newpwsave" : + if ($_POST["ePasswort"] == $_POST["ePasswort2"]) { // beide Passwoerter passen... + $_POST["ePasswort"] = PassCrypt($_POST["ePasswort"]); + $SQL = "UPDATE `User` SET `Passwort`='" . $_POST["ePasswort"] . "' " . + "WHERE `UID`='" . $_POST["eUID"] . "'"; + $Erg = db_query($SQL, "User new passwort"); + if ($Erg == 1) { + echo "Änderung wurde gesichert...\n"; + } else { + echo "Fehler beim speichern...\n(" . mysql_error($con) . ")"; + } + } else + echo "Das Passwort wurde nicht übereinstimmend eingegeben!"; + break; + } // end switch + + // ende - Action ist gesetzt +} else { + // kein Action gesetzt -> abbruch + echo "Unzulässiger Aufruf.
Bitte neu editieren..."; } -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?> diff --git a/www-ssl/admin/userSaveSecure.php b/www-ssl/admin/userSaveSecure.php index e9ad6135..de4b47ff 100644 --- a/www-ssl/admin/userSaveSecure.php +++ b/www-ssl/admin/userSaveSecure.php @@ -1,178 +1,167 @@ 0 ) { - $Right = $_SESSION['CVS'][ "admin/user.php"]; +if (!IsSet ($_POST["enterUID"])) { + $Right = "N"; +} +elseif ($_POST["enterUID"] > 0) { + $Right = $_SESSION['CVS']["admin/user.php"]; } else { - $Right = $_SESSION['CVS'][ "admin/group.php"]; + $Right = $_SESSION['CVS']["admin/group.php"]; } -if ( ($Right=="Y") && IsSet($_GET["action"])) -{ - SetHeaderGo2Back(); - echo "Gesendeter Befehl: ". $_GET["action"]. "
"; - - switch ($_GET["action"]) - { - case "change": - if (IsSet($_POST["enterUID"])) - { - if ($_POST["Type"] == "Secure") - { - $SQL2 = "UPDATE `UserCVS` SET "; - $SQL_CVS = "SELECT * FROM `UserCVS` WHERE `UID`='". $_POST["enterUID"]. "'"; - $Erg_CVS = mysql_query($SQL_CVS, $con); - $CVS_Data = mysql_fetch_array($Erg_CVS); - $CVS_Data_i = 1; - foreach ($CVS_Data as $CVS_Data_Name => $CVS_Data_Value) - { - if( ($CVS_Data_i+1)%2 && $CVS_Data_Name!="UID") { - if( $CVS_Data_Name == "GroupID") - { - if( $_POST["enterUID"] > 0 ) - $SQL2.= "`$CVS_Data_Name` = '". $_POST["GroupID"]."', "; - else - $SQL2.= "`$CVS_Data_Name` = NULL, "; - } else { - $SQL2.= "`$CVS_Data_Name` = '". $_POST[$CVS_Data_i]."', "; - } - } - $CVS_Data_i++; - } - $SQL2 = substr( $SQL2, 0, strlen($SQL2)-2 ); - $SQL2.= " WHERE `UID`='". $_POST["enterUID"]. "' LIMIT 1;"; - echo "
Secure-"; - $Erg = db_query($SQL2, "change user CVS"); - if ($Erg == 1) { - echo "Änderung wurde gesichert...\n"; - } else { - echo "Fehler beim speichern...\n(". mysql_error($con). ")"; - } - } - else - echo "

Fehler: Unbekanter Type (". $_POST["Type"]. ") übergeben\n

\n"; - } - else - echo "

Fehler: UserID (enterUID) wurde nicht per POST übergeben

\n"; - break; +if (($Right == "Y") && IsSet ($_GET["action"])) { + SetHeaderGo2Back(); + echo "Gesendeter Befehl: " . $_GET["action"] . "
"; - case "changeGroupName": - if (IsSet($_POST["enterUID"]) && ($_POST["enterUID"]<0) ) - { - $SQL = "UPDATE `UserGroups` SET `Name`='". $_POST["GroupName"]. "' WHERE `UID`='". $_POST["enterUID"]. "' LIMIT 1 ;"; - $Erg = db_query($SQL, "Update Group Name"); - if ($Erg == 1) { - echo "Änderung wurde gesichert...\n"; - } else { - echo "Fehler beim speichern...\n(". mysql_error($con). ")"; - } - } - else - echo "

Fehler: UserID (enterUID) wurde nicht per POST übergeben

\n"; - break; + switch ($_GET["action"]) { + case "change" : + if (IsSet ($_POST["enterUID"])) { + if ($_POST["Type"] == "Secure") { + $SQL2 = "UPDATE `UserCVS` SET "; + $SQL_CVS = "SELECT * FROM `UserCVS` WHERE `UID`='" . $_POST["enterUID"] . "'"; + $Erg_CVS = mysql_query($SQL_CVS, $con); + $CVS_Data = mysql_fetch_array($Erg_CVS); + $CVS_Data_i = 1; + foreach ($CVS_Data as $CVS_Data_Name => $CVS_Data_Value) { + if (($CVS_Data_i +1) % 2 && $CVS_Data_Name != "UID") { + if ($CVS_Data_Name == "GroupID") { + if ($_POST["enterUID"] > 0) + $SQL2 .= "`$CVS_Data_Name` = '" . $_POST["GroupID"] . "', "; + else + $SQL2 .= "`$CVS_Data_Name` = NULL, "; + } else { + $SQL2 .= "`$CVS_Data_Name` = '" . $_POST[$CVS_Data_i] . "', "; + } + } + $CVS_Data_i++; + } + $SQL2 = substr($SQL2, 0, strlen($SQL2) - 2); + $SQL2 .= " WHERE `UID`='" . $_POST["enterUID"] . "' LIMIT 1;"; + echo "
Secure-"; + $Erg = db_query($SQL2, "change user CVS"); + if ($Erg == 1) { + echo "Änderung wurde gesichert...\n"; + } else { + echo "Fehler beim speichern...\n(" . mysql_error($con) . ")"; + } + } else + echo "

Fehler: Unbekanter Type (" . $_POST["Type"] . ") �bergeben\n

\n"; + } else + echo "

Fehler: UserID (enterUID) wurde nicht per POST �bergeben

\n"; + break; - case "delete": - if (IsSet($_POST["enterUID"]) && ($_POST["enterUID"]>0) ) - { - echo "delate User..."; - $SQL="DELETE FROM `User` WHERE `UID`='". $_POST["enterUID"]. "' LIMIT 1;"; - $Erg = db_query($SQL, "User delete"); - if ($Erg == 1) { - echo "Änderung wurde gesichert...\n"; - } else { - echo "Fehler beim speichern...\n(". mysql_error($con). ")"; - } - - echo "
\ndelate UserCVS..."; - $SQL2="DELETE FROM `UserCVS` WHERE `UID`='". $_POST["enterUID"]. "' LIMIT 1;"; - $Erg = db_query($SQL2, "User CVS delete"); - if ($Erg == 1) { - echo "Änderung wurde gesichert...\n"; - } else { - echo "Fehler beim speichern...\n(". mysql_error($con). ")"; - } - - echo "
\ndelate UserEntry..."; - $SQL3="UPDATE `ShiftEntry` SET `UID`='0', `Comment`=NULL ". - "WHERE `UID`='". $_POST["enterUID"]. "';"; - $Erg = db_query($SQL3, "delate UserEntry"); - if ($Erg == 1) { - echo "Änderung wurde gesichert...\n"; - } else { - echo "Fehler beim speichern...\n(". mysql_error($con). ")"; - } - } elseif (IsSet($_POST["enterUID"]) && ($_POST["enterUID"]<0) ) { - echo "delate Group..."; - $SQL="DELETE FROM `UserGroups` WHERE `UID`='". $_POST["enterUID"]. "' LIMIT 1;"; - $Erg = db_query($SQL, "Group delete"); - if ($Erg == 1) { - echo "Änderung wurde gesichert...\n"; - } else { - echo "Fehler beim speichern...\n(". mysql_error($con). ")"; - } - - echo "
\ndelate UserCVS..."; - $SQL2="DELETE FROM `UserCVS` WHERE `UID`='". $_POST["enterUID"]. "' LIMIT 1;"; - $Erg = db_query($SQL2, "User CVS delete"); - if ($Erg == 1) { - echo "Änderung wurde gesichert...\n"; - } else { - echo "Fehler beim speichern...\n(". mysql_error($con). ")"; - } - - } - break; - } // end switch + case "changeGroupName" : + if (IsSet ($_POST["enterUID"]) && ($_POST["enterUID"] < 0)) { + $SQL = "UPDATE `UserGroups` SET `Name`='" . $_POST["GroupName"] . "' WHERE `UID`='" . $_POST["enterUID"] . "' LIMIT 1 ;"; + $Erg = db_query($SQL, "Update Group Name"); + if ($Erg == 1) { + echo "Änderung wurde gesichert...\n"; + } else { + echo "Fehler beim speichern...\n(" . mysql_error($con) . ")"; + } + } else + echo "

Fehler: UserID (enterUID) wurde nicht per POST �bergeben

\n"; + break; -// ende - Action ist gesetzt -} elseif ( IsSet($_GET["new"]) && ($_SESSION['CVS']["admin/group.php"]=="Y") ) { - echo "Gesendeter Befehl: ". $_GET["new"]. "
"; - - switch ($_GET["new"]) - { - case "newGroup": - echo "\tGenerate new Group ID...\n"; - $SQLid="SELECT MIN(`UID`) FROM `UserCVS`;"; - $Erg = mysql_query( $SQLid); - - if( mysql_num_rows($Erg) == 1) { - $NewId = mysql_result( $Erg, 0, 0)-1; - $SQLnew1 = "INSERT INTO `UserGroups` (`UID`, `Name`) VALUES ('$NewId', '". $_POST["GroupName"]. "' );"; - $SQLnew2 = "INSERT INTO `UserCVS` (`UID`, `GroupID`) VALUES ('$NewId', NULL );"; - echo "\t
Generate new UserGroup ...\n"; - $ErgNew1 = db_query($SQLnew1, "create UserGroups Entry"); - if ($ErgNew1 == 1) - { - echo "\t
Generate new User rights...\n"; - $ErgNew2 = db_query($SQLnew2, "UserCVS Entry"); - if ($ErgNew1 == 1) { - echo "\t
New group was created.\n"; - } else { - echo "Error on creation\n(". mysql_error($con). ")"; - } - } else { - echo "Error on creation\n(". mysql_error($con). ")"; - } + case "delete" : + if (IsSet ($_POST["enterUID"]) && ($_POST["enterUID"] > 0)) { + echo "delate User..."; + $SQL = "DELETE FROM `User` WHERE `UID`='" . $_POST["enterUID"] . "' LIMIT 1;"; + $Erg = db_query($SQL, "User delete"); + if ($Erg == 1) { + echo "Änderung wurde gesichert...\n"; + } else { + echo "Fehler beim speichern...\n(" . mysql_error($con) . ")"; + } - } + echo "
\ndelate UserCVS..."; + $SQL2 = "DELETE FROM `UserCVS` WHERE `UID`='" . $_POST["enterUID"] . "' LIMIT 1;"; + $Erg = db_query($SQL2, "User CVS delete"); + if ($Erg == 1) { + echo "Änderung wurde gesichert...\n"; + } else { + echo "Fehler beim speichern...\n(" . mysql_error($con) . ")"; + } - - break; - } + echo "
\ndelate UserEntry..."; + $SQL3 = "UPDATE `ShiftEntry` SET `UID`='0', `Comment`=NULL " . + "WHERE `UID`='" . $_POST["enterUID"] . "';"; + $Erg = db_query($SQL3, "delate UserEntry"); + if ($Erg == 1) { + echo "Änderung wurde gesichert...\n"; + } else { + echo "Fehler beim speichern...\n(" . mysql_error($con) . ")"; + } + } + elseif (IsSet ($_POST["enterUID"]) && ($_POST["enterUID"] < 0)) { + echo "delate Group..."; + $SQL = "DELETE FROM `UserGroups` WHERE `UID`='" . $_POST["enterUID"] . "' LIMIT 1;"; + $Erg = db_query($SQL, "Group delete"); + if ($Erg == 1) { + echo "Änderung wurde gesichert...\n"; + } else { + echo "Fehler beim speichern...\n(" . mysql_error($con) . ")"; + } + + echo "
\ndelate UserCVS..."; + $SQL2 = "DELETE FROM `UserCVS` WHERE `UID`='" . $_POST["enterUID"] . "' LIMIT 1;"; + $Erg = db_query($SQL2, "User CVS delete"); + if ($Erg == 1) { + echo "Änderung wurde gesichert...\n"; + } else { + echo "Fehler beim speichern...\n(" . mysql_error($con) . ")"; + } + + } + break; + } // end switch + + // ende - Action ist gesetzt +} +elseif (IsSet ($_GET["new"]) && ($_SESSION['CVS']["admin/group.php"] == "Y")) { + echo "Gesendeter Befehl: " . $_GET["new"] . "
"; + + switch ($_GET["new"]) { + case "newGroup" : + echo "\tGenerate new Group ID...\n"; + $SQLid = "SELECT MIN(`UID`) FROM `UserCVS`;"; + $Erg = mysql_query($SQLid); + + if (mysql_num_rows($Erg) == 1) { + $NewId = mysql_result($Erg, 0, 0) - 1; + $SQLnew1 = "INSERT INTO `UserGroups` (`UID`, `Name`) VALUES ('$NewId', '" . $_POST["GroupName"] . "' );"; + $SQLnew2 = "INSERT INTO `UserCVS` (`UID`, `GroupID`) VALUES ('$NewId', NULL );"; + echo "\t
Generate new UserGroup ...\n"; + $ErgNew1 = db_query($SQLnew1, "create UserGroups Entry"); + if ($ErgNew1 == 1) { + echo "\t
Generate new User rights...\n"; + $ErgNew2 = db_query($SQLnew2, "UserCVS Entry"); + if ($ErgNew1 == 1) { + echo "\t
New group was created.\n"; + } else { + echo "Error on creation\n(" . mysql_error($con) . ")"; + } + } else { + echo "Error on creation\n(" . mysql_error($con) . ")"; + } + + } + + break; + } } else { - // kein Action gesetzt -> abbruch - echo "Unzulässiger Aufruf.
Bitte neu editieren..."; + // kein Action gesetzt -> abbruch + echo "Unzulässiger Aufruf.
Bitte neu editieren..."; } -include ("../../../camp2011/includes/footer.php"); +include ("includes/footer.php"); ?>