\n";
$html .= Get_Text("pub_sprache_text1") . "
\n";
$html .= "" . Get_Text("pub_sprache_ShowEntry") . "";
// ausgabe Tabellenueberschift
$SQL_Sprachen = "SELECT `Sprache` FROM `Sprache` GROUP BY `Sprache`;";
$erg_Sprachen = sql_query($SQL_Sprachen);
for ($i = 0; $i < mysql_num_rows($erg_Sprachen); $i++)
$Sprachen[mysql_result($erg_Sprachen, $i, "Sprache")] = $i;
$html .= "\t
\n";
} /*if( !isset( $TextID ) )*/
else {
$html .= "edit: " . $_POST["TextID"] . "
";
foreach ($_POST as $k => $v) {
if ($k != "TextID") {
$sql_test = "SELECT * FROM `Sprache` " .
"WHERE `TextID`='" . sql_escape($_POST["TextID"])
. "' AND `Sprache`='"
. sql_escape($k) . "'";
$erg_test = sql_query($sql_test);
if (mysql_num_rows($erg_test) == 0) {
$sql_save = "INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) " .
"VALUES ('" . sql_escape($_POST["TextID"]) . "', '"
. sql_escape($k) . "', '"
. sql_escape($v) . "')";
$html .= $sql_save . "
";
$Erg = sql_query($sql_save);
$html .= success("$k Save: OK
\n", true);
} else
if (mysql_result($erg_test, 0, "Text") != $v) {
$sql_save = "UPDATE `Sprache` SET `Text`='"
. sql_escape($v) . "' " .
"WHERE `TextID`='"
. sql_escape($_POST["TextID"])
. "' AND `Sprache`='" . sql_escape($k) . "' ";
$html .= $sql_save . "
";
$Erg = sql_query($sql_save);
$html .= success(" $k Update: OK
\n", true);
} else
$html .= "\t $k no changes
\n";
}
}
}
return $html;
}
?>