function generate() { $thisTable = $this->tableObject; if ($thisTable->getDatabase() == "") { $dbName = "database"; } else { $dbName = $thisTable->getDatabase(); } $thisDatabaseQuery = new databaseQuery(); $sql = "SELECT * FROM " . $thisTable->getTableName(); $fieldNames = $thisTable->getFieldNameArray(); $result = $thisDatabaseQuery->executeDirectQuery($sql); $code = ""; $code .= "<?xml version=\"1.0\" ?>\n"; $code .= "<" . $dbName . ">\n"; while (!$result->EOF) { $code .= "\t<" . $thisTable->getTableName() . ">\n"; $fields = $result->fields; for ($a = 0; $a < count($fieldNames); $a++) { $thisFieldName = $fieldNames[$a]; $code .= "\t\t<" . $thisFieldName . ">"; $code .= $fields[$thisFieldName]; $code .= "</" . $thisFieldName . ">\n"; } $code .= "\t</" . $thisTable->getTableName() . ">\n"; $result->MoveNext(); } // end while $code .= "</" . $dbName . ">\n"; highlight_string($code); exit; $code = ""; // Returning Generated Code return $code; }
function generate() { $code = ""; $query = "select * from user_col_comments where table_name='" . $this->table . "'"; $thisDatabaseQuery = new databaseQuery(); $adodbResults = $thisDatabaseQuery->executeDirectQuery($query); $rows = $adodbResults->_array; $code .= "<table cellpadding=8 cellspacing=0 border=1>\n"; for ($a = 0; $a < count($rows); $a++) { $thisRow = $rows[$a]; $tableName = $thisRow['TABLE_NAME']; $columnName = $thisRow['COLUMN_NAME']; $comments = $thisRow['COMMENTS']; if ($comments == "") { $comments = "<i>none</i>"; } $code .= "<tr>\n"; $code .= "<td align=right bgcolor=\"#CCCCCC\">" . $columnName . "</td>\n"; $code .= "<td width=300>" . $comments . " </td>\n"; $code .= "</tr>\n"; } $code .= "</table>\n"; // Returning Generated Code return $code; }
function generate() { $thisTable = $this->getTableObject(); $fieldNames = $thisTable->getFieldNameArray(); $query = "select * from " . $thisTable->getTableName(); $thisDatabaseQuery = new databaseQuery(); $adodbResults = $thisDatabaseQuery->executeDirectQuery($query); echo "<pre>"; //print_r($adodbResults); echo "</pre>"; $sql = ""; $allSql = ""; $sqlFields = ""; $sqlValues = ""; for ($a = 0; $a < count($fieldNames); $a++) { $sqlFields .= $fieldNames[$a] . ","; } $sqlFields = $this->removeTrailingComma($sqlFields); while (!$adodbResults->EOF) { $sql = ""; $sqlValues = ""; $sql .= "INSERT INTO " . $thisTable->getTableName() . " ("; $sql .= $sqlFields; $sql .= ") VALUES ("; for ($a = 0; $a < count($fieldNames); $a++) { $sqlValues .= "'" . $adodbResults->fields[$fieldNames[$a]] . "',"; } $sqlValues = $this->removeTrailingComma($sqlValues); $sql .= $sqlValues; $sql .= ");\n"; $allSql .= $sql; $adodbResults->MoveNext(); } return $allSql; }
/** * @return put return description here.. * @param param : parameter passed to function * @desc buildDropDown($idField,$labelField,$tableName,$conditionField="",$conditionValue="",$labelField2 = "") : put function description here ... */ function buildDropDown($idField, $labelField, $tableName, $conditionField = "", $conditionValue = "", $labelField2 = "") { global $db; if ($labelField2 != "") { $lab2 = ", {$labelField2}"; } else { $lab2 = ""; } if ($conditionField != "") { $whereClause = " where {$conditionField}='{$conditionValue}' "; } $querydrop = "select {$idField},{$labelField} {$lab2} from {$tableName} {$whereClause} "; $thisDatabaseQuery = new databaseQuery(); $thisDatabaseQuery->setSqlQuery($querydrop); $thisDatabaseQuery->executeQuery(); $result = $thisDatabaseQuery->getResultSet(); if ($result == false) { $thisError = new errorHandler(); $thisError->setUserErrorMessage("An Error Occured while trying to build drop down box from database"); $thisError->setProgramErrorMessage("An Error Occured while trying to build drop down box from database in function buildDropDown()" . $querydrop); $thisError->handleError(); } else { if ($result->RowCount() == 0) { return ""; } else { if ($result->RowCount() > 0) { while (!$result->EOF) { $id = $result->fields[$idField]; $label = $result->fields[$labelField]; if ($labelField2 != "") { $label2 = $result->fields[$labelField2]; } echo "<option value=\"{$id}\">{$label}"; if ($labelField2 != "") { echo " {$label2} "; } echo "</option>"; $result->MoveNext(); } } } } }
function generateSave() { $code = ""; $query = "select * from user_col_comments where table_name='" . $this->table . "'"; $thisDatabaseQuery = new databaseQuery(); $adodbResults = $thisDatabaseQuery->executeDirectQuery($query); $rows = $adodbResults->_array; $code .= "<?\n"; $code .= "\$thisTableName = \$_REQUEST['tableName'];\n"; $code .= "\$thisDatabaseQuery = new databaseQuery();\n"; for ($a = 0; $a < count($rows); $a++) { $thisRow = $rows[$a]; $columnName = $thisRow['COLUMN_NAME']; $code .= "\n\$thisComments = \$_REQUEST['" . $columnName . "'];\n"; $code .= "\$sql = \"COMMENT ON COLUMN " . $this->table . "." . $columnName . " IS '\".\$thisComments.\"'\";\n"; $code .= "echo \$sql.\"<br><br>\";\n"; $code .= "\$commentsQueryResults = \$thisDatabaseQuery->executeDirectQuery(\$sql);\n\n"; } $code .= "?>\n"; // Returning Generated Code return $code; }
function countReturnRows() { $this->buildSearchSQL(); $query = new databaseQuery(); $query->setSqlQuery($this->getSql()); //$result = $query->getDbConn()->Execute($newQuery); $result = $query->countResultSet(); if ($result == false) { $thisError = new errorHandler(); $thisError->setUserErrorMessage("A Database Error Occured while counting result Rows "); $thisError->setProgramErrorMessage($this->dbConn->ErrorMsg()); $thisError->setErrorPage($_SERVER['PHP_SELF']); $thisError->handleError(); return 0; } else { return $query->getTotalRows(); } }
<?php include_once "//var/www/gip/app/settings/gipConfiguration.inc.php"; include_once INC_SUPERHEADER; include_once CLASS_DATABASE_QUERY; $thisDbQuery = new databaseQuery(); $db = requestUtils::getRequestObject('db'); $table = requestUtils::getRequestObject('table'); if ($db == "" && DATABASE_SERVER_TO_USE != "oracle") { ?> <?php echo LANG_GALL_SIMPLE_CHOOSE_SCHEMA; ?> <?php exit; } $thisDbQuery->useDatabase($db); $allTables = $thisDbQuery->getTables(); ?> <h2><?php echo LANG_GALL_SIMPLE_GEN_AND_SAVE_ALL; ?> <?php echo $db; ?> </h2> <?php echo LANG_GALL_SIMPLE_DESC;
<?php include_once "//var/www/gip/app/settings/gipConfiguration.inc.php"; include_once INC_SUPERHEADER; include_once CLASS_DATABASE_QUERY; include_once CLASS_PLUGIN_LOADER; $thisPlugInLoader = new plugInLoader(); $thisDbQuery = new databaseQuery(); $arguments = array(); $arguments['headerText'] = ""; $arguments['footerText'] = ""; $arguments['db'] = requestUtils::getRequestObject('db'); $thisDbQuery->useDatabase(requestUtils::getRequestObject('db')); $allTables = $thisDbQuery->getTables(); for ($a = 0; $a < count($allTables); $a++) { $arguments['table'] = $allTables[$a]; echo "<h2>" . $arguments['table'] . "</h2>"; $generatedInsertCode = $thisPlugInLoader->loadPlugIn(PLUGIN_PHP_SIMPLE_WEB_INSERT_GENERATOR_NAME, PLUGIN_PHP_SIMPLE_WEB_INSERT_GENERATOR_CLASS, $arguments); $generatedDeleteCode = $thisPlugInLoader->loadPlugIn(PLUGIN_PHP_SIMPLE_WEB_DELETE_GENERATOR_NAME, PLUGIN_PHP_SIMPLE_WEB_DELETE_GENERATOR_CLASS, $arguments); $generatedUpdateCode = $thisPlugInLoader->loadPlugIn(PLUGIN_PHP_SIMPLE_WEB_UPDATE_GENERATOR_NAME, PLUGIN_PHP_SIMPLE_WEB_UPDATE_GENERATOR_CLASS, $arguments); $generatedListerCode = $thisPlugInLoader->loadPlugIn(PLUGIN_PHP_SIMPLE_WEB_LISTER_GENERATOR_NAME, PLUGIN_PHP_SIMPLE_WEB_LISTER_GENERATOR_CLASS, $arguments); highlight_string($generatedInsertCode); echo "<hr>"; highlight_string($generatedDeleteCode); echo "<hr>"; highlight_string($generatedUpdateCode); echo "<hr>"; highlight_string($generatedListerCode); echo "<hr>"; }
" LANGUAGE="JavaScript"></SCRIPT> <LINK REL="stylesheet" HREF="<?php echo URL_STYLE_SHEET_TREE; ?> "> <?php } ?> <body background="<?php echo URL_IMAGE_FOLDER; ?> /linen.png" > <?php $thisDbQuery = new databaseQuery(); $allDatabases = $thisDbQuery->getDatabases(); ?> <b><?php echo LANG_BASIC_DATABASES; ?> </b> <br> <?php if ($allDatabases == "") { $allDatabases[0] = ""; } ?> <UL CLASS="mktree"> <?php