sp; $fieldLengths, $values, $mode)
{
$result = "";
$result .= "<FORM METHOD="post"><TABLE BORDER><TR>" .
"<TD BGCOLOR="#CCCCFF">";
$result .= "<TABLE CELLSPACING="0" CELLPADDING="0">";
$fieldIndex = 0;
while ($fieldIndex < $fieldsNumber)
{
$result .= "<TR><TD>" . $fieldNames [$fieldIndex] . "</TD><TD>";
if ($fieldLengths [$fieldIndex] <= 128)
{
$result .= "<INPUT TYPE="text" NAME="" .
$fieldNames [$fieldIndex] . "" VALUE="" .
$values [$fieldIndex] . "" SIZE="64">";
}
else
{
$result .= "<TEXTAREA NAME="" .
$fieldNames [$fieldIndex] . """ .
" COLS="64" ROWS="10" WRAP="virtual">" .
escapeforhtml ($values [$fieldIndex]) . "</TEXTAREA>";
}
$result .= "<INPUT TYPE="hidden" NAME="old-" .
$fieldNames [$fieldIndex] .
"" VALUE="" . escapeforhtml ($values [$fieldIndex]) . "">" .
"</TD></TR>";
$fieldIndex++;
}
$result .= "<TR><TD ALIGN="center" COLSPAN="2">";
if ($mode == "modify")
{
$result .= "<INPUT TYPE="submit" NAME="remove" VALUE="Remove">";
$result .= "<INPUT TYPE="submit" NAME="update" VALUE="Update">";
}
else
{ $result .= "<INPUT TYPE="submit" NAME="add" VALUE="Add">"; }
$result .= "</TABLE></TD></TR></TABLE></FORM>";
return $result;
}
function fieldFromType ($text, $type)
{
if ($type == "int" || $type == "uint" || $type == "real")
{ $result = $text; }
else
{ $result = "'" . AddSlashes ($text) . "'"; }
return $result;
}
function executeMsql ($database, $command)
{
/*echo "<TT>" . $command . "</TT><HR>";*/
msql ($database, $command);
}
function handleRemove ($database, $table, $fieldsNumber,
$fieldNames, $fieldLengths, $fieldTypes)
{
global $remove;
if ($remove != "")
{
$command = "DELETE FROM " . $table . " WHERE ";
$fieldIndex = 0;
while ($fieldIndex < $fieldsNumber)
{
$fieldName = "old-" . $fieldNames [$fieldIndex];
&nbs
{
$result = "";
$result .= "<FORM METHOD="post"><TABLE BORDER><TR>" .
"<TD BGCOLOR="#CCCCFF">";
$result .= "<TABLE CELLSPACING="0" CELLPADDING="0">";
$fieldIndex = 0;
while ($fieldIndex < $fieldsNumber)
{
$result .= "<TR><TD>" . $fieldNames [$fieldIndex] . "</TD><TD>";
if ($fieldLengths [$fieldIndex] <= 128)
{
$result .= "<INPUT TYPE="text" NAME="" .
$fieldNames [$fieldIndex] . "" VALUE="" .
$values [$fieldIndex] . "" SIZE="64">";
}
else
{
$result .= "<TEXTAREA NAME="" .
$fieldNames [$fieldIndex] . """ .
" COLS="64" ROWS="10" WRAP="virtual">" .
escapeforhtml ($values [$fieldIndex]) . "</TEXTAREA>";
}
$result .= "<INPUT TYPE="hidden" NAME="old-" .
$fieldNames [$fieldIndex] .
"" VALUE="" . escapeforhtml ($values [$fieldIndex]) . "">" .
"</TD></TR>";
$fieldIndex++;
}
$result .= "<TR><TD ALIGN="center" COLSPAN="2">";
if ($mode == "modify")
{
$result .= "<INPUT TYPE="submit" NAME="remove" VALUE="Remove">";
$result .= "<INPUT TYPE="submit" NAME="update" VALUE="Update">";
}
else
{ $result .= "<INPUT TYPE="submit" NAME="add" VALUE="Add">"; }
$result .= "</TABLE></TD></TR></TABLE></FORM>";
return $result;
}
function fieldFromType ($text, $type)
{
if ($type == "int" || $type == "uint" || $type == "real")
{ $result = $text; }
else
{ $result = "'" . AddSlashes ($text) . "'"; }
return $result;
}
function executeMsql ($database, $command)
{
/*echo "<TT>" . $command . "</TT><HR>";*/
msql ($database, $command);
}
function handleRemove ($database, $table, $fieldsNumber,
$fieldNames, $fieldLengths, $fieldTypes)
{
global $remove;
if ($remove != "")
{
$command = "DELETE FROM " . $table . " WHERE ";
$fieldIndex = 0;
while ($fieldIndex < $fieldsNumber)
{
$fieldName = "old-" . $fieldNames [$fieldIndex];
&nbs