* A class that implements the DB interface for Postgres\r
* Note: This class uses ADODB and returns RecordSets.\r
*\r
- * $Id: Postgres71.php,v 1.4 2002/02/18 13:06:13 chriskl Exp $\r
+ * $Id: Postgres71.php,v 1.5 2002/04/10 04:09:47 chriskl Exp $\r
*/\r
\r
// @@@ THOUGHT: What about inherits? ie. use of ONLY???\r
// @@ How do you do this?\r
return $this->execute($sql);\r
}\r
+ \r
+ /**\r
+ *\r
+ */\r
+ function &browseTable($table, $offset, $limit) {\r
+ return $this->selectTable("SELECT * FROM \"{$table}\"", $offset, $limit);\r
+ }\r
+ \r
+ /**\r
+ *\r
+ */\r
+ function &selectTable($sql, $offset, $limit) {\r
+ return $this->selectSet($sql, $offset, $limit);\r
+ }\r
\r
/**\r
* Adds a check constraint to a table\r
/**\r
* Central WebDB configuration\r
*\r
- * $Id: config.inc.php,v 1.4 2002/02/18 13:06:13 chriskl Exp $\r
+ * $Id: config.inc.php,v 1.5 2002/04/10 04:09:47 chriskl Exp $\r
*/\r
\r
// Set error reporting level\r
\r
// GUI settings\r
$guiLeftFrameWidth = 200;\r
+ $guiTheme = 'default';\r
\r
// Servers and types\r
$confServers = array();\r
\r
// Theme\r
echo "<style type=\"text/css\">\n<!--\n";\r
- include("../themes/default/global.css");\r
+ include("../themes/{$guiTheme}/global.css");\r
echo "\n-->\n</style>\n";\r
\r
?>
\ No newline at end of file
* Language template file for WebDB. Use this to base language\r
* files.\r
*\r
- * $Id: template.php,v 1.3 2002/02/18 13:06:13 chriskl Exp $\r
+ * $Id: template.php,v 1.4 2002/04/10 04:09:47 chriskl Exp $\r
*/\r
\r
$appLang = 'english';\r
$strNoFrames = 'You need a frames-enabled browser to use this application.';\r
$strLogin = 'Login';\r
$strNoTables = 'No tables found.';\r
+ $strOwner = 'Owner';\r
+ $strActions = 'Actions'; \r
+ $strTable = 'Table';\r
$strTables = 'Tables';\r
$strViews = 'Views';\r
$strTriggers = 'Triggers';\r
/**\r
* Main object browser\r
*\r
- * $Id: browser.php,v 1.4 2002/02/18 13:06:13 chriskl Exp $\r
+ * $Id: browser.php,v 1.5 2002/04/10 04:09:47 chriskl Exp $\r
*/\r
\r
// Include application functions\r
<html>\r
<head>\r
<title><?= $appName ?></title>\r
-<body>\r
+<body class=browser>\r
<?php\r
\r
// Construct expanding tree\r
$node = $tree->add_folder($root, htmlspecialchars($databases->f[$data->dbFields['dbname']]), \r
'database.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]));\r
if ($data->hasTables())\r
- $tree->add_document($node, $strTables, 'tables.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]));\r
+ $tree->add_document($node, $strTables, 'tables.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]), "../images/themes/{$guiTheme}/tables.gif");\r
if ($data->hasViews())\r
- $tree->add_document($node, $strViews, 'views.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]));\r
+ $tree->add_document($node, $strViews, 'views.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]), "../images/themes/{$guiTheme}/views.gif");\r
/* if ($data->hasTriggers())\r
$tree->add_document($node, $strTriggers, 'triggers.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]));\r
if ($data->hasRules())\r
- $tree->add_document($node, $strRules, 'rules.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]));\r
- if ($data->hasSequences())*/\r
- $tree->add_document($node, $strSequences, 'sequences.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]));\r
+ $tree->add_document($node, $strRules, 'rules.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]));*/\r
+ if ($data->hasSequences())\r
+ $tree->add_document($node, $strSequences, 'sequences.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]), "../images/themes/{$guiTheme}/sequences.gif");\r
if ($data->hasFunctions())\r
- $tree->add_document($node, $strFunctions, 'functions.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]));\r
+ $tree->add_document($node, $strFunctions, 'functions.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]), "../images/themes/{$guiTheme}/functions.gif");\r
if ($data->hasOperators())\r
$tree->add_document($node, $strOperators, 'operators.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]));\r
if ($data->hasTypes())\r
/**\r
* Main access point to WebDB.\r
*\r
- * $Id: index.php,v 1.2 2002/02/12 01:11:58 kkemp102294 Exp $\r
+ * $Id: index.php,v 1.3 2002/04/10 04:09:47 chriskl Exp $\r
*/\r
\r
// Include application functions\r
<title><?= $appName ?></title>\r
</head>\r
\r
-<frameset rows="50, *" border="0" frameborder="0">\r
+<frameset rows="50, *" border="0" frameborder="0" framespacing="0">\r
<frame src="topbar.php" name="topbar">\r
<frameset cols="<?= $guiLeftFrameWidth ?>,*" border="0" frameborder="0">\r
<frame src="browser.php" name="browser">\r
/**\r
* List tables in a database\r
*\r
- * $Id: tables.php,v 1.1 2002/02/12 08:51:08 chriskl Exp $\r
+ * $Id: tables.php,v 1.2 2002/04/10 04:09:47 chriskl Exp $\r
*/\r
\r
// Include application functions\r
include_once('../conf/config.inc.php');\r
-\r
- $tables = &$localData->getTables();\r
+ \r
+ if (!isset($action)) $action = '';\r
+ \r
?>\r
\r
<html>\r
<body>\r
\r
-<h1><?= $appName ?></h1>\r
<?php\r
\r
- if ($tables->recordCount() > 0) {\r
- echo "<table>\n";\r
- while (!$tables->EOF) {\r
- echo "<tr><td>", htmlspecialchars($tables->f[$data->tbFields['tbname']]), "</td></tr>\n";\r
- $tables->moveNext();\r
+switch ($action) {\r
+ case 'browse': \r
+ echo "<h2>", htmlspecialchars($database), ": ", htmlspecialchars($table), "</h2>\n";\r
+ $rs = &$localData->browseTable($table, $offset, $limit);\r
+ \r
+ if ($rs->recordCount() > 0) {\r
+ echo "<table>\n<tr>";\r
+ reset($rs->f);\r
+ while(list($k, ) = each($rs->f)) {\r
+ echo "<th class=data>", htmlspecialchars($k), "</td>";\r
+ } \r
+ echo "<th colspan=2 class=data>{$strActions}</th>\n";\r
+ \r
+ $i = 0;\r
+ reset($rs->f);\r
+ while (!$rs->EOF) {\r
+ $id = (($i % 2) == 0 ? '1' : '2');\r
+ echo "<tr>\n";\r
+ while(list(, $v) = each($rs->f)) {\r
+ echo "<td class=data{$id} nowrap>", nl2br(htmlspecialchars($v)), "</td>";\r
+ } \r
+ echo "<td class=opbutton{$id}>Edit</td>\n";\r
+ echo "<td class=opbutton{$id}>Delete</td>\n";\r
+ echo "</tr>\n";\r
+ $rs->moveNext();\r
+ $i++;\r
+ }\r
}\r
- }\r
- else {\r
- echo "<p>{$strNoTables}</p>\n";\r
- }\r
- \r
+ else echo "<p>No data.</p>\n";\r
+ \r
+ break;\r
+ default:\r
+ echo "<h2>", htmlspecialchars($database), "</h2>\n";\r
+ \r
+ $tables = &$localData->getTables();\r
+ \r
+ if ($tables->recordCount() > 0) {\r
+ echo "<table>\n";\r
+ echo "<tr><th class=data>{$strTable}</th><th class=data>{$strOwner}</th><th colspan=6 class=data>{$strActions}</th>\n";\r
+ $i = 0;\r
+ while (!$tables->EOF) {\r
+ $id = (($i % 2) == 0 ? '1' : '2');\r
+ echo "<tr><td class=data{$id}>", htmlspecialchars($tables->f[$data->tbFields['tbname']]), "</td>\n";\r
+ echo "<td class=data{$id}>", htmlspecialchars($tables->f[$data->tbFields['tbowner']]), "</td>\n";\r
+ echo "<td class=opbutton{$id}><a href=\"$PHP_SELF?action=browse&offset=0&limit=30&database=", \r
+ htmlspecialchars($database), "&table=", htmlspecialchars($tables->f[$data->tbFields['tbname']]), "\">Browse</a></td>\n";\r
+ echo "<td class=opbutton{$id}>Select</td>\n";\r
+ echo "<td class=opbutton{$id}>Insert</td>\n";\r
+ echo "<td class=opbutton{$id}>Properties</td>\n";\r
+ echo "<td class=opbutton{$id}>Empty</td>\n";\r
+ echo "<td class=opbutton{$id}>Drop</td>\n";\r
+ echo "</tr>\n";\r
+ $tables->moveNext();\r
+ $i++;\r
+ }\r
+ }\r
+ else {\r
+ echo "<p>{$strNoTables}</p>\n";\r
+ }\r
+ break;\r
+} \r
\r
?>\r
</body>\r
/**\r
* Top menu for WebDB\r
*\r
- * $Id: topbar.php,v 1.2 2002/02/12 01:11:58 kkemp102294 Exp $\r
+ * $Id: topbar.php,v 1.3 2002/04/10 04:09:47 chriskl Exp $\r
*/\r
\r
// Include application functions\r
?>\r
\r
<html>\r
+<body class=topbar>\r
+<table width="100%" border="0" cellspacing="0" cellpadding="0">\r
+ <tr> \r
+ <td width="211" rowspan="2"><img src="images/themes/<?= $guiTheme ?>/title.gif" width=211 height=50 alt="<? htmlspecialchars($appName) ?>"></td>\r
+ <td width="69%"><?= $confServers[$webdbServerID]['type'] ?> running on \r
+ <?= htmlspecialchars($confServers[$webdbServerID]['host']) ?>:<?= $confServers[$webdbServerID]['port'] ?>\r
+ -- You are logged in as user <b><?= htmlspecialchars($webdbUsername) ?></b>, \r
+ <?= date('jS M, Y g:iA') ?></font></td>\r
+ </tr>\r
+ <tr>\r
+ <td>\r
+ <a class=toplink href="usrlist.php">User Admin</a> | \r
+ <a class=toplink href="grplist.php">Group Admin</a> | \r
+ <a class=toplink href="login.php?mode=logout" target="_parent">Logout</a>\r
+ </td>\r
+ </tr>\r
+</table>\r
+</body>\r
+</html>\r
+\r
+<!--\r
\r
<p>\r
<a href="">Refresh</a> | \r
<a href="">Preferences</a> | \r
<a href="">Logout</a>\r
</p>\r
-\r
-</html>
\ No newline at end of file
+-->
\ No newline at end of file
text-align: left;
}
+body.topbar
+{
+ background-color: #ffffff;
+ margin: 0px 0px;
+ font-family: arial;
+ padding: 0px;
+ font-size: 10pt;
+ text-align: left;
+}
+
+body.browser
+{
+ background-color: #ffffff;
+ /*background-color: #efefef;*/
+ margin: 0px 0px;
+ font-family: arial;
+ padding: 0px;
+ font-size: 10pt;
+ text-align: left;
+}
+
+h2
+{
+ color: #666633;
+ font-size: 16;
+ font-family: verdana, arial, helvetica, sans-serif;
+ font-weight: bold;
+}
+
+th.data
+{
+ color: #000000;
+ background-color: #E6E6CC;
+ text-align: center;
+ font-family: verdana, arial, helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 14;
+}
+
+td.data1
+{
+ color: #000000;
+ background-color: #F3F3E9;
+ text-align: left;
+ font-family: verdana, arial, helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 13;
+}
+
+td.data2
+{
+ color: #000000;
+ background-color: #E6E6CC;
+ text-align: left;
+ font-family: verdana, arial, helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 13;
+}
+
+td.opbutton1 {
+ color: #000000;
+ background-color: #F3F3E9;
+ border-top: 1px solid #FFFFFF;
+ border-right: 1px solid #706D41;
+ border-bottom: 1px solid #706D41;
+ border-left: 1px solid #FFFFFF;
+ cursor: hand;
+ font-family: Helvetica,Arial,Verdana;
+ font-size: 9pt;
+}
+
+td.opbutton2 {
+ color: #000000;
+ background-color: #E6E6CC;
+ border-top: 1px solid #FFFFFF;
+ border-right: 1px solid #706D41;
+ border-bottom: 1px solid #706D41;
+ border-left: 1px solid #FFFFFF;
+ cursor: hand;
+ font-family: Helvetica,Arial,Verdana;
+ font-size: 9pt;
+}
+
+a.toplink {
+ font-weight: bold;
+}
+
+/*
+
tr
{
vertical-align: top;
padding: 0px;
text-align: left;
width: 100%;
-}
\ No newline at end of file
+}
+*/
\ No newline at end of file