|
|
@ -7,15 +7,16 @@ include ("./inc/funktion_user.php");
|
|
|
|
function runSQL( $SQL)
|
|
|
|
function runSQL( $SQL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
include( "./inc/db.php");
|
|
|
|
include( "./inc/db.php");
|
|
|
|
echo $SQL;
|
|
|
|
|
|
|
|
// hier muesste das SQL ausgefuehrt werden...
|
|
|
|
// hier muesste das SQL ausgefuehrt werden...
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
if ($Erg == 1) {
|
|
|
|
if ($Erg == 1) {
|
|
|
|
echo "Änderung wurde gesichert...<br>";
|
|
|
|
echo "Änderung wurde gesichert...<br>";
|
|
|
|
|
|
|
|
echo "[$SQL]<br>";
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
echo "Fehler beim speichern... bitte noch ein mal probieren :)";
|
|
|
|
echo "Fehler beim speichern... bitte noch ein mal probieren :)";
|
|
|
|
echo "<br><br>".mysql_error( $con ). "<br>";
|
|
|
|
echo "<br><br>".mysql_error( $con ). "<br>";
|
|
|
|
|
|
|
|
echo "[$SQL]<br>";
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -24,7 +25,7 @@ function runSQL( $SQL)
|
|
|
|
$Sql = "SELECT * FROM `EngelType`";
|
|
|
|
$Sql = "SELECT * FROM `EngelType`";
|
|
|
|
$Erg = mysql_query($Sql, $con);
|
|
|
|
$Erg = mysql_query($Sql, $con);
|
|
|
|
|
|
|
|
|
|
|
|
if( !IsSet($action) )
|
|
|
|
if( !IsSet($_GET["action"]) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
echo "Hallo ".$_SESSION['Nick'].
|
|
|
|
echo "Hallo ".$_SESSION['Nick'].
|
|
|
|
",<br>\nhier hast du die Möglichkeit, neue Engeltypen für die Schichtpläne einzutragen ".
|
|
|
|
",<br>\nhier hast du die Möglichkeit, neue Engeltypen für die Schichtpläne einzutragen ".
|
|
|
@ -57,11 +58,11 @@ if( !IsSet($action) )
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
switch ($action) {
|
|
|
|
switch ($_GET["action"]) {
|
|
|
|
|
|
|
|
|
|
|
|
case 'new':
|
|
|
|
case 'new':
|
|
|
|
echo "Neuen EngelType einrichten: <br>";
|
|
|
|
echo "Neuen EngelType einrichten: <br>";
|
|
|
|
echo "<form action=\"./EngelType.php\" method=\"POST\">\n";
|
|
|
|
echo "<form action=\"./EngelType.php\" method=\"GET\">\n";
|
|
|
|
echo "<table>\n";
|
|
|
|
echo "<table>\n";
|
|
|
|
|
|
|
|
|
|
|
|
for( $Uj = 1; $Uj < mysql_num_fields($Erg); $Uj++ )
|
|
|
|
for( $Uj = 1; $Uj < mysql_num_fields($Erg); $Uj++ )
|
|
|
@ -76,9 +77,11 @@ case 'new':
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 'newsave':
|
|
|
|
case 'newsave':
|
|
|
|
$vars = $HTTP_POST_VARS;
|
|
|
|
$vars = $HTTP_GET_VARS;
|
|
|
|
$count = count($vars) - 1;
|
|
|
|
$count = count($vars) - 1;
|
|
|
|
$vars = array_splice($vars, 0, $count);
|
|
|
|
$vars = array_splice($vars, 0, $count);
|
|
|
|
|
|
|
|
$Keys="";
|
|
|
|
|
|
|
|
$Values="";
|
|
|
|
foreach($vars as $key => $value){
|
|
|
|
foreach($vars as $key => $value){
|
|
|
|
$Keys .= ", `$key`";
|
|
|
|
$Keys .= ", `$key`";
|
|
|
|
$Values .= ", '$value'";
|
|
|
|
$Values .= ", '$value'";
|
|
|
@ -88,7 +91,7 @@ case 'newsave':
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
|
|
|
|
|
|
|
|
$SQL2 = "SELECT * FROM `EngelType` WHERE `Name`='". $_POST["Name"]. "'";
|
|
|
|
$SQL2 = "SELECT * FROM `EngelType` WHERE `Name`='". $_GET["Name"]. "'";
|
|
|
|
$ERG = mysql_query($SQL2, $con);
|
|
|
|
$ERG = mysql_query($SQL2, $con);
|
|
|
|
|
|
|
|
|
|
|
|
if( mysql_num_rows($ERG) == 1)
|
|
|
|
if( mysql_num_rows($ERG) == 1)
|
|
|
@ -99,7 +102,7 @@ case 'newsave':
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 'change':
|
|
|
|
case 'change':
|
|
|
|
if (! IsSet($TID)) {
|
|
|
|
if (! IsSet($_GET["TID"])) {
|
|
|
|
echo "Fehlerhafter Aufruf!";
|
|
|
|
echo "Fehlerhafter Aufruf!";
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
@ -107,25 +110,25 @@ case 'change':
|
|
|
|
|
|
|
|
|
|
|
|
echo "Hier kannst du eintragen, den EngelType ändern.";
|
|
|
|
echo "Hier kannst du eintragen, den EngelType ändern.";
|
|
|
|
|
|
|
|
|
|
|
|
echo "<form action=\"./EngelType.php\" method=\"POST\">\n";
|
|
|
|
echo "<form action=\"./EngelType.php\" method=\"GET\">\n";
|
|
|
|
echo "<table>\n";
|
|
|
|
echo "<table>\n";
|
|
|
|
|
|
|
|
|
|
|
|
$SQL2 = "SELECT * FROM `EngelType` WHERE `TID`='$TID'";
|
|
|
|
$SQL2 = "SELECT * FROM `EngelType` WHERE `TID`='". $_GET["TID"]. "'";
|
|
|
|
$ERG = mysql_query($SQL2, $con);
|
|
|
|
$ERG = mysql_query($SQL2, $con);
|
|
|
|
|
|
|
|
|
|
|
|
for ($Uj = 1; $Uj < mysql_num_fields($ERG); $Uj++)
|
|
|
|
for ($Uj = 1; $Uj < mysql_num_fields($ERG); $Uj++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
echo "<tr><td>".mysql_field_name($ERG, $Uj)."</td>".
|
|
|
|
echo "<tr><td>". mysql_field_name($ERG, $Uj). "</td>".
|
|
|
|
"<td><input type=\"text\" size=\"40\" name=\"e".mysql_field_name($ERG, $Uj)."\" ".
|
|
|
|
"<td><input type=\"text\" size=\"40\" name=\"e". mysql_field_name($ERG, $Uj). "\" ".
|
|
|
|
"value=\"".mysql_result($ERG, 0, $Uj)."\"></td></tr>\n";
|
|
|
|
"value=\"". mysql_result($ERG, 0, $Uj). "\"></td></tr>\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "</table>\n";
|
|
|
|
echo "</table>\n";
|
|
|
|
echo "<input type=\"hidden\" name=\"eTID\" value=\"$TID\">\n";
|
|
|
|
echo "<input type=\"hidden\" name=\"eTID\" value=\"". $_GET["TID"]. "\">\n";
|
|
|
|
echo "<input type=\"hidden\" name=\"action\" value=\"changesave\">\n";
|
|
|
|
echo "<input type=\"hidden\" name=\"action\" value=\"changesave\">\n";
|
|
|
|
echo "<input type=\"submit\" value=\"sichern...\">\n";
|
|
|
|
echo "<input type=\"submit\" value=\"sichern...\">\n";
|
|
|
|
echo "</form>";
|
|
|
|
echo "</form>";
|
|
|
|
echo "<form action=\"./EngelType.php\" method=\"POST\">\n";
|
|
|
|
echo "<form action=\"./EngelType.php\" method=\"GET\">\n";
|
|
|
|
echo "<input type=\"hidden\" name=\"TID\" value=\"$TID\">\n";
|
|
|
|
echo "<input type=\"hidden\" name=\"TID\" value=\"". $_GET["TID"]. "\">\n";
|
|
|
|
echo "<input type=\"hidden\" name=\"action\" value=\"delete\">\n";
|
|
|
|
echo "<input type=\"hidden\" name=\"action\" value=\"delete\">\n";
|
|
|
|
echo "<input type=\"submit\" value=\"Löschen...\">";
|
|
|
|
echo "<input type=\"submit\" value=\"Löschen...\">";
|
|
|
|
echo "</form>";
|
|
|
|
echo "</form>";
|
|
|
@ -133,32 +136,31 @@ case 'change':
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 'changesave':
|
|
|
|
case 'changesave':
|
|
|
|
$vars = $HTTP_POST_VARS;
|
|
|
|
$vars = $HTTP_GET_VARS;
|
|
|
|
$count = count($vars) - 2;
|
|
|
|
$count = count($vars) - 2;
|
|
|
|
$vars = array_splice($vars, 0, $count);
|
|
|
|
$vars = array_splice($vars, 0, $count);
|
|
|
|
|
|
|
|
$keys="";
|
|
|
|
|
|
|
|
$sql="";
|
|
|
|
foreach($vars as $key => $value){
|
|
|
|
foreach($vars as $key => $value){
|
|
|
|
$keys = substr($key,1);
|
|
|
|
$keys = substr($key,1);
|
|
|
|
$sql .= ", `".$keys."`='".$value."'";
|
|
|
|
$sql .= ", `".$keys."`='".$value."'";
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
runSQL( "UPDATE `EngelType` SET ". substr($sql, 2). " WHERE `TID`='".$eTID."'");
|
|
|
|
runSQL( "UPDATE `EngelType` SET ". substr($sql, 2). " WHERE `TID`='". $_GET["eTID"]. "'");
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 'delete':
|
|
|
|
case 'delete':
|
|
|
|
if (IsSet($TID))
|
|
|
|
if (IsSet($_GET["TID"]))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
runSQL( "DELETE FROM `EngelType` WHERE `TID`='$TID'");
|
|
|
|
runSQL( "DELETE FROM `EngelType` WHERE `TID`='". $_GET["TID"]. "'");
|
|
|
|
runSQL( "ALTER TABLE `Room` DROP `DEFAULT_EID_$TID`;");
|
|
|
|
runSQL( "ALTER TABLE `Room` DROP `DEFAULT_EID_". $_GET["TID"]. "`;");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
echo "Fehlerhafter Aufruf";
|
|
|
|
echo "Fehlerhafter Aufruf";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include ("./inc/footer.php");
|
|
|
|
include ("./inc/footer.php");
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|