-* Lots more printVal()ing needs to be done. Whenever displaying user data,
- it should use $misc->printVal($var) instead of htmlspecialchars($var).
* Fix grant option/grantor stuff
* Schema support for privileges
* First and last links in browse table
* @param $return_desc The return link name
* @param $page The current page
*
- * $Id: display.php,v 1.19 2003/05/21 02:07:42 chriskl Exp $
+ * $Id: display.php,v 1.20 2003/05/31 07:23:24 chriskl Exp $
*/
// Include application functions
$misc->printHeader($lang['strqueryresults']);
$misc->printBody();
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strqueryresults']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strqueryresults']}</h2>\n";
// If current page is not set, default to first page
if (!isset($_REQUEST['page'])) $_REQUEST['page'] = 1;
/**
* Manage functions in a database
*
- * $Id: functions.php,v 1.15 2003/05/17 15:53:56 chriskl Exp $
+ * $Id: functions.php,v 1.16 2003/05/31 07:23:24 chriskl Exp $
*/
// Include application functions
global $data, $localData, $misc;
global $PHP_SELF, $lang;
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strfunctions']}: ", htmlspecialchars($_REQUEST['function']), ": {$lang['stredit']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strfunctions']}: ", $misc->printVal($_REQUEST['function']), ": {$lang['stredit']}</h2>\n";
$misc->printMsg($msg);
$fndata = &$localData->getFunction($_REQUEST['function_oid']);
echo "<tr>\n";
- echo "<td class=\"data1\">", htmlspecialchars($fndata->f[$data->fnFields['fnname']]), "\n";
+ echo "<td class=\"data1\">", $misc->printVal($fndata->f[$data->fnFields['fnname']]), "\n";
echo "<input type=\"hidden\" name=\"original_function\" value=\"", htmlspecialchars($fndata->f[$data->fnFields['fnname']]),"\" />\n";
echo "</td>\n";
- echo "<td class=\"data1\">", htmlspecialchars($fndata->f[$data->fnFields['fnarguments']]), "\n";
+ echo "<td class=\"data1\">", $misc->printVal($fndata->f[$data->fnFields['fnarguments']]), "\n";
echo "<input type=\"hidden\" name=\"original_arguments\" value=\"",htmlspecialchars($fndata->f[$data->fnFields['fnarguments']]),"\" />\n";
echo "</td>\n";
echo "<td class=data1>";
if ($fndata->f[$data->fnFields['setof']]) echo "setof ";
- echo htmlspecialchars($fndata->f[$data->fnFields['fnreturns']]), "\n";
+ echo $misc->printVal($fndata->f[$data->fnFields['fnreturns']]), "\n";
echo "<input type=\"hidden\" name=\"original_returns\" value=\"", htmlspecialchars($fndata->f[$data->fnFields['fnreturns']]), "\" />\n";
if ($fndata->f[$data->fnFields['setof']])
echo "<input type=\"hidden\" name=\"original_setof\" value=\"yes\" />\n";
echo "</td>\n";
- echo "<td class=data1>", htmlspecialchars($fndata->f[$data->fnFields['fnlang']]), "\n";
+ echo "<td class=data1>", $misc->printVal($fndata->f[$data->fnFields['fnlang']]), "\n";
echo "<input type=\"hidden\" name=\"original_lang\" value=\"", htmlspecialchars($fndata->f[$data->fnFields['fnlang']]), "\" />\n";
echo "</td>\n";
foreach ($v as $p) {
echo "<option value=\"", htmlspecialchars($p), "\"",
($p == $_POST['formProperties'][$i]) ? ' selected' : '',
- ">", htmlspecialchars($p), "</option>\n";
+ ">", $misc->printVal($p), "</option>\n";
}
echo "</select><br />\n";
$i++;
global $data, $localData, $misc;
global $PHP_SELF, $lang;
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strfunctions']}: ", htmlspecialchars($_REQUEST['function']), ": {$lang['strproperties']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strfunctions']}: ", $misc->printVal($_REQUEST['function']), ": {$lang['strproperties']}</h2>\n";
$misc->printMsg($msg);
$funcdata = &$localData->getFunction($_REQUEST['function_oid']);
echo "<th class=\"data\">{$lang['strarguments']}</th>\n";
echo "<th class=\"data\">{$lang['strreturns']}</th>\n";
echo "<th class=\"data\">{$lang['strlanguage']}</th></tr>\n";
- echo "<tr><td class=\"data1\">", htmlspecialchars($funcdata->f[$data->fnFields['fnname']]), "</td>\n";
- echo "<td class=\"data1\">", htmlspecialchars($funcdata->f[$data->fnFields['fnarguments']]), "</td>\n";
+ echo "<tr><td class=\"data1\">", $misc->printVal($funcdata->f[$data->fnFields['fnname']]), "</td>\n";
+ echo "<td class=\"data1\">", $misc->printVal($funcdata->f[$data->fnFields['fnarguments']]), "</td>\n";
echo "<td class=\"data1\">";
if ($funcdata->f[$data->fnFields['setof']]) echo "setof ";
- echo htmlspecialchars($funcdata->f[$data->fnFields['fnreturns']]), "</td>\n";
- echo "<td class=\"data1\">", htmlspecialchars($funcdata->f[$data->fnFields['fnlang']]), "</td></tr>\n";
+ echo $misc->printVal($funcdata->f[$data->fnFields['fnreturns']]), "</td>\n";
+ echo "<td class=\"data1\">", $misc->printVal($funcdata->f[$data->fnFields['fnlang']]), "</td></tr>\n";
echo "<tr><th class=\"data\" colspan=\"4\">{$lang['strdefinition']}</th></tr>\n";
echo "<tr><td class=\"data1\" colspan=\"4\">", $misc->printVal($funcdata->f[$data->fnFields['fndef']]), "</td></tr>\n";
if (is_array($data->funcprops) && sizeof($data->funcprops) > 0) {
echo "<tr><th class=\"data\" colspan=\"4\">{$lang['strproperties']}</th></tr>\n";
echo "<tr><td class=\"data1\" colspan=\"4\">\n";
foreach ($funcprops as $v) {
- echo htmlspecialchars($v), "<br />\n";
+ echo $misc->printVal($v), "<br />\n";
}
echo "</td></tr>\n";
}
global $PHP_SELF, $lang;
if ($confirm) {
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strfunctions']}: ", htmlspecialchars($_REQUEST['function']), ": {$lang['strdrop']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strfunctions']}: ", $misc->printVal($_REQUEST['function']), ": {$lang['strdrop']}</h2>\n";
- echo "<p>", sprintf($lang['strconfdropfunction'], htmlspecialchars($_REQUEST['function'])), "</p>\n";
+ echo "<p>", sprintf($lang['strconfdropfunction'], $misc->printVal($_REQUEST['function'])), "</p>\n";
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"drop\">\n";
$types = &$localData->getTypes(true);
$langs = &$localData->getLanguages();
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strfunctions']}: {$lang['strcreatefunction']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strfunctions']}: {$lang['strcreatefunction']}</h2>\n";
$misc->printMsg($msg);
echo "<form action=\"$PHP_SELF\" method=post>\n";
while (!$types->EOF) {
echo "<option value=\"", htmlspecialchars($types->f[$data->typFields['typname']]), "\"",
($types->f[$data->typFields['typname']] == $_POST['formReturns']) ? ' selected' : '', ">",
- htmlspecialchars($types->f[$data->typFields['typname']]), "</option>\n";
+ $misc->printVal($types->f[$data->typFields['typname']]), "</option>\n";
$types->moveNext();
}
echo "</select>\n";
while (!$langs->EOF) {
echo "<option value=\"", htmlspecialchars($langs->f[$data->langFields['lanname']]), "\"",
($langs->f[$data->langFields['lanname']] == $_POST['formLanguage']) ? ' selected' : '', ">",
- htmlspecialchars($langs->f[$data->langFields['lanname']]), "</option>\n";
+ $misc->printVal($langs->f[$data->langFields['lanname']]), "</option>\n";
$langs->moveNext();
}
echo "</select>\n";
foreach ($v as $p) {
echo "<option value=\"", htmlspecialchars($p), "\"",
($p == $_POST['formProperties'][$i]) ? ' selected' : '',
- ">", htmlspecialchars($p), "</option>\n";
+ ">", $misc->printVal($p), "</option>\n";
}
echo "</select><br />\n";
$i++;
global $data, $localData, $misc, $func;
global $PHP_SELF, $lang;
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strfunctions']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strfunctions']}</h2>\n";
$misc->printMsg($msg);
$funcs = &$localData->getFunctions();
$funcs->f[$data->fnFields['setof']] = $data->phpBool($funcs->f[$data->fnFields['setof']]);
$func_full = $funcs->f[$data->fnFields['fnname']] . "(". $funcs->f[$data->fnFields['fnarguments']] .")";
$id = (($i % 2) == 0 ? '1' : '2');
- echo "<tr><td class=\"data{$id}\">", htmlspecialchars($funcs->f[$data->fnFields['fnname']]), "</td>\n";
+ echo "<tr><td class=\"data{$id}\">", $misc->printVal($funcs->f[$data->fnFields['fnname']]), "</td>\n";
echo "<td class=\"data{$id}\">";
if ($funcs->f[$data->fnFields['setof']]) echo "setof ";
- echo htmlspecialchars($funcs->f[$data->fnFields['fnreturns']]), "</td>\n";
- echo "<td class=\"data{$id}\">", htmlspecialchars($funcs->f[$data->fnFields['fnarguments']]), "</td>\n";
+ echo $misc->printVal($funcs->f[$data->fnFields['fnreturns']]), "</td>\n";
+ echo "<td class=\"data{$id}\">", $misc->printVal($funcs->f[$data->fnFields['fnarguments']]), "</td>\n";
echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=properties&{$misc->href}&function=",
urlencode($func_full), "&function_oid=", $funcs->f[$data->fnFields['fnoid']], "\">{$lang['strproperties']}</a></td>\n";
echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=edit&{$misc->href}&function=",
/**
* List rules on a table
*
- * $Id: rules.php,v 1.10 2003/04/30 07:02:20 chriskl Exp $
+ * $Id: rules.php,v 1.11 2003/05/31 07:23:24 chriskl Exp $
*/
// Include application functions
if (!isset($_POST['raction'])) $_POST['raction'] = '';
if ($confirm) {
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strtables']}: ",
- htmlspecialchars($_REQUEST['table']), ": {$lang['strcreaterule']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ",
+ $misc->printVal($_REQUEST['table']), ": {$lang['strcreaterule']}</h2>\n";
$misc->printMsg($msg);
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
global $PHP_SELF, $lang;
if ($confirm) {
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strtables']}: ",
- htmlspecialchars($_REQUEST['table']), ": " , htmlspecialchars($_REQUEST['rule']), ": Drop</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ",
+ $misc->printVal($_REQUEST['table']), ": " , $misc->printVal($_REQUEST['rule']), ": {$lang['strdrop']}</h2>\n";
- echo "<p>", sprintf($lang['strconfdroprule'], htmlspecialchars($_REQUEST['rule']),
- htmlspecialchars($_REQUEST['table'])), "</p>\n";
+ echo "<p>", sprintf($lang['strconfdroprule'], $misc->printVal($_REQUEST['rule']),
+ $misc->printVal($_REQUEST['table'])), "</p>\n";
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"drop\">\n";
global $lang;
$misc->printTableNav();
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": ", htmlspecialchars($_REQUEST['table']), ": {$lang['strrules']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": ", $misc->printVal($_REQUEST['table']), ": {$lang['strrules']}</h2>\n";
$misc->printMsg($msg);
$rules = &$localData->getRules($_REQUEST['table']);
while (!$rules->EOF) {
$id = ( ($i % 2 ) == 0 ? '1' : '2' );
- echo "<tr><td class=\"data{$id}\">", htmlspecialchars( $rules->f[$data->rlFields['rulename']]), "</td>";
- echo "<td class=\"data{$id}\">", htmlspecialchars( $rules->f[$data->rlFields['ruledef']]), "</td>";
+ echo "<tr><td class=\"data{$id}\">", $misc->printVal( $rules->f[$data->rlFields['rulename']]), "</td>";
+ echo "<td class=\"data{$id}\">", $misc->printVal( $rules->f[$data->rlFields['ruledef']]), "</td>";
echo "<td class=\"data{$id}\">";
echo "<a href=\"$PHP_SELF?action=confirm_drop&{$misc->href}&rule=", urlencode($rules->f[$data->rlFields['rulename']]),
"&table=", urlencode($_REQUEST['table']), "\">{$lang['strdrop']}</td></tr>\n";
* @param $return_url The return URL
* @param $return_desc The return link name
*
- * $Id: sql.php,v 1.5 2003/05/21 02:07:42 chriskl Exp $
+ * $Id: sql.php,v 1.6 2003/05/31 07:23:24 chriskl Exp $
*/
// Include application functions
$misc->printHeader($lang['strqueryresults']);
$misc->printBody();
$misc->printDatabaseNav();
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strsql']}: {$lang['strqueryresults']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strsql']}: {$lang['strqueryresults']}</h2>\n";
$_POST['query'] = trim($_POST['query']);
if ($_POST['query'] != '') {
/**
* List tables in a database
*
- * $Id: tables.php,v 1.25 2003/05/31 06:56:01 chriskl Exp $
+ * $Id: tables.php,v 1.26 2003/05/31 07:23:24 chriskl Exp $
*/
// Include application functions
switch ($_REQUEST['stage']) {
case 1:
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strtables']}: {$lang['strcreatetable']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: {$lang['strcreatetable']}</h2>\n";
$misc->printMsg($msg);
- echo "<form action=\"$PHP_SELF\" method=post>\n";
- echo "<table width=100%>\n";
- echo "<tr><th class=data>{$lang['strname']}</th></tr>\n";
- echo "<tr><td class=data1><input name=name size={$data->_maxNameLen} maxlength={$data->_maxNameLen} value=\"",
- htmlspecialchars($_REQUEST['name']), "\"></td></tr>\n";
- echo "<tr><th class=data>{$lang['strnumfields']}</th></tr>\n";
- echo "<tr><td class=data1><input name=fields size=5 maxlength={$data->_maxNameLen} value=\"",
- htmlspecialchars($_REQUEST['fields']), "\"></td></tr>\n";
+ echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
+ echo "<table width=\"100%\">\n";
+ echo "<tr><th class=\"data\">{$lang['strname']}</th></tr>\n";
+ echo "<tr><td class=\"data1\"><input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
+ htmlspecialchars($_REQUEST['name']), "\" /></td></tr>\n";
+ echo "<tr><th class=\"data\">{$lang['strnumfields']}</th></tr>\n";
+ echo "<tr><td class=\"data1\"><input name=\"fields\" size=\"5\" maxlength=\"{$data->_maxNameLen}\" value=\"",
+ htmlspecialchars($_REQUEST['fields']), "\" /></td></tr>\n";
echo "</table>\n";
- echo "<input type=hidden name=action value=create>\n";
- echo "<input type=hidden name=stage value=2>\n";
+ echo "<input type=\"hidden\" name=\"action\" value=\"create\" />\n";
+ echo "<input type=\"hidden\" name=\"stage\" value=\"2\" />\n";
echo $misc->form;
- echo "<input type=submit value=\"{$lang['strnext']}\"> <input type=reset value=\"{$lang['strreset']}\">\n";
+ echo "<input type=\"submit\" value=\"{$lang['strnext']}\" />\n";
+ echo "<input type=\"reset\" value=\"{$lang['strreset']}\" />\n";
echo "</form>\n";
break;
case 2:
$types = &$localData->getTypes(true);
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strtables']}: {$lang['strcreatetable']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: {$lang['strcreatetable']}</h2>\n";
$misc->printMsg($msg);
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
foreach ($localData->extraTypes as $v) {
echo "<option value=\"", htmlspecialchars($v), "\"",
(isset($_REQUEST['type'][$i]) && $v == $_REQUEST['type'][$i]) ? ' selected' : '', ">",
- htmlspecialchars($v), "</option>\n";
+ $misc->printVal($v), "</option>\n";
}
$types->moveFirst();
while (!$types->EOF) {
$typname = $types->f[$data->typFields['typname']];
echo "<option value=\"", htmlspecialchars($typname), "\"",
(isset($_REQUEST['type'][$i]) && $typname == $_REQUEST['type'][$i]) ? ' selected' : '', ">",
- htmlspecialchars($typname), "</option>\n";
+ $misc->printVal($typname), "</option>\n";
$types->moveNext();
}
echo "</select></td>";
- echo "<td><input name=\"length[{$i}]\" size=10 value=\"",
- htmlspecialchars($_REQUEST['length'][$i]), "\"></td>";
- echo "<td><input type=checkbox name=\"notnull[{$i}]\"", (isset($_REQUEST['notnull'][$i])) ? ' checked' : '', "></td>\n";
- echo "<td><input name=\"default[{$i}]\" size=20 value=\"",
- htmlspecialchars($_REQUEST['default'][$i]), "\"></td>";
+ echo "<td><input name=\"length[{$i}]\" size=\"10\" value=\"",
+ htmlspecialchars($_REQUEST['length'][$i]), "\" /></td>";
+ echo "<td><input type=\"checkbox\" name=\"notnull[{$i}]\"", (isset($_REQUEST['notnull'][$i])) ? ' checked' : '', " /></td>\n";
+ echo "<td><input name=\"default[{$i}]\" size=\"20\" value=\"",
+ htmlspecialchars($_REQUEST['default'][$i]), "\" /></td>";
}
echo "</table>\n";
- echo "<p><input type=hidden name=action value=create>\n";
- echo "<input type=hidden name=stage value=3>\n";
+ echo "<p><input type=\"hidden\" name=\"action\" value=\"create\" />\n";
+ echo "<input type=\"hidden\" name=\"stage\" value=\"3\" />\n";
echo $misc->form;
- echo "<input type=hidden name=name value=\"", htmlspecialchars($_REQUEST['name']), "\">\n";
- echo "<input type=hidden name=fields value=\"", htmlspecialchars($_REQUEST['fields']), "\">\n";
- echo "<input type=submit value=\"{$lang['strcreate']}\"> <input type=reset value=\"{$lang['strreset']}\"></p>\n";
+ echo "<input type=\"hidden\" name=\"name\" value=\"", htmlspecialchars($_REQUEST['name']), "\" />\n";
+ echo "<input type=\"hidden\" name=\"fields\" value=\"", htmlspecialchars($_REQUEST['fields']), "\" />\n";
+ echo "<input type=\"submit\" value=\"{$lang['strcreate']}\" />\n";
+ echo "<input type=\"reset\" value=\"{$lang['strreset']}\" /></p>\n";
echo "</form>\n";
break;
echo "<p>{$lang['strinvalidparam']}</p>\n";
}
- echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">{$lang['strshowalltables']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"$PHP_SELF?{$misc->href}\">{$lang['strshowalltables']}</a></p>\n";
}
/**
global $PHP_SELF;
if ($confirm) {
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strtables']}: ", htmlspecialchars($_REQUEST['table']), ": {$lang['strselect']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ", $misc->printVal($_REQUEST['table']), ": {$lang['strselect']}</h2>\n";
$misc->printMsg($msg);
$attrs = &$localData->getTableAttributes($_REQUEST['table']);
echo "<table>\n<tr>";
// Output table header
- echo "<tr><th class=data>{$lang['strshow']}</th><th class=data>{$lang['strfield']}</th><th class=data>{$lang['strtype']}</th><th class=data>{$lang['strnull']}</th><th class=data>{$lang['strvalue']}</th></tr>";
+ echo "<tr><th class=\"data\">{$lang['strshow']}</th><th class=\"data\">{$lang['strfield']}</th>";
+ echo "<th class=\"data\">{$lang['strtype']}</th><th class=\"data\">{$lang['strnull']}</th>";
+ echo "<th class=\"data\">{$lang['strvalue']}</th></tr>";
$i = 0;
while (!$attrs->EOF) {
// Continue drawing row
$id = (($i % 2) == 0 ? '1' : '2');
echo "<tr>\n";
- echo "<td class=data{$id} nowrap>";
+ echo "<td class=\"data{$id}\" nowrap=\"nowrap\">";
echo "<input type=\"checkbox\" name=\"show[", htmlspecialchars($attrs->f['attname']), "]\"",
- isset($_REQUEST['show'][$attrs->f['attname']]) ? ' checked' : '', "></td>";
- echo "<td class=data{$id} nowrap>", htmlspecialchars($attrs->f['attname']), "</td>";
- echo "<td class=data{$id} nowrap>", htmlspecialchars($attrs->f['type']), "</td>";
- echo "<td class=data{$id} nowrap>";
+ isset($_REQUEST['show'][$attrs->f['attname']]) ? ' checked' : '', " /></td>";
+ echo "<td class=\"data{$id}\" nowrap=\"nowrap\">", $misc->printVal($attrs->f['attname']), "</td>";
+ echo "<td class=\"data{$id}\" nowrap=\"nowrap\">", $misc->printVal($attrs->f['type']), "</td>";
+ echo "<td class=\"data{$id}\" nowrap=\"nowrap\">";
// Output null box if the column allows nulls (doesn't look at CHECKs or ASSERTIONS)
if (!$attrs->f['attnotnull'])
- echo "<input type=checkbox name=\"nulls[{$attrs->f['attname']}]\"",
- isset($_REQUEST['nulls'][$attrs->f['attname']]) ? ' checked' : '', "></td>";
+ echo "<input type=\"checkbox\" name=\"nulls[{$attrs->f['attname']}]\"",
+ isset($_REQUEST['nulls'][$attrs->f['attname']]) ? ' checked' : '', " /></td>";
else
echo " </td>";
- echo "<td class=data{$id} nowrap>", $localData->printField("values[{$attrs->f['attname']}]",
+ echo "<td class=\"data{$id}\" nowrap=\"nowrap\">", $localData->printField("values[{$attrs->f['attname']}]",
$_REQUEST['values'][$attrs->f['attname']], $attrs->f['type']), "</td>";
echo "</tr>\n";
$i++;
}
else echo "<p>{$lang['strinvalidparam']}</p>\n";
- echo "<p><input type=hidden name=action value=selectrows>\n";
- echo "<input type=hidden name=table value=\"", htmlspecialchars($_REQUEST['table']), "\">\n";
+ echo "<p><input type=\"hidden\" name=\"action\" value=\"selectrows\" />\n";
+ echo "<input type=\"hidden\" name=\"table\" value=\"", htmlspecialchars($_REQUEST['table']), "\" />\n";
echo $misc->form;
- echo "<input type=submit name=select value=\"{$lang['strselect']}\">\n";
- echo "<input type=submit name=cancel value=\"{$lang['strcancel']}\"></p>\n";
+ echo "<input type=\"submit\" name=\"select\" value=\"{$lang['strselect']}\" />\n";
+ echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" /></p>\n";
echo "</form>\n";
}
else {
global $PHP_SELF;
if ($confirm) {
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strtables']}: ", htmlspecialchars($_REQUEST['table']), ": {$lang['strinsertrow']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ", $misc->printVal($_REQUEST['table']), ": {$lang['strinsertrow']}</h2>\n";
$misc->printMsg($msg);
$attrs = &$localData->getTableAttributes($_REQUEST['table']);
// Continue drawing row
$id = (($i % 2) == 0 ? '1' : '2');
echo "<tr>\n";
- echo "<td class=\"data{$id}\" nowrap=\"nowrap\">", htmlspecialchars($attrs->f['attname']), "</td>";
+ echo "<td class=\"data{$id}\" nowrap=\"nowrap\">", $misc->printVal($attrs->f['attname']), "</td>";
echo "<td class=\"data{$id}\" nowrap=\"nowrap\">\n";
- echo htmlspecialchars($attrs->f['type']);
+ echo $misc->printVal($attrs->f['type']);
echo "<input type=\"hidden\" name=\"types[", htmlspecialchars($attrs->f['attname']), "]\" value=\"",
htmlspecialchars($attrs->f['type']), "\" /></td>";
echo "<td class=\"data{$id}\" nowrap=\"nowrap\">\n";
global $PHP_SELF;
if ($confirm) {
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strtables']}: ", htmlspecialchars($_REQUEST['table']), ": {$lang['strempty']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ", $misc->printVal($_REQUEST['table']), ": {$lang['strempty']}</h2>\n";
- echo "<p>", sprintf($lang['strconfemptytable'], htmlspecialchars($_REQUEST['table'])), "</p>\n";
+ echo "<p>", sprintf($lang['strconfemptytable'], $misc->printVal($_REQUEST['table'])), "</p>\n";
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
echo "<input type=hidden name=action value=empty>\n";
global $PHP_SELF;
if ($confirm) {
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strtables']}: ", htmlspecialchars($_REQUEST['table']), ": {$lang['strdrop']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ", $misc->printVal($_REQUEST['table']), ": {$lang['strdrop']}</h2>\n";
- echo "<p>", sprintf($lang['strconfdroptable'], htmlspecialchars($_REQUEST['table'])), "</p>\n";
+ echo "<p>", sprintf($lang['strconfdroptable'], $misc->printVal($_REQUEST['table'])), "</p>\n";
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"drop\">\n";
$key = $_REQUEST['key'];
if ($confirm) {
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strtables']}: ", htmlspecialchars($_REQUEST['table']), ": {$lang['streditrow']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ", $misc->printVal($_REQUEST['table']), ": {$lang['streditrow']}</h2>\n";
$misc->printMsg($msg);
$attrs = &$localData->getTableAttributes($_REQUEST['table']);
$_REQUEST['format'][$attrs->f['attname']] = 'VALUE';
echo "<tr>\n";
- echo "<td class=\"data{$id}\" nowrap=\"nowrap\">", htmlspecialchars($attrs->f['attname']), "</td>";
+ echo "<td class=\"data{$id}\" nowrap=\"nowrap\">", $misc->printVal($attrs->f['attname']), "</td>";
echo "<td class=\"data{$id}\" nowrap=\"nowrap\">\n";
- echo htmlspecialchars($attrs->f['type']);
+ echo $misc->printVal($attrs->f['type']);
echo "<input type=\"hidden\" name=\"types[", htmlspecialchars($attrs->f['attname']), "]\" value=\"",
htmlspecialchars($attrs->f['type']), "\" /></td>";
echo "<td class=\"data{$id}\" nowrap=\"nowrap\">\n";
global $PHP_SELF;
if ($confirm) {
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$lang['strtables']}: ", htmlspecialchars($_REQUEST['table']), ": {$lang['strdeleterow']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ", $misc->printVal($_REQUEST['table']), ": {$lang['strdeleterow']}</h2>\n";
echo "<p>{$lang['strconfdeleterow']}</p>\n";
global $data, $localData, $misc, $conf;
global $PHP_SELF, $lang;
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": ", htmlspecialchars($_REQUEST['table']), ": {$lang['strbrowse']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": ", $misc->printVal($_REQUEST['table']), ": {$lang['strbrowse']}</h2>\n";
$misc->printMsg($msg);
if (!isset($_REQUEST['page'])) $_REQUEST['page'] = 1;
global $data, $misc, $localData;
global $PHP_SELF, $lang;
- echo "<h2>", htmlspecialchars($_REQUEST['database']), "</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), "</h2>\n";
$tables = &$localData->getTables();
$i = 0;
while (!$tables->EOF) {
$id = (($i % 2) == 0 ? '1' : '2');
- echo "<tr><td class=data{$id}>", htmlspecialchars($tables->f[$data->tbFields['tbname']]), "</td>\n";
- echo "<td class=data{$id}>", htmlspecialchars($tables->f[$data->tbFields['tbowner']]), "</td>\n";
+ echo "<tr><td class=data{$id}>", $misc->printVal($tables->f[$data->tbFields['tbname']]), "</td>\n";
+ echo "<td class=data{$id}>", $misc->printVal($tables->f[$data->tbFields['tbowner']]), "</td>\n";
echo "<td class=opbutton{$id}><a href=\"{$PHP_SELF}?action=browse&page=1&{$misc->href}&table=",
urlencode($tables->f[$data->tbFields['tbname']]), "\">{$lang['strbrowse']}</a></td>\n";
echo "<td class=opbutton{$id}><a href=\"$PHP_SELF?action=confselectrows&{$misc->href}&table=",
/**
* List triggers on a table
*
- * $Id: triggers.php,v 1.13 2003/05/17 15:55:23 chriskl Exp $
+ * $Id: triggers.php,v 1.14 2003/05/31 07:23:24 chriskl Exp $
*/
// Include application functions
global $PHP_SELF, $lang;
if ($confirm) {
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": Tables: ",
- htmlspecialchars($_REQUEST['table']), ": " , htmlspecialchars($_REQUEST['trigger']), ": {$lang['strdrop']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ",
+ $misc->printVal($_REQUEST['table']), ": " , $misc->printVal($_REQUEST['trigger']), ": {$lang['strdrop']}</h2>\n";
- echo "<p>", sprintf($lang['strconfdroptrigger'], htmlspecialchars($_REQUEST['trigger']),
- htmlspecialchars($_REQUEST['table'])), "</p>\n";
+ echo "<p>", sprintf($lang['strconfdroptrigger'], $misc->printVal($_REQUEST['trigger']),
+ $misc->printVal($_REQUEST['table'])), "</p>\n";
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
- echo "<input type=\"hidden\" name=\"action\" value=\"drop\">\n";
- echo "<input type=\"hidden\" name=\"table\" value=\"", htmlspecialchars($_REQUEST['table']), "\">\n";
- echo "<input type=\"hidden\" name=\"trigger\" value=\"", htmlspecialchars($_REQUEST['trigger']), "\">\n";
+ echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
+ echo "<input type=\"hidden\" name=\"table\" value=\"", htmlspecialchars($_REQUEST['table']), "\" />\n";
+ echo "<input type=\"hidden\" name=\"trigger\" value=\"", htmlspecialchars($_REQUEST['trigger']), "\" />\n";
echo $misc->form;
// Show cascade drop option if supportd
if ($localData->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" name=\"cascade\"> {$lang['strcascade']}</p>\n";
+ echo "<p><input type=\"checkbox\" name=\"cascade\" /> {$lang['strcascade']}</p>\n";
}
- echo "<input type=\"submit\" name=\"yes\" value=\"{$lang['stryes']}\"> <input type=\"submit\" name=\"no\" value=\"{$lang['strno']}\">\n";
+ echo "<input type=\"submit\" name=\"yes\" value=\"{$lang['stryes']}\" />\n";
+ echo "<input type=\"submit\" name=\"no\" value=\"{$lang['strno']}\" />\n";
echo "</form>\n";
}
else {
echo "<form action=\"$PHP_SELF\" method=\"POST\">\n";
echo "<table>\n";
echo "<tr><th colspan=\"2\" class=\"data\">{$lang['strname']}</th></tr>\n";
- echo "<tr><td colspan=\"2\" class=\"data1\"><input type=\"text\" name=\"formTriggerName\" size=\"32\"/></td></tr>\n";
+ echo "<tr><td colspan=\"2\" class=\"data1\"><input type=\"text\" name=\"formTriggerName\" size=\"32\" /></td></tr>\n";
echo "<tr>\n";
echo " <th class=\"data\">{$lang['strwhen']}</th>\n";
echo " <th class=\"data\">{$lang['strevent']}</th>\n";
echo "<tr><th class=\"data\">{$lang['strfunction']}</th>\n";
echo "<th class=\"data\">{$lang['strarguments']}</th></tr>\n";
echo "<tr><td class=\"data1\">", $sel0->fetch(), "</td>\n";
- echo "<td class=\"data1\">(<input type=\"text\" name=\"formTriggerArgs\" size=\"32\"/>)</td>\n";
+ echo "<td class=\"data1\">(<input type=\"text\" name=\"formTriggerArgs\" size=\"32\" />)</td>\n";
echo "</tr></table>\n";
- echo "<p><input type=\"submit\" value=\"{$lang['strsave']}\"> <input type=\"reset\" value=\"{$lang['strreset']}\"></p>\n";
- echo "<input type=\"hidden\" name=\"action\" value=\"save_create\">\n";
- echo "<input type=\"hidden\" name=\"table\" value=\"", htmlspecialchars($_REQUEST['table']), "\">\n";
+ echo "<p><input type=\"submit\" value=\"{$lang['strsave']}\" />\n";
+ echo "<input type=\"reset\" value=\"{$lang['strreset']}\" /></p>\n";
+ echo "<input type=\"hidden\" name=\"action\" value=\"save_create\" />\n";
+ echo "<input type=\"hidden\" name=\"table\" value=\"", htmlspecialchars($_REQUEST['table']), "\" />\n";
echo $misc->form;
echo "</form>\n";
}
global $lang;
$misc->printTableNav();
- echo "<h2>", htmlspecialchars($_REQUEST['database']), ": ", htmlspecialchars($_REQUEST['table']), ": {$lang['strtriggers']}</h2>\n";
+ echo "<h2>", $misc->printVal($_REQUEST['database']), ": ", $misc->printVal($_REQUEST['table']), ": {$lang['strtriggers']}</h2>\n";
$misc->printMsg($msg);
$triggers = &$localData->getTriggers($_REQUEST['table']);
if ($triggers->recordCount() > 0) {
echo "<table>\n";
- echo "<tr><th class=\"data\">{$lang['strname']}</th><th class=\"data\">{$lang['strdefinition']}</th><th class=\"data\">{$lang['stractions']}</th>\n";
+ echo "<tr><th class=\"data\">{$lang['strname']}</th><th class=\"data\">{$lang['strdefinition']}</th>";
+ echo "<th class=\"data\">{$lang['stractions']}</th>\n";
$i = 0;
while (!$triggers->EOF) {
$id = ( ($i % 2 ) == 0 ? '1' : '2' );
- echo "<tr><td class=\"data{$id}\">", htmlspecialchars( $triggers->f[$data->tgFields['tgname']]), "</td>";
+ echo "<tr><td class=\"data{$id}\">", $misc->printVal( $triggers->f[$data->tgFields['tgname']]), "</td>";
echo "<td class=\"data{$id}\">";
// Nasty hack to support pre-7.4 PostgreSQL
if ($triggers->f[$data->tgFields['tgdef']] !== null)
- echo htmlspecialchars($triggers->f[$data->tgFields['tgdef']]);
+ echo $misc->printVal($triggers->f[$data->tgFields['tgdef']]);
else
- echo htmlspecialchars($localData->getTriggerDef($triggers->f));
+ echo $misc->printVal($localData->getTriggerDef($triggers->f));
echo "</td>\n<td class=\"data{$id}\">";
echo "<a href=\"$PHP_SELF?action=confirm_drop&{$misc->href}&trigger=", urlencode( $triggers->f[$data->tgFields['tgname']]),
"&table=", urlencode($_REQUEST['table']), "\">{$lang['strdrop']}</td></tr>\n";