2005-09-10 19:25:43 +02:00
|
|
|
<?PHP
|
|
|
|
|
|
|
|
$title = "Sprache";
|
|
|
|
$header = "Liste der existierenden Sprcheinträge";
|
2011-05-26 00:52:57 +02:00
|
|
|
include ("../../../camp2011/includes/header.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
2005-11-06 18:07:07 +01:00
|
|
|
if( !isset( $_GET["TextID"] ) )
|
2005-09-10 19:25:43 +02:00
|
|
|
{
|
|
|
|
echo Get_Text("Hello").$_SESSION['Nick'].", <br>\n";
|
|
|
|
echo Get_Text("pub_sprache_text1")."<br><br>\n";
|
2005-12-06 19:53:58 +01:00
|
|
|
|
|
|
|
echo "<a href=\"?ShowEntry=y\">". Get_Text("pub_sprache_ShowEntry"). "</a>";
|
2005-09-10 19:25:43 +02:00
|
|
|
// 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<mysql_num_rows( $erg_Sprachen ); $i++ )
|
|
|
|
$Sprachen[mysql_result( $erg_Sprachen, $i, "Sprache" )] = $i;
|
|
|
|
|
|
|
|
echo "\t<table border=\"0\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n\t\t<tr>";
|
|
|
|
echo "\t\t<td class=\"contenttopic\"><b>". Get_Text("pub_sprache_TextID"). "</b></td>";
|
|
|
|
foreach( $Sprachen as $Name => $Value )
|
|
|
|
echo "<td class=\"contenttopic\"><b>".
|
|
|
|
Get_Text("pub_sprache_Sprache"). " ". $Name.
|
|
|
|
"</b></td>";
|
|
|
|
echo "\t\t<td class=\"contenttopic\"><b>". Get_Text("pub_sprache_Edit"). "</b></td>";
|
|
|
|
echo "\t\t</tr>";
|
|
|
|
|
|
|
|
|
2005-12-06 19:53:58 +01:00
|
|
|
if( isset($_GET["ShowEntry"]))
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
// 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 "<form action=\"sprache.php\">";
|
|
|
|
echo "<tr class=\"content\">\n";
|
|
|
|
echo "\t\t<td>$TextID_Old ".
|
|
|
|
"<input name=\"TextID\" type=\"hidden\" value=\"$TextID_Old\"> </td>\n";
|
|
|
|
|
|
|
|
foreach( $Sprachen as $Name => $Value )
|
|
|
|
{
|
2005-11-21 00:57:20 +01:00
|
|
|
$Value = html_entity_decode( $Value, ENT_QUOTES);
|
2005-09-10 19:25:43 +02:00
|
|
|
echo "\t\t<td><textarea name=\"$Name\" cols=\"22\" rows=\"8\">$Value</textarea></td>\n";
|
|
|
|
$Sprachen[ $Name ] = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "\t\t<td><input type=\"submit\" value=\"Save\"></td>\n";
|
|
|
|
echo "</tr>";
|
|
|
|
echo "</form>\n";
|
|
|
|
$TextID_Old = $TextID_New;
|
|
|
|
}
|
|
|
|
$Sprachen[ mysql_result( $erg, $i, "Sprache" ) ] = mysql_result( $erg, $i, "Text" );
|
|
|
|
} /*FOR*/
|
2005-12-06 19:53:58 +01:00
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
//fuer neu eintraege
|
|
|
|
echo "<form action=\"sprache.php\">";
|
|
|
|
echo "<tr class=\"content\">\n";
|
2006-11-20 21:05:30 +01:00
|
|
|
echo "\t\t<td><input name=\"TextID\" type=\"text\" size=\"40\" value=\"new\"> </td>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
foreach( $Sprachen as $Name => $Value )
|
|
|
|
echo "\t\t<td><textarea name=\"$Name\" cols=\"22\" rows=\"8\">$Name Text</textarea></td>\n";
|
|
|
|
|
|
|
|
echo "\t\t<td><input type=\"submit\" value=\"Save\"></td>\n";
|
|
|
|
echo "</tr>";
|
|
|
|
echo "</form>\n";
|
|
|
|
|
|
|
|
|
|
|
|
echo "</table>\n";
|
|
|
|
} /*if( !isset( $TextID ) )*/
|
|
|
|
else
|
|
|
|
{
|
2005-11-06 18:07:07 +01:00
|
|
|
echo "edit: ". $_GET["TextID"]. "<br><br>";
|
2005-09-10 19:25:43 +02:00
|
|
|
foreach ($_GET as $k => $v) {
|
|
|
|
if( $k != "TextID" )
|
|
|
|
{
|
|
|
|
$sql_test = "SELECT * FROM `Sprache` ".
|
2005-11-06 18:07:07 +01:00
|
|
|
"WHERE `TextID`='". $_GET["TextID"]. "' AND `Sprache`='$k'";
|
2005-09-10 19:25:43 +02:00
|
|
|
$erg_test = mysql_query($sql_test, $con);
|
|
|
|
|
|
|
|
if( mysql_num_rows($erg_test)==0 )
|
|
|
|
{
|
|
|
|
$sql_save = "INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) ".
|
2005-11-06 18:07:07 +01:00
|
|
|
"VALUES ('". $_GET["TextID"]. "', '$k', '$v')";
|
2005-11-21 00:57:20 +01:00
|
|
|
echo $sql_save."<br>";
|
2005-09-10 19:25:43 +02:00
|
|
|
$Erg = mysql_query($sql_save, $con);
|
|
|
|
if ($Erg == 1)
|
|
|
|
echo "\t $k Save: OK<br>\n";
|
|
|
|
else
|
|
|
|
echo "\t $k Save: KO<br>\n";
|
|
|
|
}
|
|
|
|
else if( mysql_result($erg_test, 0, "Text")!=$v )
|
|
|
|
{
|
|
|
|
$sql_save = "UPDATE `Sprache` SET `Text`='$v' ".
|
2005-11-06 18:07:07 +01:00
|
|
|
"WHERE `TextID`='". $_GET["TextID"]. "' AND `Sprache`='$k' ";
|
2005-09-10 19:25:43 +02:00
|
|
|
echo $sql_save."<br>";
|
|
|
|
$Erg = mysql_query($sql_save, $con);
|
|
|
|
if ($Erg == 1)
|
|
|
|
echo "\t $k Update: OK<br>\n";
|
|
|
|
else
|
|
|
|
echo "\t $k Update: KO<br>\n";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
echo "\t $k no changes<br>\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2011-05-26 00:52:57 +02:00
|
|
|
include ("../../../camp2011/includes/footer.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
?>
|
|
|
|
|