Codding standards
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
* All directives are explained in Documentation.html
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Sets the php error reporting - Please do not change this line!
|
||||
*/
|
||||
@@ -28,12 +29,19 @@ $old_error_rep = error_reporting(E_ALL);
|
||||
* test to see that the auto-detection code works in your system.
|
||||
*
|
||||
* If the auto-detection code does work properly, you can set the
|
||||
* $cfg['PmaAbsoluteUri_DisableWarning'] variable at the bottom of
|
||||
* this file.
|
||||
* $cfg['PmaAbsoluteUri_DisableWarning'] variable below.
|
||||
*/
|
||||
$cfg['PmaAbsoluteUri'] = '';
|
||||
|
||||
|
||||
/**
|
||||
* Disable the default warning about $cfg['PmaAbsoluteUri'] not being set
|
||||
* You should use this if and ONLY if the PmaAbsoluteUri auto-detection
|
||||
* works perfectly.
|
||||
*/
|
||||
$cfg['PmaAbsoluteUri_DisableWarning'] = FALSE;
|
||||
|
||||
|
||||
/**
|
||||
* Server(s) configuration
|
||||
*/
|
||||
@@ -91,12 +99,12 @@ $cfg['Servers'][$i]['user'] = 'root';
|
||||
$cfg['Servers'][$i]['password'] = '';
|
||||
$cfg['Servers'][$i]['only_db'] = '';
|
||||
$cfg['Servers'][$i]['verbose'] = '';
|
||||
$cfg['Servers'][$i]['pmadb'] = '';
|
||||
$cfg['Servers'][$i]['pmadb'] = '';
|
||||
$cfg['Servers'][$i]['bookmarktable'] = '';
|
||||
$cfg['Servers'][$i]['relation'] = '';
|
||||
$cfg['Servers'][$i]['table_info'] = '';
|
||||
$cfg['Servers'][$i]['table_coords'] = '';
|
||||
$cfg['Servers'][$i]['column_comments'] ='';
|
||||
$cfg['Servers'][$i]['column_comments'] = '';
|
||||
$cfg['Servers'][$i]['pdf_pages'] = '';
|
||||
$cfg['Servers'][$i]['AllowDeny']['order']
|
||||
= '';
|
||||
@@ -115,12 +123,12 @@ $cfg['Servers'][$i]['user'] = 'root';
|
||||
$cfg['Servers'][$i]['password'] = '';
|
||||
$cfg['Servers'][$i]['only_db'] = '';
|
||||
$cfg['Servers'][$i]['verbose'] = '';
|
||||
$cfg['Servers'][$i]['pmadb'] = '';
|
||||
$cfg['Servers'][$i]['pmadb'] = '';
|
||||
$cfg['Servers'][$i]['bookmarktable'] = '';
|
||||
$cfg['Servers'][$i]['relation'] = '';
|
||||
$cfg['Servers'][$i]['table_info'] = '';
|
||||
$cfg['Servers'][$i]['table_coords'] = '';
|
||||
$cfg['Servers'][$i]['column_comments'] ='';
|
||||
$cfg['Servers'][$i]['column_comments'] = '';
|
||||
$cfg['Servers'][$i]['pdf_pages'] = '';
|
||||
$cfg['Servers'][$i]['AllowDeny']['order']
|
||||
= '';
|
||||
@@ -191,15 +199,12 @@ $cfg['ZipDump'] = TRUE; // Allow the use of zip/gzip/bzip
|
||||
$cfg['GZipDump'] = TRUE; // compression for
|
||||
$cfg['BZipDump'] = TRUE; // dump files
|
||||
|
||||
|
||||
// Default Tabs display settings
|
||||
|
||||
$cfg['DefaultTabDatabase'] = 'db_details_structure.php3';
|
||||
// Possible values:
|
||||
// 'db_details_structure.php3' = tables list
|
||||
// 'db_details.php3' = sql form
|
||||
// 'db_search.php3' = search query
|
||||
|
||||
$cfg['DefaultTabTable'] = 'tbl_properties_structure.php3';
|
||||
// Possible values:
|
||||
// 'tbl_properties_structure.php3' = fields list
|
||||
@@ -207,6 +212,7 @@ $cfg['DefaultTabTable'] = 'tbl_properties_structure.php3';
|
||||
// 'tbl_select.php3 = select page
|
||||
// 'tbl_change.php3 = insert row page
|
||||
|
||||
|
||||
/**
|
||||
* Link to the official MySQL documentation
|
||||
* Be sure to include no trailing slash on the path
|
||||
@@ -215,14 +221,11 @@ $cfg['ManualBaseShort'] = 'http://www.mysql.com/doc';
|
||||
|
||||
|
||||
/**
|
||||
* Language settings
|
||||
* Language and charset conversion settings
|
||||
*/
|
||||
// Default language to use, if not browser-defined or user-defined
|
||||
$cfg['DefaultLang'] = 'en';
|
||||
|
||||
/**
|
||||
* Charset conversion settings
|
||||
*/
|
||||
// Default charset to use for recoding of MySQL queries, does not take
|
||||
// any effect when charsets recoding is switched off by
|
||||
// $cfg['AllowAnywhereRecoding'] or in language file
|
||||
@@ -271,8 +274,7 @@ $cfg['ModifyDeleteAtRight'] = FALSE; // show edit/delete links on right s
|
||||
$cfg['DefaultDisplay'] = 'horizontal'; // default display direction (horizontal|vertical)
|
||||
$cfg['RepeatCells'] = 100; // repeat header names every X cells? (0 = deactivate)
|
||||
|
||||
// Note: this feature will be
|
||||
// implemented after 2.3.0
|
||||
// Syntax coloring (Note: this feature will be implemented after 2.3.0)
|
||||
$cfg['UseSyntaxColoring'] = TRUE; // use syntaxcoloring on output of SQL, might be a little slower
|
||||
$cfg['colorFunctions'] = '#FF0000'; // Colors used for Syntaxcoloring of SQL Statements
|
||||
$cfg['colorKeywords'] = '#990099';
|
||||
@@ -280,6 +282,7 @@ $cfg['colorStrings'] = '#008000';
|
||||
$cfg['colorColType'] = '#FF9900';
|
||||
$cfg['colorAdd'] = '#0000FF';
|
||||
|
||||
|
||||
/**
|
||||
* Available charsets for MySQL conversion. currently contains all which could
|
||||
* be found in lang/* files and few more.
|
||||
@@ -287,7 +290,6 @@ $cfg['colorAdd'] = '#0000FF';
|
||||
* Charsets will be shown in same order as here listed, so if you frequently
|
||||
* use some of these move them to the top.
|
||||
*/
|
||||
|
||||
$cfg['AvailableCharsets'] = array(
|
||||
'iso-8859-1',
|
||||
'iso-8859-2',
|
||||
@@ -320,6 +322,7 @@ $cfg['AvailableCharsets'] = array(
|
||||
'SHIFT_JIS'
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* MySQL settings
|
||||
*/
|
||||
@@ -392,8 +395,9 @@ if ($cfg['ShowFunctionFields']) {
|
||||
);
|
||||
} // end if
|
||||
|
||||
if($cfg['UseSyntaxColoring']) {
|
||||
$cfg['keywords']=array(
|
||||
// Keywords for syntax coloring
|
||||
if ($cfg['UseSyntaxColoring']) {
|
||||
$cfg['keywords'] = array(
|
||||
'SELECT',
|
||||
'INSERT',
|
||||
'LEFT',
|
||||
@@ -416,8 +420,10 @@ if($cfg['UseSyntaxColoring']) {
|
||||
'VALUES'
|
||||
);
|
||||
} // end if
|
||||
if($cfg['UseSyntaxColoring']) {
|
||||
$cfg['additional']=array(
|
||||
|
||||
// Other reserved words for syntax coloring
|
||||
if ($cfg['UseSyntaxColoring']) {
|
||||
$cfg['additional'] = array(
|
||||
'TABLE',
|
||||
'DEFAULT',
|
||||
'NULL',
|
||||
@@ -445,24 +451,20 @@ if($cfg['UseSyntaxColoring']) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable the default warning about $cfg['PmaAbsoluteUri'] not being set
|
||||
* You should use this if and ONLY if the PmaAbsoluteUri auto-detection
|
||||
* works perfectly.
|
||||
*/
|
||||
$cfg['PmaAbsoluteUri_DisableWarning'] = FALSE;
|
||||
|
||||
/**
|
||||
* Unset magic_quotes_runtime - do not change!
|
||||
*/
|
||||
set_magic_quotes_runtime(0);
|
||||
|
||||
|
||||
/**
|
||||
* Restore old error_reporting mode - do not change either!
|
||||
*/
|
||||
error_reporting($old_error_rep);
|
||||
unset($old_error_rep);
|
||||
|
||||
|
||||
/**
|
||||
* File Revision - do not change either!
|
||||
*/
|
||||
|
@@ -47,39 +47,36 @@ $is_upload = (PMA_PHP_INT_VERSION >= 40000 && function_exists('ini_get'))
|
||||
: (PMA_PHP_INT_VERSION < 30016 || intval(@get_cfg_var('upload_max_filesize')));
|
||||
|
||||
?>
|
||||
<!-- DATABASE WORK -->
|
||||
<!-- Query box, sql file loader and bookmark support -->
|
||||
<a name="querybox"></a>
|
||||
<ul>
|
||||
<!-- Query box, sql file loader and bookmark support -->
|
||||
<li>
|
||||
<form method="post" action="read_dump.php3"<?php if ($is_upload) echo ' enctype="multipart/form-data"'; echo "\n"; ?>
|
||||
onsubmit="return checkSqlQuery(this)">
|
||||
<input type="hidden" name="is_js_confirmed" value="0" />
|
||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||
<input type="hidden" name="pos" value="0" />
|
||||
<input type="hidden" name="goto" value="db_details.php3" />
|
||||
<input type="hidden" name="zero_rows" value="<?php echo htmlspecialchars($strSuccess); ?>" />
|
||||
<input type="hidden" name="prev_sql_query" value="<?php echo ((!empty($query_to_display)) ? urlencode($query_to_display) : ''); ?>" />
|
||||
<?php echo sprintf($strRunSQLQuery, $db) . ' ' . PMA_showDocuShort('S/E/SELECT.html'); ?> :<br />
|
||||
<div style="margin-bottom: 5px">
|
||||
<form method="post" action="read_dump.php3"<?php if ($is_upload) echo ' enctype="multipart/form-data"'; echo "\n"; ?>
|
||||
onsubmit="return checkSqlQuery(this)">
|
||||
<input type="hidden" name="is_js_confirmed" value="0" />
|
||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||
<input type="hidden" name="pos" value="0" />
|
||||
<input type="hidden" name="goto" value="db_details.php3" />
|
||||
<input type="hidden" name="zero_rows" value="<?php echo htmlspecialchars($strSuccess); ?>" />
|
||||
<input type="hidden" name="prev_sql_query" value="<?php echo ((!empty($query_to_display)) ? urlencode($query_to_display) : ''); ?>" />
|
||||
<?php echo sprintf($strRunSQLQuery, $db) . ' ' . PMA_showDocuShort('S/E/SELECT.html'); ?> :<br />
|
||||
<div style="margin-bottom: 5px">
|
||||
<textarea name="sql_query" cols="<?php echo $cfg['TextareaCols'] * 2; ?>" rows="<?php echo $cfg['TextareaRows']; ?>" wrap="virtual"
|
||||
onfocus="if (typeof(document.layers) == 'undefined' || typeof(textarea_selected) == 'undefined') {textarea_selected = 1; this.form.elements['sql_query'].select();}">
|
||||
<?php echo ((!empty($query_to_display)) ? htmlspecialchars($query_to_display) : ''); ?>
|
||||
</textarea><br />
|
||||
<input type="checkbox" name="show_query" value="y" id="checkbox_show_query" checked="checked" />
|
||||
<label for="checkbox_show_query"><?php echo $strShowThisQuery; ?></label><br />
|
||||
</div>
|
||||
<input type="checkbox" name="show_query" value="y" id="checkbox_show_query" checked="checked" />
|
||||
<label for="checkbox_show_query"><?php echo $strShowThisQuery; ?></label><br />
|
||||
</div>
|
||||
<?php
|
||||
// loic1: displays import dump feature only if file upload available
|
||||
if ($is_upload) {
|
||||
echo ' <i>' . $strOr . '</i> ' . $strLocationTextfile . ' :<br />' . "\n";
|
||||
echo ' <i>' . $strOr . '</i> ' . $strLocationTextfile . ' :<br />' . "\n";
|
||||
?>
|
||||
<div style="margin-bottom: 5px">
|
||||
<input type="file" name="sql_file" class="textfield" /><br />
|
||||
</div>
|
||||
<div style="margin-bottom: 5px">
|
||||
<input type="file" name="sql_file" class="textfield" /><br />
|
||||
</div>
|
||||
<?php
|
||||
} // end if
|
||||
echo "\n";
|
||||
@@ -87,31 +84,29 @@ echo "\n";
|
||||
// Bookmark Support
|
||||
if ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table']) {
|
||||
if (($bookmark_list = PMA_listBookmarks($db, $cfg['Bookmark'])) && count($bookmark_list) > 0) {
|
||||
echo " <i>$strOr</i> $strBookmarkQuery :<br />\n";
|
||||
echo ' <div style="margin-bottom: 5px">' . "\n";
|
||||
echo ' <select name="id_bookmark">' . "\n";
|
||||
echo ' <option value=""></option>' . "\n";
|
||||
echo " <i>$strOr</i> $strBookmarkQuery :<br />\n";
|
||||
echo ' <div style="margin-bottom: 5px">' . "\n";
|
||||
echo ' <select name="id_bookmark">' . "\n";
|
||||
echo ' <option value=""></option>' . "\n";
|
||||
while (list($key, $value) = each($bookmark_list)) {
|
||||
echo ' <option value="' . $value . '">' . htmlentities($key) . '</option>' . "\n";
|
||||
echo ' <option value="' . $value . '">' . htmlentities($key) . '</option>' . "\n";
|
||||
}
|
||||
echo ' </select>' . "\n";
|
||||
echo ' <input type="radio" name="action_bookmark" value="0" id="radio_bookmark0" checked="checked" style="vertical-align: middle" /><label for="radio_bookmark0">' . $strSubmit . '</label>' . "\n";
|
||||
echo ' <input type="radio" name="action_bookmark" value="1" id="radio_bookmark1" style="vertical-align: middle" /><label for="radio_bookmark1">' . $strBookmarkView . '</label>' . "\n";
|
||||
echo ' <input type="radio" name="action_bookmark" value="2" id="radio_bookmark2" style="vertical-align: middle" /><label for="radio_bookmark2">' . $strDelete . '</label>' . "\n";
|
||||
echo ' <br />' . "\n";
|
||||
echo ' </div>' . "\n";
|
||||
echo ' </select>' . "\n";
|
||||
echo ' <input type="radio" name="action_bookmark" value="0" id="radio_bookmark0" checked="checked" style="vertical-align: middle" /><label for="radio_bookmark0">' . $strSubmit . '</label>' . "\n";
|
||||
echo ' <input type="radio" name="action_bookmark" value="1" id="radio_bookmark1" style="vertical-align: middle" /><label for="radio_bookmark1">' . $strBookmarkView . '</label>' . "\n";
|
||||
echo ' <input type="radio" name="action_bookmark" value="2" id="radio_bookmark2" style="vertical-align: middle" /><label for="radio_bookmark2">' . $strDelete . '</label>' . "\n";
|
||||
echo ' <br />' . "\n";
|
||||
echo ' </div>' . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Encoding setting form appended by Y.Kawada
|
||||
if (function_exists('PMA_set_enc_form')) {
|
||||
echo PMA_set_enc_form(' ');
|
||||
echo PMA_set_enc_form(' ');
|
||||
}
|
||||
?>
|
||||
<input type="submit" name="SQL" value="<?php echo $strGo; ?>" />
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
<input type="submit" name="SQL" value="<?php echo $strGo; ?>" />
|
||||
</form>
|
||||
|
||||
|
||||
<?php
|
||||
|
@@ -10,8 +10,8 @@
|
||||
if (PMA_MYSQL_INT_VERSION >= 32303) {
|
||||
// Special speedup for newer MySQL Versions (in 4.0 format changed)
|
||||
if ($cfg['SkipLockedTables'] == TRUE && PMA_MYSQL_INT_VERSION >= 32330) {
|
||||
$local_query = 'SHOW OPEN TABLES FROM ' . PMA_backquote($db);
|
||||
$db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
|
||||
$local_query = 'SHOW OPEN TABLES FROM ' . PMA_backquote($db);
|
||||
$db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
|
||||
// Blending out tables in use
|
||||
if ($db_info_result != FALSE && mysql_num_rows($db_info_result) > 0) {
|
||||
while ($tmp = PMA_mysql_fetch_row($db_info_result)) {
|
||||
@@ -23,8 +23,8 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
|
||||
mysql_free_result($db_info_result);
|
||||
|
||||
if (isset($sot_cache)) {
|
||||
$local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
|
||||
$db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
|
||||
$local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
|
||||
$db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
|
||||
if ($db_info_result != FALSE && mysql_num_rows($db_info_result) > 0) {
|
||||
while ($tmp = PMA_mysql_fetch_row($db_info_result)) {
|
||||
if (!isset($sot_cache[$tmp[0]])) {
|
||||
@@ -43,8 +43,8 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
|
||||
}
|
||||
}
|
||||
if (!isset($sot_ready)) {
|
||||
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
|
||||
$db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
|
||||
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
|
||||
$db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
|
||||
if ($db_info_result != FALSE && mysql_num_rows($db_info_result) > 0) {
|
||||
while ($sts_tmp = PMA_mysql_fetch_array($db_info_result)) {
|
||||
$tables[] = $sts_tmp;
|
||||
@@ -55,8 +55,8 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
|
||||
$num_tables = (isset($tables) ? count($tables) : 0);
|
||||
} // end if (PMA_MYSQL_INT_VERSION >= 32303)
|
||||
else {
|
||||
$db_info_result = PMA_mysql_list_tables($db);
|
||||
$num_tables = ($db_info_result) ? @mysql_numrows($db_info_result) : 0;
|
||||
$db_info_result = PMA_mysql_list_tables($db);
|
||||
$num_tables = ($db_info_result) ? @mysql_numrows($db_info_result) : 0;
|
||||
for ($i = 0; $i < $num_tables; $i++) {
|
||||
$tables[] = PMA_mysql_tablename($db_info_result, $i);
|
||||
}
|
||||
|
@@ -1,9 +1,13 @@
|
||||
<?php
|
||||
/* $Id$ */
|
||||
|
||||
// count amount of navigation tabs
|
||||
|
||||
/**
|
||||
* Counts amount of navigation tabs
|
||||
*/
|
||||
$db_details_links_count_tabs = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Prepares links
|
||||
*/
|
||||
@@ -23,7 +27,7 @@ else {
|
||||
// Drop link if allowed
|
||||
if (!$cfg['AllowUserDropDatabase']) {
|
||||
// Check if the user is a Superuser
|
||||
$links_result = @PMA_mysql_query('USE mysql');
|
||||
$links_result = @PMA_mysql_query('USE mysql');
|
||||
$cfg['AllowUserDropDatabase'] = (!PMA_mysql_error());
|
||||
}
|
||||
if ($cfg['AllowUserDropDatabase']) {
|
||||
@@ -32,7 +36,7 @@ if ($cfg['AllowUserDropDatabase']) {
|
||||
. urlencode('DROP DATABASE ' . PMA_backquote($db))
|
||||
. '&zero_rows='
|
||||
. urlencode(sprintf($strDatabaseHasBeenDropped, htmlspecialchars(PMA_backquote($db))))
|
||||
. '&goto=main.php3&back=db_details' . $sub_part . '.php3&reload=1"';
|
||||
. '&goto=main.php3&back=db_details' . $sub_part . '.php3&reload=1';
|
||||
$att5 = 'class="drop" '
|
||||
. 'onclick="return confirmLink(this, \'DROP DATABASE ' . PMA_jsFormat($db) . '\')"';
|
||||
}
|
||||
@@ -44,31 +48,27 @@ else {
|
||||
* Displays tab links
|
||||
*/
|
||||
?>
|
||||
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="tabs">
|
||||
<tr>
|
||||
<td width="8"> </td>
|
||||
<table border="0" cellspacing="0" cellpadding="3" width="100%" class="tabs">
|
||||
<tr>
|
||||
<td width="8"> </td>
|
||||
<?php
|
||||
echo printTab($strStructure,"db_details_structure.php3",$url_query);
|
||||
echo printTab($strSQL,"db_details.php3",$url_query."&db_query_force=1");
|
||||
echo printTab($strExport,$lnk3,$arg3);
|
||||
echo printTab($strSearch,$lnk4,$arg4);
|
||||
echo PMA_printTab($strStructure, 'db_details_structure.php3', $url_query);
|
||||
echo PMA_printTab($strSQL, 'db_details.php3', $url_query . '&db_query_force=1');
|
||||
echo PMA_printTab($strExport, $lnk3, $arg3);
|
||||
echo PMA_printTab($strSearch, $lnk4, $arg4);
|
||||
|
||||
/**
|
||||
* Query by example and dump of the db
|
||||
* Only displayed if there is at least one table in the db
|
||||
*/
|
||||
// Query by example and dump of the db are only displayed if there is at least
|
||||
// one table in the db
|
||||
if ($num_tables > 0) {
|
||||
echo printTab($strQBE,"db_details_qbe.php3",$url_query);
|
||||
echo PMA_printTab($strQBE, 'db_details_qbe.php3', $url_query);
|
||||
} // end if
|
||||
|
||||
/**
|
||||
* Displays drop link
|
||||
*/
|
||||
// Displays drop link
|
||||
if ($lnk5) {
|
||||
echo printTab($strDrop,$lnk5,$arg5,$att5);
|
||||
echo PMA_printTab($strDrop, $lnk5, $arg5, $att5);
|
||||
} // end if
|
||||
echo "\n";
|
||||
?>
|
||||
</tr>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
|
@@ -10,7 +10,7 @@ if (empty($is_info)) {
|
||||
include('./db_details_common.php3');
|
||||
$url_query .= '&goto=db_details_structure.php3';
|
||||
|
||||
//Drop/delete multiple tables if required
|
||||
// Drops/deletes multiple tables if required
|
||||
if ((!empty($submit_mult) && isset($selected_tbl))
|
||||
|| isset($mult_btn)) {
|
||||
$action = 'db_details_structure.php3';
|
||||
@@ -22,8 +22,10 @@ if (empty($is_info)) {
|
||||
include('./db_details_db_info.php3');
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Settings for Relationstuff
|
||||
* Settings for relations stuff
|
||||
*/
|
||||
require('./libraries/relation.lib.php3');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
@@ -448,47 +450,48 @@ echo ' ' . ' <input type="submit" value="' . $strGo . '" />' . "\n";
|
||||
<?php
|
||||
// is this OK to check for 'class' support?
|
||||
if ($cfgRelation['pdfwork'] && $num_tables > 0) {
|
||||
$takeaway = $url_query . '&table=' . urlencode($table);
|
||||
?>
|
||||
<!-- Work on PDF Pages -->
|
||||
<li>
|
||||
<?php
|
||||
$takeaway = $url_query . '&table=' . urlencode($table);
|
||||
?>
|
||||
<a href="pdf_pages.php3?<?php echo $takeaway; ?>"><?php echo $strEditPDFPages ;?></a>
|
||||
<a href="pdf_pages.php3?<?php echo $takeaway; ?>"><?php echo $strEditPDFPages; ?></a>
|
||||
</li>
|
||||
<!-- PDF schema -->
|
||||
<?php
|
||||
// We only show this if we find something in the new pdf_pages table
|
||||
|
||||
<!-- PDF schema -->
|
||||
<?php
|
||||
// We only show this if we find something in the new pdf_pages table
|
||||
$test_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['pdf_pages'])
|
||||
. ' WHERE db_name = \'' . $db . '\'';
|
||||
. ' WHERE db_name = \'' . PMA_backquote($db) . '\'';
|
||||
$test_rs = PMA_query_as_cu($test_query);
|
||||
if(mysql_num_rows($test_rs) > 0){
|
||||
if ($test_rs && mysql_num_rows($test_rs) > 0) {
|
||||
echo "\n";
|
||||
?>
|
||||
<li>
|
||||
<form method="post" action="pdf_schema.php3">
|
||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||
<?php echo $strDisplayPDF; ?> :<br />
|
||||
<?php echo $strPageNumber; ?>
|
||||
<select name="pdf_page_number">
|
||||
<?php
|
||||
while ($pages = @PMA_mysql_fetch_array($test_rs)) {
|
||||
echo '<option value="'.$pages['page_nr'].'">'.$pages['page_nr'].': '.$pages['page_descr'].'</option>'."\n";
|
||||
}
|
||||
?>
|
||||
</select><br />
|
||||
<input type="checkbox" name="show_grid" id="show_grid_opt" />
|
||||
<label for="show_grid_opt"><?php echo $strShowGrid; ?></label><br />
|
||||
<input type="checkbox" name="show_color" id="show_color_opt" checked="checked" />
|
||||
<label for="show_color_opt"><?php echo $strShowColor; ?></label><br />
|
||||
<input type="checkbox" name="show_table_dimension" id="show_table_dim_opt" />
|
||||
<label for="show_table_dim_opt"><?php echo $strShowTableDimension; ?></label>
|
||||
<input type="submit" value="<?php echo $strGo; ?>" />
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
<form method="post" action="pdf_schema.php3">
|
||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||
<?php echo $strDisplayPDF; ?> :<br />
|
||||
<?php echo $strPageNumber; ?>
|
||||
<select name="pdf_page_number">
|
||||
<?php
|
||||
while ($pages = @PMA_mysql_fetch_array($test_rs)) {
|
||||
echo "\n" . ' '
|
||||
. '<option value="' . $pages['page_nr'] . '">' . $pages['page_nr'] . ': ' . $pages['page_descr'] . '</option>';
|
||||
} // end while
|
||||
echo "\n";
|
||||
?>
|
||||
</select><br />
|
||||
<input type="checkbox" name="show_grid" id="show_grid_opt" />
|
||||
<label for="show_grid_opt"><?php echo $strShowGrid; ?></label><br />
|
||||
<input type="checkbox" name="show_color" id="show_color_opt" checked="checked" />
|
||||
<label for="show_color_opt"><?php echo $strShowColor; ?></label><br />
|
||||
<input type="checkbox" name="show_table_dimension" id="show_table_dim_opt" />
|
||||
<label for="show_table_dim_opt"><?php echo $strShowTableDimension; ?></label>
|
||||
<input type="submit" value="<?php echo $strGo; ?>" />
|
||||
</form>
|
||||
</li>
|
||||
<?php
|
||||
} // end if
|
||||
} // end if
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* $Id$ */
|
||||
|
||||
|
||||
/**
|
||||
* Gets the variables sent to this script and send headers
|
||||
*/
|
||||
@@ -83,14 +84,16 @@ if ($server > 0) {
|
||||
// Get the valid databases list
|
||||
$num_dbs = count($dblist);
|
||||
$dbs = @mysql_list_dbs() or PMA_mysqlDie('', 'mysql_list_dbs()', '', 'main.php3?lang' . $lang . '&server=' . $server);
|
||||
while ($a_db = PMA_mysql_fetch_object($dbs)) {
|
||||
if (!$num_dbs) {
|
||||
$dblist[] = $a_db->Database;
|
||||
} else {
|
||||
$true_dblist[$a_db->Database] = '';
|
||||
}
|
||||
} // end while
|
||||
@mysql_free_result($dbs);
|
||||
if ($dbs) {
|
||||
while ($a_db = PMA_mysql_fetch_object($dbs)) {
|
||||
if (!$num_dbs) {
|
||||
$dblist[] = $a_db->Database;
|
||||
} else {
|
||||
$true_dblist[$a_db->Database] = '';
|
||||
}
|
||||
} // end while
|
||||
mysql_free_result($dbs);
|
||||
} // end if
|
||||
if ($num_dbs && empty($true_dblist)) {
|
||||
$dblist = array();
|
||||
} else if ($num_dbs) {
|
||||
@@ -141,7 +144,7 @@ if ($server > 0) {
|
||||
*/
|
||||
if ($num_dbs > 0) {
|
||||
// Defines the urls used to sort the table
|
||||
$common_url = 'db_stats.php3?lang=' . $lang . '&server=' . $server . '&convcharset=' . $convcharset;
|
||||
$common_url = 'db_stats.php3?lang=' . $lang . '&convcharset=' . $convcharset . '&server=' . $server;
|
||||
if (empty($sort_by)) {
|
||||
$sort_by = 'db_name';
|
||||
$sort_order = 'asc';
|
||||
@@ -230,8 +233,12 @@ if ($num_dbs > 0) {
|
||||
$tables = @PMA_mysql_list_tables($db);
|
||||
|
||||
// Number of tables
|
||||
$dbs_array[$db][0] = ($tables) ? @mysql_numrows($tables) : 0;
|
||||
@mysql_free_result($tables);
|
||||
if ($tables) {
|
||||
$dbs_array[$db][0] = mysql_numrows($tables);
|
||||
mysql_free_result($tables);
|
||||
} else {
|
||||
$dbs_array[$db][0] = 0;
|
||||
}
|
||||
$total_array[0] += $dbs_array[$db][0];
|
||||
|
||||
// Size of data and indexes
|
||||
@@ -252,8 +259,8 @@ if ($num_dbs > 0) {
|
||||
$total_array[1] += $dbs_array[$db][1];
|
||||
$total_array[2] += $dbs_array[$db][2];
|
||||
$total_array[3] += $dbs_array[$db][3];
|
||||
mysql_free_result($result);
|
||||
} // end if
|
||||
@mysql_free_result($result);
|
||||
} // end if MySQL 3.23.03+
|
||||
|
||||
} // end for
|
||||
@@ -287,7 +294,7 @@ if ($num_dbs > 0) {
|
||||
echo ' <td align="center" bgcolor="'. $bgcolor . '">' . "\n";
|
||||
echo ' <input type="checkbox" name="selected_db[]" value="' . urlencode($db_name) . '"' . $do_check . ' /> ' . "\n";
|
||||
echo ' </td>' . "\n";
|
||||
echo ' <td bgcolor="'. $bgcolor . '"> <a href="index.php3?lang=' . $lang . '&server=' . $server . '&db=' . urlencode($db_name) . '&convcharset=' . $convcharset . '" target="_parent">' . $db_name . '</a> </td>' . "\n";
|
||||
echo ' <td bgcolor="'. $bgcolor . '"> <a href="index.php3?lang=' . $lang . '&convcharset=' . $convcharset . '&server=' . $server . '&db=' . urlencode($db_name) . '" target="_parent">' . $db_name . '</a> </td>' . "\n";
|
||||
echo ' <td align="right" bgcolor="'. $bgcolor . '"> ' . $dbs_array[$db_name][0] . ' </td>' . "\n";
|
||||
echo ' <td align="right" bgcolor="'. $bgcolor . '"> ' . $data_size . '<bdo dir="' . $text_dir . '"> </bdo>' . $data_unit . ' </td>' . "\n";
|
||||
echo ' <td align="right" bgcolor="'. $bgcolor . '"> ' . $idx_size . '<bdo dir="' . $text_dir . '"> </bdo>' . $idx_unit . ' </td>' . "\n";
|
||||
|
@@ -193,10 +193,14 @@ echo "\n";
|
||||
</head>
|
||||
|
||||
|
||||
<body bgcolor="<?php
|
||||
echo $GLOBALS['cfg']['RightBgColor'];
|
||||
if ($GLOBALS['cfg']['RightBgImage'] != '') echo '" background="' . $GLOBALS['cfg']['RightBgImage'];
|
||||
?>">
|
||||
<?php
|
||||
if ($GLOBALS['cfg']['RightBgImage'] != '') {
|
||||
$bkg_img = ' background="' . $GLOBALS['cfg']['RightBgImage'] . '"';
|
||||
} else {
|
||||
$bkg_img = '';
|
||||
}
|
||||
?>
|
||||
<body bgcolor="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>>
|
||||
<?php
|
||||
if (isset($GLOBALS['db'])) {
|
||||
$header_url_qry = '?lang=' . urlencode($GLOBALS['lang'])
|
||||
|
@@ -168,7 +168,7 @@ echo "\n";
|
||||
<body bgcolor="<?php echo $cfg['LeftBgColor']; ?>">
|
||||
<!-- Link to the welcome page -->
|
||||
<div id="el1Parent" class="parent" style="margin-bottom: 5px">
|
||||
<nobr><a class="item" href="main.php3?lang=<?php echo $lang; ?>&server=<?php echo $server; ?>&convcharset=<?php echo $convcharset;?>"><span class="heada"><b><?php echo $strHome; ?></b></span></a></nobr>
|
||||
<nobr><a class="item" href="main.php3?lang=<?php echo $lang; ?>&convcharset=<?php echo $convcharset; ?>&server=<?php echo $server; ?>"><span class="heada"><b><?php echo $strHome; ?></b></span></a></nobr>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ if ($num_dbs > 1) {
|
||||
echo ' <input type="hidden" name="convcharset" value="' . $convcharset . '" />' . "\n";
|
||||
echo ' <input type="hidden" name="server" value="' . $server . '" />' . "\n";
|
||||
echo ' <select name="lightm_db" onchange="this.form.submit()">' . "\n";
|
||||
echo ' <option value="">(' .$strDatabases. ') ...</option>' . "\n";
|
||||
echo ' <option value="">(' . $strDatabases . ') ...</option>' . "\n";
|
||||
$table_list = '';
|
||||
$table_list_header = '';
|
||||
$db_name = '';
|
||||
|
@@ -31,8 +31,8 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
|
||||
* the authentication libraries must be before the connection to db but
|
||||
* after the PMA_isInto() function
|
||||
*
|
||||
* the PMA_mysqlDie() function must be before the connection to db but after
|
||||
* mysql extension has been loaded
|
||||
* the PMA_mysqlDie() function must be before the connection to db but
|
||||
* after mysql extension has been loaded
|
||||
*
|
||||
* the PMA_mysqlDie() function needs the PMA_format_sql() Function
|
||||
*
|
||||
@@ -78,7 +78,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
|
||||
// Sends the Content-Type header
|
||||
header('Content-Type: text/html; charset=' . $charset);
|
||||
// Displays the error message
|
||||
?>
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>" dir="<?php echo $text_dir; ?>">
|
||||
@@ -103,8 +103,8 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php
|
||||
exit;
|
||||
<?php
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,7 +136,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
include('./libraries/charset_conversion.lib.php3');
|
||||
|
||||
// For compatibility with old config.inc.php3
|
||||
if (!isset($cfg['FileRevision']) || (int)substr($cfg['FileRevision'],13,3) < 116) {
|
||||
if (!isset($cfg['FileRevision']) || (int) substr($cfg['FileRevision'], 13, 3) < 116) {
|
||||
include('./libraries/config_import.lib.php3');
|
||||
}
|
||||
|
||||
@@ -199,6 +199,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
return $a_string;
|
||||
} // end of the 'PMA_sqlAddslashes()' function
|
||||
|
||||
|
||||
/**
|
||||
* format sql strings
|
||||
*
|
||||
@@ -206,9 +207,12 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
*
|
||||
* @return string the formatted sql
|
||||
*
|
||||
* @global array the configuration array
|
||||
* @global boolean whether the current statement is a multiple one or not
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @author Mike Beck<mikebeck@users.sourceforge.net>
|
||||
* @author Mike Beck <mikebeck@users.sourceforge.net>
|
||||
*/
|
||||
function PMA_format_sql ($sql) {
|
||||
global $cfg, $mult;
|
||||
@@ -216,109 +220,122 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
// lem9: bypass this function for now
|
||||
return $sql;
|
||||
|
||||
$_sfuncs = '^' . implode('$|^', $cfg['Functions']) . '$';
|
||||
$_skeyw = '^' . implode('$|^', $cfg['keywords']) . '$';
|
||||
$_scoltype = '^' . implode('$|^', $cfg['ColumnTypes']) . '$';
|
||||
$_add = '^' . implode('$|^', $cfg['additional']) . '$';
|
||||
$sfuncs = '^' . implode('$|^', $cfg['Functions']) . '$';
|
||||
$skeyw = '^' . implode('$|^', $cfg['keywords']) . '$';
|
||||
$scoltype = '^' . implode('$|^', $cfg['ColumnTypes']) . '$';
|
||||
$add = '^' . implode('$|^', $cfg['additional']) . '$';
|
||||
|
||||
// first of all lets remove all newlines - we'll add our own later
|
||||
// First of all lets remove all newlines - we'll add our own later
|
||||
$sql = str_replace("\n", ' ', $sql);
|
||||
// there should always be blanks around = and after , ()
|
||||
// fixme - i would like to replace ';' with '; ' but then i need
|
||||
// to know how to do that without getting ; within strings as well
|
||||
// There should always be blanks around = and after , ()
|
||||
// fixme - i would like to replace ';' with '; ' but then i need
|
||||
// to know how to do that without getting ; within strings as well
|
||||
$sql = str_replace('=', ' = ', $sql);
|
||||
$sql = str_replace(',', ', ', $sql);
|
||||
$sql = str_replace(')', ' ) ', $sql);
|
||||
$sql = str_replace('(', ' ( ', $sql);
|
||||
|
||||
// now split everything by the blanks
|
||||
$_sql_parts=explode(' ',$sql);
|
||||
// start a loop over the parts check each word and put them back into $sql
|
||||
// Now split everything by the blanks
|
||||
$sql_parts = explode(' ', $sql);
|
||||
// Start a loop over the parts check each word and put them back into
|
||||
// $sql
|
||||
unset($sql);
|
||||
$s_nr=0;
|
||||
$s_nr = 0;
|
||||
|
||||
while (list($_num,$_word) = each($_sql_parts)) {
|
||||
// we might have added to many blanks when checking for = and ,
|
||||
while (list($num, $word) = each($sql_parts)) {
|
||||
// We might have added to many blanks when checking for = and,
|
||||
// which might lead to empty members in the array
|
||||
if(strlen($_word)==0){continue;}
|
||||
$_is_string = FALSE;
|
||||
// Anything inside quots might be more than one word
|
||||
// so as we splitted by the blanks we have to try to get those parts back
|
||||
// together
|
||||
if (substr($_word, 0, 1) == '\'' || substr($_word, 0, 1 == '"')
|
||||
&& (!isset($_temp))) {
|
||||
// start of a string
|
||||
$_temp = $_word;
|
||||
$_is_string = TRUE;
|
||||
}else {
|
||||
if(isset($_temp)) {
|
||||
// we are continuing a string
|
||||
$_temp .= $_word;
|
||||
$_is_string = TRUE;
|
||||
if (strlen($word) == 0) {
|
||||
continue;
|
||||
}
|
||||
$is_string = FALSE;
|
||||
|
||||
// Anything inside quots might be more than one word
|
||||
// so as we splitted by the blanks we have to try to get those
|
||||
// parts back together
|
||||
if ((substr($word, 0, 1) == '\'' || substr($word, 0, 1) == '"')
|
||||
&& !isset($temp)) {
|
||||
// start of a string
|
||||
$temp = $word;
|
||||
$is_string = TRUE;
|
||||
} else {
|
||||
if (isset($temp)) {
|
||||
// We are continuing a string
|
||||
$temp .= $word;
|
||||
$is_string = TRUE;
|
||||
}
|
||||
}
|
||||
if(substr($_word, strlen($_word)-1, 1) == '\''
|
||||
|| substr($_word, strlen($_word)-1, 1) == '"') {
|
||||
// End of a String
|
||||
$_word = '<font color="' . $cfg['colorStrings'] . '">' . htmlspecialchars($_temp) . '</font>';
|
||||
unset($_temp);
|
||||
// debug echo "fertig " . $_word . '<br />';
|
||||
$_is_string = FALSE;
|
||||
}
|
||||
if(!isset($_is_string) || $_is_string == FALSE) {
|
||||
// no String
|
||||
if(eregi($_sfuncs, $_word)) {
|
||||
$_word = '<font color="' . $cfg['colorFunctions'].'">' . htmlspecialchars($_word) . '</font>';
|
||||
} else if(eregi($_skeyw, $_word)) {
|
||||
$_word = '<font color="' . $cfg['colorKeywords'].'">' . htmlspecialchars($_word) . '</font>';
|
||||
if(isset($mult) && $mult == TRUE){
|
||||
} else {
|
||||
$_word = "\n" . $_word;
|
||||
} // end if... else...
|
||||
|
||||
if (substr($word, strlen($word) - 1, 1) == '\''
|
||||
|| substr($word, strlen($word) - 1, 1) == '"') {
|
||||
// End of a String
|
||||
$word = '<font color="' . $cfg['colorStrings'] . '">' . htmlspecialchars($temp) . '</font>';
|
||||
unset($temp);
|
||||
// Debug echo "fertig " . $word . '<br />';
|
||||
$is_string = FALSE;
|
||||
} // end if
|
||||
|
||||
if (!isset($is_string) || $is_string == FALSE) {
|
||||
// No String
|
||||
if (eregi($sfuncs, $word)) {
|
||||
$word = '<font color="' . $cfg['colorFunctions'].'">' . htmlspecialchars($word) . '</font>';
|
||||
} else if (eregi($skeyw, $word)) {
|
||||
$word = '<font color="' . $cfg['colorKeywords'].'">' . htmlspecialchars($word) . '</font>';
|
||||
if (!isset($mult) || $mult != TRUE) {
|
||||
$word = "\n" . $word;
|
||||
}
|
||||
} else if(eregi($_scoltype, $_word)) {
|
||||
$_word = '<font color="' . $cfg['colorColType'].'">' . htmlspecialchars($_word) . '</font>';
|
||||
} else if(eregi($_add, $_word)) {
|
||||
$_word = '<font color="' . $cfg['colorAdd'].'">' . htmlspecialchars($_word) . '</font>';
|
||||
} else if($_word=='(') {
|
||||
if(isset($_brack_o)){
|
||||
$_skey=count($_brack_o);
|
||||
} else if (eregi($scoltype, $word)) {
|
||||
$word = '<font color="' . $cfg['colorColType'].'">' . htmlspecialchars($word) . '</font>';
|
||||
} else if (eregi($add, $word)) {
|
||||
$word = '<font color="' . $cfg['colorAdd'].'">' . htmlspecialchars($word) . '</font>';
|
||||
} else if ($word == '(') {
|
||||
if (isset($brack_o)) {
|
||||
$skey = count($brack_o);
|
||||
} else {
|
||||
$_skey = 0;
|
||||
$skey = 0;
|
||||
}
|
||||
$_brack_o[$_skey]=$s_nr;
|
||||
} else if($_word==')') {
|
||||
if(isset($_brack_o)){
|
||||
unset($_brack_o[count($_brack_o)-1]);
|
||||
if(count($_brack_o)==0){ unset($_brack_o);}
|
||||
$brack_o[$skey] = $s_nr;
|
||||
} else if ($word == ')') {
|
||||
if (isset($brack_o)) {
|
||||
unset($brack_o[count($brack_o) - 1]);
|
||||
if (count($brack_o) == 0) {
|
||||
unset($brack_o);
|
||||
}
|
||||
} else {
|
||||
$_brack_c[]=$s_nr;
|
||||
$brack_c[] = $s_nr;
|
||||
}
|
||||
} else if($_word==';') {
|
||||
$_word = ";\n";
|
||||
} else if ($word == ';') {
|
||||
$word = ';' . "\n";
|
||||
}
|
||||
}
|
||||
if(!isset($_temp) || strlen($_temp) == 0) {
|
||||
$_sql_p[$s_nr] = $_word;
|
||||
|
||||
if (!isset($temp) || strlen($temp) == 0) {
|
||||
$sql_p[$s_nr] = $word;
|
||||
$s_nr++;
|
||||
}
|
||||
} // End while
|
||||
if(isset($_brack_o)) {
|
||||
while (list($_num,$elem) = each($_brack_o)) {
|
||||
$_sql_p[$elem] = '<font color="red">' . $_sql_p[$elem] . '</font>';
|
||||
} // end while
|
||||
|
||||
if (isset($brack_o)) {
|
||||
while (list($num, $elem) = each($brack_o)) {
|
||||
$sql_p[$elem] = '<font color="red">' . $sql_p[$elem] . '</font>';
|
||||
echo '<br /><font color="red">' . $GLOBALS['strMissingBracket'] . '</font><br />';
|
||||
}
|
||||
}
|
||||
if(isset($_brack_c)) {
|
||||
while (list($_num,$elem) = each($_brack_c)) {
|
||||
$_sql_p[$elem] = '<font color="red">' . $_sql_p[$elem] . '</font>';
|
||||
|
||||
if (isset($brack_c)) {
|
||||
while (list($num, $elem) = each($brack_c)) {
|
||||
$sql_p[$elem] = '<font color="red">' . $sql_p[$elem] . '</font>';
|
||||
echo '<br /><font color="red">' . $GLOBALS['strMissingBracket'] . '</font><br />';
|
||||
}
|
||||
}
|
||||
$sql = implode(' ',$_sql_p);
|
||||
|
||||
$sql = implode(' ', $_sql_p);
|
||||
$sql = ereg_replace("((\015\012)|(\015)|(\012))+", '<br />', $sql);
|
||||
$sql = ereg_replace('<br />[ ]*<br />','<br />', $sql);
|
||||
$sql = ereg_replace('<br />[ ]*<br />', '<br />', $sql);
|
||||
|
||||
return $sql;
|
||||
} // End of PMA_format_sql function
|
||||
} // end of the "PMA_format_sql()" function
|
||||
|
||||
|
||||
/**
|
||||
* Displays a MySQL error message in the right frame.
|
||||
@@ -328,12 +345,15 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
* @param boolean whether to show a "modify" link or not
|
||||
* @param string the "back" link url (full path is not required)
|
||||
*
|
||||
* @global array the configuration array
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_mysqlDie($error_message = '', $the_query = '',
|
||||
$is_modify_link = TRUE, $back_url = '')
|
||||
{
|
||||
global $cfg;
|
||||
|
||||
if (empty($GLOBALS['is_header_sent'])) {
|
||||
// rabus: If we include header.inc.php3 here, we get a huge set of
|
||||
// "Undefined variable" errors (see bug #549570)!
|
||||
@@ -358,15 +378,12 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
echo ' ' . $GLOBALS['strSQLQuery'] . ' : ' . "\n";
|
||||
if ($is_modify_link) {
|
||||
echo ' ['
|
||||
. '<a href="db_details.php3?convcharset=' . $GLOBALS['convcharset'] . '&lang=' . $GLOBALS['lang'] . '&server=' . urlencode($GLOBALS['server']) . '&db=' . urlencode($GLOBALS['db']) . '&sql_query=' . urlencode($the_query) . '&show_query=y">' . $GLOBALS['strEdit'] . '</a>'
|
||||
. '<a href="db_details.php3?lang=' . $GLOBALS['lang'] . '&convcharset=' . $GLOBALS['convcharset'] . '&server=' . urlencode($GLOBALS['server']) . '&db=' . urlencode($GLOBALS['db']) . '&sql_query=' . urlencode($the_query) . '&show_query=y">' . $GLOBALS['strEdit'] . '</a>'
|
||||
. ']' . "\n";
|
||||
} // end if
|
||||
if($cfg['UseSyntaxColoring']){
|
||||
echo '<p>' . "\n" . PMA_format_sql($query_base) . "\n" . '</p>' . "\n";
|
||||
} else {
|
||||
echo '<p>' . "\n" . $query_base . "\n" . '</p>' . "\n";
|
||||
}
|
||||
echo '</p>' . "\n";
|
||||
echo '<p>' . "\n"
|
||||
. ' ' . ($cfg['UseSyntaxColoring'] ? PMA_format_sql($query_base) : $query_base) . "\n"
|
||||
. '</p>' . "\n";
|
||||
} // end if
|
||||
if (!empty($error_message)) {
|
||||
$error_message = htmlspecialchars($error_message);
|
||||
@@ -489,29 +506,25 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
* set properly and, depending on browsers, inserting or updating a
|
||||
* record might fail
|
||||
*/
|
||||
$display_pmaAbsoluteUri_warning = 0;
|
||||
|
||||
$DisplayPmaAbsoluteUriWarning = 0;
|
||||
|
||||
// Olivier: Setup a default value to let the people and lazy syadmins
|
||||
// work anyway, but display a big warning on the main.php3
|
||||
// page.
|
||||
if (empty($cfg['PmaAbsoluteUri'])) {
|
||||
|
||||
// Setup a default value to let the people and lazy syadmins work anyway,
|
||||
// but display a big warning on the main.php3 page. --Olivier
|
||||
|
||||
$cfg['PmaAbsoluteUri'] = (!empty($HTTP_SERVER_VARS['HTTPS']) ? 'https' : 'http') . '://'
|
||||
. $HTTP_SERVER_VARS['SERVER_NAME']
|
||||
. (!empty($HTTP_SERVER_VARS['SERVER_PORT']) ? ':' . $HTTP_SERVER_VARS['SERVER_PORT'] : '')
|
||||
. substr($HTTP_SERVER_VARS['SCRIPT_NAME'], 0, strrpos($HTTP_SERVER_VARS['SCRIPT_NAME'], '/')+1);
|
||||
|
||||
// We display the warning by default, but not if it is disabled thru
|
||||
// via the $cfg['PmaAbsoluteUri_DisableWarning'] variable.
|
||||
// This is intended for sysadmins that actually want the default behaviour
|
||||
// of auto-detection due to their setup.
|
||||
// See the mailing list message:
|
||||
// http://sourceforge.net/mailarchive/forum.php?thread_id=859093&forum_id=2141
|
||||
$cfg['PmaAbsoluteUri'] = (!empty($HTTP_SERVER_VARS['HTTPS']) ? 'https' : 'http') . '://'
|
||||
. $HTTP_SERVER_VARS['HTTP_HOST']
|
||||
. (!empty($HTTP_SERVER_VARS['SERVER_PORT']) ? ':' . $HTTP_SERVER_VARS['SERVER_PORT'] : '')
|
||||
. substr($PHP_SELF, 0, strrpos($PHP_SELF, '/') + 1);
|
||||
// We display the warning by default, but not if it is disabled thru
|
||||
// via the $cfg['PmaAbsoluteUri_DisableWarning'] variable.
|
||||
// This is intended for sysadmins that actually want the default
|
||||
// behaviour of auto-detection due to their setup.
|
||||
// See the mailing list message:
|
||||
// http://sourceforge.net/mailarchive/forum.php?thread_id=859093&forum_id=2141
|
||||
if ($cfg['PmaAbsoluteUri_DisableWarning'] === FALSE) {
|
||||
$DisplayPmaAbsoluteUriWarning = 1;
|
||||
$display_pmaAbsoluteUri_warning = 1;
|
||||
}
|
||||
|
||||
}
|
||||
// Adds a trailing slash et the end of the phpMyAdmin uri if it does not
|
||||
// exist
|
||||
@@ -524,13 +537,12 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
* Make sure $cfg['DefaultTabDatabase'] and $cfg['DefaultTabTable'] are set.
|
||||
* Todo: check if it is set to a *valid* value.
|
||||
*/
|
||||
|
||||
if (empty($cfg['DefaultTabDatabase'])) {
|
||||
$cfg['DefaultTabDatabase'] = 'db_details_structure.php3';
|
||||
}
|
||||
|
||||
if (empty($cfg['DefaultTabTable'])) {
|
||||
$cfg['DefaultTabTable'] = 'tbl_properties_structure.php3';
|
||||
$cfg['DefaultTabTable'] = 'tbl_properties_structure.php3';
|
||||
}
|
||||
|
||||
|
||||
@@ -604,7 +616,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
if (isset($cfg['Server']['AllowDeny']) && $cfg['Server']['AllowDeny']['order']) {
|
||||
include('./libraries/ip_allow_deny.lib.php3');
|
||||
|
||||
$allowDeny_forbidden = FALSE; //default
|
||||
$allowDeny_forbidden = FALSE; // default
|
||||
if ($cfg['Server']['AllowDeny']['order'] == 'allow,deny') {
|
||||
$allowDeny_forbidden = TRUE;
|
||||
if (PMA_allowDeny('allow')) {
|
||||
@@ -942,7 +954,8 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
*
|
||||
* @param mixed the database, table or field name to "backquote" or
|
||||
* array of it
|
||||
* @param boolean a flag to bypass this function (used by dump functions)
|
||||
* @param boolean a flag to bypass this function (used by dump
|
||||
* functions)
|
||||
*
|
||||
* @return mixed the "backquoted" database, table or field name if the
|
||||
* current MySQL release is >= 3.23.6, the original one
|
||||
@@ -959,7 +972,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
if (is_array($a_name)) {
|
||||
$result = array();
|
||||
reset($a_name);
|
||||
while(list($key,$val) = each($a_name)) {
|
||||
while(list($key, $val) = each($a_name)) {
|
||||
$result[$key] = '`' . $val . '`';
|
||||
}
|
||||
return $result;
|
||||
@@ -1061,17 +1074,20 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
|
||||
*
|
||||
* @param string the message to display
|
||||
*
|
||||
* @global array the configuration array
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_showMessage($message)
|
||||
{
|
||||
global $cfg;
|
||||
|
||||
// Reloads the navigation frame via JavaScript if required
|
||||
if (isset($GLOBALS['reload']) && $GLOBALS['reload']) {
|
||||
echo "\n";
|
||||
$reload_url = './left.php3'
|
||||
. '?convcharset=' . $GLOBALS['convcharset']
|
||||
. '&lang=' . $GLOBALS['lang']
|
||||
. '?lang=' . $GLOBALS['lang']
|
||||
. '&convcharset=' . $GLOBALS['convcharset']
|
||||
. '&server=' . $GLOBALS['server']
|
||||
. ((!empty($GLOBALS['db'])) ? '&db=' . urlencode($GLOBALS['db']) : '');
|
||||
?>
|
||||
@@ -1084,7 +1100,7 @@ window.parent.frames['nav'].location.replace('<?php echo $reload_url; ?>');
|
||||
}
|
||||
|
||||
// Corrects the tooltip text via JS if required
|
||||
else if (isset($GLOBALS['table']) && $GLOBALS['cfg']['ShowTooltip'] && PMA_MYSQL_INT_VERSION >= 32303) {
|
||||
else if (isset($GLOBALS['table']) && $cfg['ShowTooltip'] && PMA_MYSQL_INT_VERSION >= 32303) {
|
||||
$result = @PMA_mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($GLOBALS['db']) . ' LIKE \'' . PMA_sqlAddslashes($GLOBALS['table'], TRUE) . '\'');
|
||||
if ($result) {
|
||||
$tmp = PMA_mysql_fetch_array($result, MYSQL_ASSOC);
|
||||
@@ -1113,17 +1129,17 @@ if (typeof(document.getElementById) != 'undefined'
|
||||
echo "\n";
|
||||
?>
|
||||
<div align="<?php echo $GLOBALS['cell_align_left']; ?>">
|
||||
<table border="<?php echo $GLOBALS['cfg']['Border']; ?>" cellpadding="5">
|
||||
<table border="<?php echo $cfg['Border']; ?>" cellpadding="5">
|
||||
<tr>
|
||||
<td bgcolor="<?php echo $GLOBALS['cfg']['ThBgcolor']; ?>">
|
||||
<td bgcolor="<?php echo $cfg['ThBgcolor']; ?>">
|
||||
<b><?php echo (get_magic_quotes_gpc()) ? stripslashes($message) : $message; ?></b><br />
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($GLOBALS['cfg']['ShowSQL'] == TRUE && !empty($GLOBALS['sql_query'])) {
|
||||
if ($cfg['ShowSQL'] == TRUE && !empty($GLOBALS['sql_query'])) {
|
||||
// Basic url query part
|
||||
$url_qpart = '?lang=' . $GLOBALS['lang']
|
||||
. '&convcharset=' . $GLOBALS['convcharset']
|
||||
$url_qpart = '?convcharset=' . $GLOBALS['convcharset']
|
||||
. '&lang=' . $GLOBALS['lang']
|
||||
. '&server=' . $GLOBALS['server']
|
||||
. ((!empty($GLOBALS['db'])) ? '&db=' . urlencode($GLOBALS['db']) : '')
|
||||
. ((!empty($GLOBALS['table'])) ? '&table=' . urlencode($GLOBALS['table']) : '');
|
||||
@@ -1131,7 +1147,7 @@ if (typeof(document.getElementById) != 'undefined'
|
||||
echo "\n";
|
||||
?>
|
||||
<tr>
|
||||
<td bgcolor="<?php echo $GLOBALS['cfg']['BgcolorOne']; ?>">
|
||||
<td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
|
||||
<?php
|
||||
echo "\n";
|
||||
// Html format the query to be displayed
|
||||
@@ -1141,23 +1157,19 @@ if (typeof(document.getElementById) != 'undefined'
|
||||
$sqlnr = 1;
|
||||
if (!empty($GLOBALS['show_as_php'])) {
|
||||
$new_line = '";<br />' . "\n" . ' $sql .= "';
|
||||
}else{
|
||||
if($cfg['UseSyntaxColoring'] == FALSE){
|
||||
$new_line = "<br />\n";
|
||||
}
|
||||
} else if ($cfg['UseSyntaxColoring'] == FALSE) {
|
||||
$new_line = '<br />' . "\n";
|
||||
}
|
||||
if(isset($new_line)){
|
||||
$query_base = htmlspecialchars($GLOBALS['sql_query']);
|
||||
$query_base = ereg_replace("((\015\012)|(\015)|(\012))+", $new_line, $query_base);
|
||||
}else{
|
||||
$query_base = $GLOBALS['sql_query'];
|
||||
if (isset($new_line)) {
|
||||
$query_base = htmlspecialchars($GLOBALS['sql_query']);
|
||||
$query_base = ereg_replace("((\015\012)|(\015)|(\012))+", $new_line, $query_base);
|
||||
} else {
|
||||
$query_base = $GLOBALS['sql_query'];
|
||||
}
|
||||
if (!empty($GLOBALS['show_as_php'])) {
|
||||
$query_base = '$sql = "' . $query_base;
|
||||
} else {
|
||||
if($cfg['UseSyntaxColoring']) {
|
||||
$query_base = PMA_format_sql($query_base);
|
||||
}
|
||||
} else if ($cfg['UseSyntaxColoring']) {
|
||||
$query_base = PMA_format_sql($query_base);
|
||||
}
|
||||
|
||||
// Prepares links that may be displayed to edit/explain the query
|
||||
@@ -1183,7 +1195,7 @@ if (typeof(document.getElementById) != 'undefined'
|
||||
if (!eregi('^EXPLAIN[[:space:]]+', $GLOBALS['sql_query'])) {
|
||||
$explain_link = '[<a href="sql.php3'
|
||||
. $url_qpart
|
||||
. '&sql_query=' . urlencode('EXPLAIN '.$GLOBALS['sql_query']) . '">' . $GLOBALS['strExplain'] . '</a>] ';
|
||||
. '&sql_query=' . urlencode('EXPLAIN ' . $GLOBALS['sql_query']) . '">' . $GLOBALS['strExplain'] . '</a>] ';
|
||||
} else {
|
||||
$explain_link = '';
|
||||
}
|
||||
@@ -1358,34 +1370,47 @@ if (typeof(document.getElementById) != 'undefined'
|
||||
return strftime($date, $timestamp);
|
||||
} // end of the 'PMA_localisedDate()' function
|
||||
|
||||
|
||||
/**
|
||||
* Prints out a tab for tabbed navigation.
|
||||
* If the variables $link and $args ar left empty, an inactive tab is created
|
||||
*
|
||||
* @param $text the text to be displayed as link
|
||||
* @param $link main link file, e.g. "test.php3"
|
||||
* @param $args link arguments
|
||||
* @param string the text to be displayed as link
|
||||
* @param string main link file, e.g. "test.php3"
|
||||
* @param string link arguments
|
||||
* @param string link attributes
|
||||
*
|
||||
* @return string two table cells, the first beeing a separator, the second the tab itself
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function printTab($text,$link,$args="",$attr="") {
|
||||
function PMA_printTab($text, $link, $args = '', $attr = '') {
|
||||
global $PHP_SELF;
|
||||
global $db_details_links_count_tabs;
|
||||
|
||||
$bgcolor = (basename($PHP_SELF) == $link) ? "silver" : "#DFDFDF";
|
||||
$bgcolor = (basename($PHP_SELF) == $link) ? 'silver' : '#DFDFDF';
|
||||
$db_details_links_count_tabs++;
|
||||
if (!empty($attr)) {
|
||||
$attr = ' ' . $attr;
|
||||
}
|
||||
|
||||
$out = "\n" . ' '
|
||||
. '<td bgcolor="' . $bgcolor . '" align="center" width="64" nowrap="nowrap" class="tab">'
|
||||
. "\n" . ' ';
|
||||
if (strlen($link) > 0) {
|
||||
$out .= '<a href="' . $link . '?' . $args . '"' . $attr . '>'
|
||||
. '<b>' . $text . '</b></a>';
|
||||
} else {
|
||||
$out .= '<b>' . $text . '</b>';
|
||||
}
|
||||
$out .= "\n" . ' '
|
||||
. '</td>'
|
||||
. "\n" . ' '
|
||||
. '<td width="8"> </td>';
|
||||
|
||||
$out = "\n\t\t<td bgcolor=\"$bgcolor\" align=\"center\" width=\"64\" nowrap=\"nowrap\" class=\"tab\">";
|
||||
if (strlen($link)>0)
|
||||
$out .= "<a href=\"$link?$args\" $attr><b>$text</b></a>";
|
||||
else
|
||||
$out .= "<b>$text</b>";
|
||||
$out .= "</td>";
|
||||
$out .= "\n\t\t<td width=\"8\"> </td>";
|
||||
return $out;
|
||||
}
|
||||
} // end of the 'PMA_printTab()' function
|
||||
|
||||
|
||||
|
||||
// Kanji encoding convert feature appended by Y.Kawada (2002/2/20)
|
||||
|
@@ -5,7 +5,7 @@
|
||||
/**
|
||||
* This library grabs the names and values of the variables sent or posted to a
|
||||
* script in the '$HTTP_*_VARS' arrays and sets simple globals variables from
|
||||
* them
|
||||
* them. It does the same work for the $PHP_SELF variable.
|
||||
*
|
||||
* loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
|
||||
*/
|
||||
@@ -34,5 +34,11 @@ if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
|
||||
}
|
||||
} // end if
|
||||
|
||||
if (!empty($_SERVER) && isset($_SERVER['PHP_SELF'])) {
|
||||
$PHP_SELF = $_SERVER['PHP_SELF'];
|
||||
} else if (!empty($HTTP_SERVER_VARS) && isset($HTTP_SERVER_VARS['PHP_SELF'])) {
|
||||
$PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
|
||||
} // end if
|
||||
|
||||
} // $__PMA_GRAB_GLOBALS_LIB__
|
||||
?>
|
26
main.php3
26
main.php3
@@ -251,7 +251,7 @@ if ($server > 0) {
|
||||
$db_to_create = '';
|
||||
}
|
||||
|
||||
$common_url_query = 'lang=' . $lang . '&server=' . $server . '&convcharset=' . $convcharset;
|
||||
$common_url_query = 'lang=' . $lang . '&convcharset=' . $convcharset . '&server=' . $server;
|
||||
|
||||
if ($is_superuser) {
|
||||
$cfg['ShowMysqlInfo'] = TRUE;
|
||||
@@ -446,8 +446,8 @@ if (empty($cfg['Lang'])) {
|
||||
<td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
|
||||
<td nowrap="nowrap">
|
||||
<form method="post" action="index.php3" target="_parent">
|
||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||
Language <a href="./translators.html" target="documentation">(*)</a>:
|
||||
<select name="lang" dir="ltr" onchange="this.form.submit();">
|
||||
<?php
|
||||
@@ -488,11 +488,11 @@ if (empty($cfg['Lang'])) {
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
echo "\n";
|
||||
?>
|
||||
<?php
|
||||
if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding) {
|
||||
?>
|
||||
|
||||
if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding']
|
||||
&& $allow_recoding) {
|
||||
echo "\n";
|
||||
?>
|
||||
<!-- Charset Selection -->
|
||||
<tr>
|
||||
<td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
|
||||
@@ -521,8 +521,8 @@ if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $al
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
echo "\n";
|
||||
}
|
||||
echo "\n";
|
||||
?>
|
||||
|
||||
<!-- Documentation -->
|
||||
@@ -566,12 +566,14 @@ echo "\n";
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
if ($DisplayPmaAbsoluteUriWarning) {
|
||||
echo '<p class="warning">'. $strPmaUriError . '</p>' . "\n";
|
||||
/**
|
||||
* Displays the "empty $cfg['PmaAbsoluteUri'] warning"
|
||||
*/
|
||||
if ($display_pmaAbsoluteUri_warning) {
|
||||
echo '<p class="warning">' . $strPmaUriError . '</p>' . "\n";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
|
344
pdf_pages.php3
344
pdf_pages.php3
@@ -1,9 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* pdf_pages.php3 mikebeck 2002-05-23
|
||||
* create and edit the pages to output in pdf
|
||||
*
|
||||
*/
|
||||
/* $Id$ */
|
||||
|
||||
|
||||
/**
|
||||
* Gets some core libraries
|
||||
*/
|
||||
@@ -12,209 +10,249 @@ require('./libraries/common.lib.php3');
|
||||
include('./db_details_common.php3');
|
||||
|
||||
/**
|
||||
* Settings for Relationstuff
|
||||
* Settings for relation stuff
|
||||
*/
|
||||
require('./libraries/relation.lib.php3');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
|
||||
/**
|
||||
* now in ./libraries/relation.lib.php3 we check for all tables
|
||||
* Now in ./libraries/relation.lib.php3 we check for all tables
|
||||
* that we need, but if we don't find them we are quiet about it
|
||||
* so people can work without.
|
||||
* this page is absolutely useless if you didn't set up your tables
|
||||
* This page is absolutely useless if you didn't set up your tables
|
||||
* correctly, so it is a good place to see which tables we can and
|
||||
* complain ;-)
|
||||
*/
|
||||
|
||||
if(!$cfgRelation['relwork']) {
|
||||
echo sprintf($strNotSet,'relation','config.inc.php3') . '<br /><a href="Documentation.html#relation" target="documentation">' . $strDocu . '</a>';
|
||||
die();
|
||||
}
|
||||
if(!$cfgRelation['displaywork']) {
|
||||
echo sprintf($strNotSet,'table_info','config.inc.php3') . '<br /><a href="Documentation.html#table_info" target="documentation">' . $strDocu . '</a>';
|
||||
die();
|
||||
}
|
||||
if(!isset($cfgRelation['table_coords'])){
|
||||
echo sprintf($strNotSet,'table_coords','config.inc.php3') . '<br /><a href="Documentation.html#table_coords" target="documentation">' . $strDocu . '</a>';
|
||||
die();
|
||||
}
|
||||
if(!isset($cfgRelation['pdf_pages'])) {
|
||||
echo sprintf($strNotSet,'pdf_page','config.inc.php3') . '<br /><a href="Documentation.html#pdf_pages" target="documentation">' . $strDocu . '</a>';
|
||||
die();
|
||||
if (!$cfgRelation['relwork']) {
|
||||
echo sprintf($strNotSet, 'relation', 'config.inc.php3') . '<br />' . "\n"
|
||||
. '<a href="./Documentation.html#relation" target="documentation">' . $strDocu . '</a>' . "\n";
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($cfgRelation['pdfwork']){
|
||||
// now is the time to work on all changes
|
||||
if(isset($do)){
|
||||
switch($do){
|
||||
if (!$cfgRelation['displaywork']) {
|
||||
echo sprintf($strNotSet, 'table_info', 'config.inc.php3') . '<br />' . "\n"
|
||||
. '<a href="./Documentation.html#table_info" target="documentation">' . $strDocu . '</a>' . "\n";
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!isset($cfgRelation['table_coords'])){
|
||||
echo sprintf($strNotSet, 'table_coords', 'config.inc.php3') . '<br />' . "\n"
|
||||
. '<a href="./Documentation.html#table_coords" target="documentation">' . $strDocu . '</a>' . "\n";
|
||||
exit();
|
||||
}
|
||||
if (!isset($cfgRelation['pdf_pages'])) {
|
||||
echo sprintf($strNotSet, 'pdf_page', 'config.inc.php3') . '<br />' . "\n"
|
||||
. '<a href="./Documentation.html#pdf_pages" target="documentation">' . $strDocu . '</a>' . "\n";
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($cfgRelation['pdfwork']) {
|
||||
// Now is the time to work on all changes
|
||||
if (isset($do)) {
|
||||
switch ($do) {
|
||||
case 'createpage':
|
||||
if(!isset($newpage) || $newpage==''){
|
||||
if (!isset($newpage) || $newpage == '') {
|
||||
$newpage = $strNoDescription;
|
||||
}
|
||||
$ins_query = 'INSERT INTO ' . PMA_backquote($cfgRelation['pdf_pages'])
|
||||
. ' (db_name,page_descr) '
|
||||
. ' VALUES (\'' . $db . '\',\'' . $newpage . '\')';
|
||||
$ins_query = 'INSERT INTO ' . PMA_backquote($cfgRelation['pdf_pages'])
|
||||
. ' (db_name, page_descr)'
|
||||
. ' VALUES (\'' . PMA_sqlAddslashes($db) . '\', \'' . PMA_sqlAddslashes($newpage) . '\')';
|
||||
PMA_query_as_cu($ins_query);
|
||||
break;
|
||||
case 'edcoord':
|
||||
while (list($key,$arrvalue) = each($ctable)) {
|
||||
if(!isset($arrvalue['x']) || $arrvalue['x'] == ''){$arrvalue['x']=0;}
|
||||
if(!isset($arrvalue['y']) || $arrvalue['y'] == ''){$arrvalue['y']=0;}
|
||||
if(isset($arrvalue['name']) && $arrvalue['name'] != '--'){
|
||||
|
||||
$test_query = 'SELECT * FROM '.PMA_backquote($cfgRelation['table_coords'])
|
||||
. ' WHERE db_name = \'' . $db . '\''
|
||||
. ' AND table_name = \'' . $arrvalue['name'] . '\'' .
|
||||
' AND pdf_page_number = '.$chpage;
|
||||
$test_rs = PMA_query_as_cu($test_query);
|
||||
if(mysql_num_rows($test_rs)>0){
|
||||
if(isset($arrvalue['delete']) && $arrvalue['delete'] == 'y'){
|
||||
$ch_query = 'DELETE FROM '.PMA_backquote($cfgRelation['table_coords'])
|
||||
. ' WHERE db_name = \'' . $db . '\''
|
||||
. ' AND table_name = \''.$arrvalue['name'] . '\''
|
||||
. ' AND pdf_page_number = '.$chpage;
|
||||
}else{
|
||||
$ch_query = 'UPDATE '.PMA_backquote($cfgRelation['table_coords'])
|
||||
. ' SET x='.$arrvalue['x'] . ', y= '. $arrvalue['y']
|
||||
. ' WHERE db_name = \'' . $db . '\''
|
||||
. ' AND table_name = \''.$arrvalue['name'] . '\''
|
||||
. ' AND pdf_page_number = '.$chpage;
|
||||
case 'edcoord':
|
||||
while (list($key, $arrvalue) = each($ctable)) {
|
||||
if (!isset($arrvalue['x']) || $arrvalue['x'] == '') {
|
||||
$arrvalue['x'] = 0;
|
||||
}
|
||||
if (!isset($arrvalue['y']) || $arrvalue['y'] == '') {
|
||||
$arrvalue['y'] = 0;
|
||||
}
|
||||
if (isset($arrvalue['name']) && $arrvalue['name'] != '--') {
|
||||
$test_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['table_coords'])
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND table_name = \'' . PMA_sqlAddslashes($arrvalue['name']) . '\''
|
||||
. ' AND pdf_page_number = ' . $chpage;
|
||||
$test_rs = PMA_query_as_cu($test_query);
|
||||
if ($test_rs && mysql_num_rows($test_rs) > 0) {
|
||||
if (isset($arrvalue['delete']) && $arrvalue['delete'] == 'y') {
|
||||
$ch_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['table_coords'])
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND table_name = \'' . PMA_sqlAddslashes($arrvalue['name']) . '\''
|
||||
. ' AND pdf_page_number = ' . $chpage;
|
||||
} else {
|
||||
$ch_query = 'UPDATE ' . PMA_backquote($cfgRelation['table_coords']) . ' '
|
||||
. 'SET x = ' . $arrvalue['x'] . ', y= ' . $arrvalue['y']
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND table_name = \'' . PMA_sqlAddslashes($arrvalue['name']) . '\''
|
||||
. ' AND pdf_page_number = ' . $chpage;
|
||||
}
|
||||
}else{
|
||||
$ch_query = 'INSERT INTO '.PMA_backquote($cfgRelation['table_coords'])
|
||||
. ' (db_name,table_name,pdf_page_number,x,y) '
|
||||
. ' VALUES (\'' . $db . '\',\''.$arrvalue['name'].'\','
|
||||
. $chpage.','
|
||||
. $arrvalue['x'].','.$arrvalue['y'].')';
|
||||
} else {
|
||||
$ch_query = 'INSERT INTO ' . PMA_backquote($cfgRelation['table_coords']) . ' '
|
||||
. '(db_name, table_name, pdf_page_number, x, y) '
|
||||
. 'VALUES (\'' . PMA_sqlAddslashes($db) . '\', \'' . PMA_sqlAddslashes($arrvalue['name']) . '\',' . $chpage . ',' . $arrvalue['x'] . ',' . $arrvalue['y'] . ')';
|
||||
}
|
||||
PMA_query_as_cu($ch_query);
|
||||
}
|
||||
}
|
||||
} // end if
|
||||
} // end while
|
||||
break;
|
||||
}
|
||||
} // End if (isset($do))
|
||||
} // end switch
|
||||
} // end if (isset($do))
|
||||
|
||||
// we will need an array of all tables in this db
|
||||
// We will need an array of all tables in this db
|
||||
$selectboxall[] = '--';
|
||||
$alltab_qry = 'SHOW TABLES FROM ' . PMA_backquote($db);
|
||||
$alltab_rs = @PMA_mysql_query($alltab_qry) or PMA_mysqlDie('', $alltab_qry, '', $err_url_0);
|
||||
$alltab_qry = 'SHOW TABLES FROM ' . PMA_backquote($db);
|
||||
$alltab_rs = @PMA_mysql_query($alltab_qry) or PMA_mysqlDie('', $alltab_qry, '', $err_url_0);
|
||||
while (list($table) = @PMA_mysql_fetch_array($alltab_rs)) {
|
||||
$selectboxall[] = $table;
|
||||
}
|
||||
|
||||
// now first show some possibility to choose a page for the pdf
|
||||
// Now first show some possibility to choose a page for the pdf
|
||||
$page_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['pdf_pages'])
|
||||
. ' WHERE db_name = \'' . $db . '\'';
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
|
||||
$page_rs = PMA_query_as_cu($page_query);
|
||||
if(mysql_num_rows($page_rs)>0){
|
||||
if ($page_rs && mysql_num_rows($page_rs) > 0) {
|
||||
?>
|
||||
<form action="pdf_pages.php3" method="post" name="selpage">
|
||||
<?php echo $strChoosePage; ?>
|
||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||
<input type="hidden" name="table" value="<?php echo $table; ?>" />
|
||||
<input type="hidden" name="do" value="choosepage" />
|
||||
<select name="chpage" onChange="this.form.submit()">
|
||||
<form action="pdf_pages.php3" method="post" name="selpage">
|
||||
<?php echo $strChoosePage . "\n"; ?>
|
||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||
<input type="hidden" name="table" value="<?php echo $table; ?>" />
|
||||
<input type="hidden" name="do" value="choosepage" />
|
||||
<select name="chpage" onchange="this.form.submit()">
|
||||
<?php
|
||||
while ($curr_page = @PMA_mysql_fetch_array($page_rs)) {
|
||||
echo '<option value="'.$curr_page['page_nr'].'"';
|
||||
if (isset($chpage) && $chpage==$curr_page['page_nr']) {
|
||||
echo ' selected="selected"';
|
||||
}
|
||||
echo '>';
|
||||
echo $curr_page['page_nr'] . ': '.$curr_page['page_descr'].'</option>';
|
||||
}
|
||||
echo "\n" . ' '
|
||||
. '<option value="' . $curr_page['page_nr'] . '"';
|
||||
if (isset($chpage) && $chpage == $curr_page['page_nr']) {
|
||||
echo ' selected="selected"';
|
||||
}
|
||||
echo '>' . $curr_page['page_nr'] . ': ' . $curr_page['page_descr'] . '</option>';
|
||||
} // end while
|
||||
echo "\n";
|
||||
?>
|
||||
</select>
|
||||
<input type="submit" value="<?php echo $strGo; ?>" />
|
||||
</form>
|
||||
</select>
|
||||
<input type="submit" value="<?php echo $strGo; ?>" />
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
// possibility to create a new page:
|
||||
echo "\n";
|
||||
|
||||
// Possibility to create a new page:
|
||||
?>
|
||||
<form action="pdf_pages.php3" method="post" name="crpage">
|
||||
<?php echo $strCreatePage; ?>
|
||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||
<input type="hidden" name="table" value="<?php echo $table; ?>" />
|
||||
<input type="hidden" name="do" value="createpage" />
|
||||
<input type="text" name="newpage" size="20" maxlength="50" />
|
||||
<input type="submit" value="<?php echo $strGo; ?>" />
|
||||
</form>
|
||||
<form action="pdf_pages.php3" method="post" name="crpage">
|
||||
<?php echo $strCreatePage . "\n"; ?>
|
||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||
<input type="hidden" name="table" value="<?php echo $table; ?>" />
|
||||
<input type="hidden" name="do" value="createpage" />
|
||||
<input type="text" name="newpage" size="20" maxlength="50" />
|
||||
<input type="submit" value="<?php echo $strGo; ?>" />
|
||||
</form>
|
||||
<?php
|
||||
// now if we allready have choosen a pagenumer then we should show the tables involved
|
||||
if(isset($chpage) && $chpage>0){
|
||||
// Now if we allready have choosen a page number then we should show the
|
||||
// tables involved
|
||||
if (isset($chpage) && $chpage > 0) {
|
||||
echo "\n";
|
||||
?>
|
||||
<hr /><h2><?php echo $strSelectTables ;?></h2>
|
||||
<form action="pdf_pages.php3" method="post" name="edcoord">
|
||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||
<input type="hidden" name="table" value="<?php echo $table; ?>" />
|
||||
<input type="hidden" name="chpage" value="<?php echo $chpage; ?>" />
|
||||
<input type="hidden" name="do" value="edcoord" />
|
||||
<table border=0>
|
||||
<tr><th><?php echo $strTable;?></th><th><?php echo $strDelete;?></th><th>X</th><th>Y</th></tr>
|
||||
<hr />
|
||||
|
||||
<h2><?php echo $strSelectTables ;?></h2>
|
||||
<form action="pdf_pages.php3" method="post" name="edcoord">
|
||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||
<input type="hidden" name="table" value="<?php echo $table; ?>" />
|
||||
<input type="hidden" name="chpage" value="<?php echo $chpage; ?>" />
|
||||
<input type="hidden" name="do" value="edcoord" />
|
||||
<table border="0">
|
||||
<tr>
|
||||
<th><?php echo $strTable; ?></th>
|
||||
<th><?php echo $strDelete; ?></th>
|
||||
<th>X</th>
|
||||
<th>Y</th>
|
||||
</tr>
|
||||
<?php
|
||||
if(isset($ctable)){unset($ctable);}
|
||||
if (isset($ctable)) {
|
||||
unset($ctable);
|
||||
}
|
||||
|
||||
$page_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['table_coords'])
|
||||
. ' WHERE db_name = \'' . $db . '\''
|
||||
. ' AND pdf_page_number=' . $chpage;
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND pdf_page_number = ' . $chpage;
|
||||
$page_rs = PMA_query_as_cu($page_query);
|
||||
|
||||
$i=0;
|
||||
$i = 0;
|
||||
while ($sh_page = @PMA_mysql_fetch_array($page_rs)) {
|
||||
echo '<tr ';
|
||||
if($i % 2==0){
|
||||
echo 'bgcolor="'.$cfg['BgcolorOne'].'"';
|
||||
}else{
|
||||
echo 'bgcolor="'.$cfg['BgcolorTwo'].'"';
|
||||
echo "\n" . ' <tr ';
|
||||
if ($i % 2 == 0) {
|
||||
echo 'bgcolor="' . $cfg['BgcolorOne'] . '"';
|
||||
} else {
|
||||
echo 'bgcolor="' . $cfg['BgcolorTwo'] . '"';
|
||||
}
|
||||
echo '>';
|
||||
echo '<td><select name="ctable['.$i.'][name]">';
|
||||
echo "\n" . ' <td>'
|
||||
. "\n" . ' <select name="ctable[' . $i . '][name]">';
|
||||
reset($selectboxall);
|
||||
while (list($key,$value) = each($selectboxall)) {
|
||||
echo '<option value="'.$value.'"';
|
||||
if($value==$sh_page['table_name']){
|
||||
while (list($key, $value) = each($selectboxall)) {
|
||||
echo "\n" . ' <option value="' . $value . '"';
|
||||
if ($value == $sh_page['table_name']) {
|
||||
echo ' selected="selected"';
|
||||
}
|
||||
echo '>'.$value.'</option>'."\n";
|
||||
}
|
||||
echo '</select></td>'."\n";
|
||||
echo '<td><INPUT type="checkbox" name="ctable['.$i.'][delete]" value="y" />'.$strDelete.'</td>'."\n";
|
||||
echo '<td><INPUT type="text" name="ctable['.$i.'][x]" value="'.$sh_page['x'].'"></td>'."\n";
|
||||
echo '<td><INPUT type="text" name="ctable['.$i.'][y]" value="'.$sh_page['y'].'"></td>'."\n";
|
||||
echo '</tr>'."\n";
|
||||
echo '>' . $value . '</option>';
|
||||
} // end while
|
||||
echo "\n" . ' </select>'
|
||||
. "\n" . ' </td>';
|
||||
echo "\n" . ' <td>'
|
||||
. "\n" . ' <input type="checkbox" name="ctable[' . $i . '][delete]" value="y" />' . $strDelete;
|
||||
echo "\n" . ' </td>';
|
||||
echo "\n" . ' <td>'
|
||||
. "\n" . ' <input type="text" name="ctable[' . $i . '][x]" value="' . $sh_page['x'] . '" />';
|
||||
echo "\n" . ' </td>';
|
||||
echo "\n" . ' <td>'
|
||||
. "\n" . ' <input type="text" name="ctable[' . $i . '][y]" value="' . $sh_page['y'] . '" />';
|
||||
echo "\n" . ' </td>';
|
||||
echo "\n" . ' </tr>';
|
||||
$i++;
|
||||
}
|
||||
// do one more empty row
|
||||
echo '<tr ';
|
||||
if($i % 2==0){
|
||||
echo 'bgcolor="'.$cfg['BgcolorOne'].'"';
|
||||
}else{
|
||||
echo 'bgcolor="'.$cfg['BgcolorTwo'].'"';
|
||||
} // end while
|
||||
// Do one more empty row
|
||||
echo "\n" . ' <tr ';
|
||||
if ($i % 2 == 0) {
|
||||
echo 'bgcolor="' . $cfg['BgcolorOne'] . '"';
|
||||
} else {
|
||||
echo 'bgcolor="' . $cfg['BgcolorTwo'] . '"';
|
||||
}
|
||||
echo '>';
|
||||
echo '<td><select name="ctable['.$i.'][name]">';
|
||||
echo "\n" . ' <td>'
|
||||
. "\n" . ' <select name="ctable[' . $i . '][name]">';
|
||||
reset($selectboxall);
|
||||
while (list($key,$value) = each($selectboxall)) {
|
||||
echo '<option value="'.$value.'"';
|
||||
echo '>'.$value.'</option>'."\n";
|
||||
while (list($key, $value) = each($selectboxall)) {
|
||||
echo "\n" . ' <option value="' . $value . '">' . $value . '</option>';
|
||||
}
|
||||
echo '</select></td>'."\n";
|
||||
echo '<td><INPUT type="checkbox" name="ctable['.$i.'][delete]" value="y" />'.$strDelete.'</td>'."\n";
|
||||
echo '<td><INPUT type="text" name="ctable['.$i.'][x]"></td>'."\n";
|
||||
echo '<td><INPUT type="text" name="ctable['.$i.'][y]"></td>'."\n";
|
||||
echo '</tr>'."\n";
|
||||
echo '</table><input type="submit" value="'.$strGo.'" /></form>'."\n";
|
||||
}
|
||||
}
|
||||
echo "\n" . ' </select>'
|
||||
. "\n" . ' </td>';
|
||||
echo "\n" . ' <td>'
|
||||
. "\n" . ' <input type="checkbox" name="ctable[' . $i . '][delete]" value="y" />' . $strDelete;
|
||||
echo "\n" . ' </td>';
|
||||
echo "\n" . ' <td>'
|
||||
. "\n" . ' <input type="text" name="ctable[' . $i . '][x]" value="' . $sh_page['x'] . '" />';
|
||||
echo "\n" . ' </td>';
|
||||
echo "\n" . ' <td>'
|
||||
. "\n" . ' <input type="text" name="ctable[' . $i . '][y]" value="' . $sh_page['y'] . '" />';
|
||||
echo "\n" . ' </td>';
|
||||
echo "\n" . ' </tr>';
|
||||
echo "\n" . ' </table>' . "\n";
|
||||
|
||||
echo "\n" . ' <input type="submit" value="' . $strGo . '" />';
|
||||
echo "\n" . '</form>' . "\n\n";
|
||||
} // end if
|
||||
} // end if ($cfgRelation['pdfwork'])
|
||||
|
||||
|
||||
/**
|
||||
|
103
pdf_schema.php3
103
pdf_schema.php3
@@ -11,26 +11,47 @@
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php3');
|
||||
require('./libraries/common.lib.php3');
|
||||
require('./libraries/relation.lib.php3');
|
||||
|
||||
|
||||
/**
|
||||
* Settings for relation stuff
|
||||
*/
|
||||
require('./libraries/relation.lib.php3');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
if(!$cfgRelation['relwork']) {
|
||||
echo sprintf($strNotSet,'relation','config.inc.php3') . '<br /><a href="Documentation.html#relation" target="documentation">' . $strDocu . '</a>';
|
||||
die();
|
||||
|
||||
|
||||
/**
|
||||
* Now in ./libraries/relation.lib.php3 we check for all tables
|
||||
* that we need, but if we don't find them we are quiet about it
|
||||
* so people can work without.
|
||||
* This page is absolutely useless if you didn't set up your tables
|
||||
* correctly, so it is a good place to see which tables we can and
|
||||
* complain ;-)
|
||||
*/
|
||||
if (!$cfgRelation['relwork']) {
|
||||
echo sprintf($strNotSet, 'relation', 'config.inc.php3') . '<br />' . "\n"
|
||||
. '<a href="./Documentation.html#relation" target="documentation">' . $strDocu . '</a>' . "\n";
|
||||
exit();
|
||||
}
|
||||
if(!$cfgRelation['displaywork']) {
|
||||
echo sprintf($strNotSet,'table_info','config.inc.php3') . '<br /><a href="Documentation.html#table_info" target="documentation">' . $strDocu . '</a>';
|
||||
die();
|
||||
|
||||
if (!$cfgRelation['displaywork']) {
|
||||
echo sprintf($strNotSet, 'table_info', 'config.inc.php3') . '<br />' . "\n"
|
||||
. '<a href="./Documentation.html#table_info" target="documentation">' . $strDocu . '</a>' . "\n";
|
||||
exit();
|
||||
}
|
||||
if(!isset($cfgRelation['table_coords'])){
|
||||
echo sprintf($strNotSet,'table_coords','config.inc.php3') . '<br /><a href="Documentation.html#table_coords" target="documentation">' . $strDocu . '</a>';
|
||||
die();
|
||||
|
||||
if (!isset($cfgRelation['table_coords'])){
|
||||
echo sprintf($strNotSet, 'table_coords', 'config.inc.php3') . '<br />' . "\n"
|
||||
. '<a href="./Documentation.html#table_coords" target="documentation">' . $strDocu . '</a>' . "\n";
|
||||
exit();
|
||||
}
|
||||
if(!isset($cfgRelation['pdf_pages'])) {
|
||||
echo sprintf($strNotSet,'pdf_page','config.inc.php3') . '<br /><a href="Documentation.html#pdf_pages" target="documentation">' . $strDocu . '</a>';
|
||||
die();
|
||||
if (!isset($cfgRelation['pdf_pages'])) {
|
||||
echo sprintf($strNotSet, 'pdf_page', 'config.inc.php3') . '<br />' . "\n"
|
||||
. '<a href="./Documentation.html#pdf_pages" target="documentation">' . $strDocu . '</a>' . "\n";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the "fpdf" libraries and defines the pdf font path
|
||||
*/
|
||||
@@ -391,12 +412,16 @@ class PMA_RT_Table
|
||||
|
||||
reset($this->fields);
|
||||
while (list(, $field) = each($this->fields)) {
|
||||
if(in_array($field,$this->primary)){$pdf->SetFillColor(215,121,123);}
|
||||
if($field == $this->displayfield){$pdf->SetFillColor(142,159,224);}
|
||||
if (in_array($field, $this->primary)) {
|
||||
$pdf->SetFillColor(215, 121, 123);
|
||||
}
|
||||
if ($field == $this->displayfield) {
|
||||
$pdf->SetFillColor(142, 159, 224);
|
||||
}
|
||||
$pdf->PMA_PDF_cellScale($this->width, $this->height_cell, ' ' . $field, 1, 1, 'L', 1);
|
||||
$pdf->PMA_PDF_setXScale($this->x);
|
||||
$pdf->SetFillColor(255);
|
||||
}
|
||||
} // end while
|
||||
|
||||
if ($pdf->PageNo() > 1) {
|
||||
$pdf->PMA_PDF_die($GLOBALS['strScaleFactorSmall']);
|
||||
@@ -413,6 +438,8 @@ class PMA_RT_Table
|
||||
* @global object The current PDF document
|
||||
* @global integer The current page number (from the
|
||||
* $cfg['Servers'][$i]['table_coords'] table)
|
||||
* @global array The relations settings
|
||||
* @global string The current db name
|
||||
*
|
||||
* @access private
|
||||
*
|
||||
@@ -421,7 +448,7 @@ class PMA_RT_Table
|
||||
*/
|
||||
function PMA_RT_Table($table_name, $ff)
|
||||
{
|
||||
global $pdf, $pdf_page_number,$cfgRelation,$db;
|
||||
global $pdf, $pdf_page_number, $cfgRelation, $db;
|
||||
|
||||
$this->table_name = $table_name;
|
||||
$sql = 'DESCRIBE ' . PMA_backquote($table_name);
|
||||
@@ -441,9 +468,9 @@ class PMA_RT_Table
|
||||
//x and y
|
||||
$sql = 'SELECT x, y FROM '
|
||||
. PMA_backquote($cfgRelation['table_coords'])
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND table_name = \'' . PMA_sqlAddslashes($table_name) . '\''
|
||||
. ' AND pdf_page_number = ' . $pdf_page_number;
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND table_name = \'' . PMA_sqlAddslashes($table_name) . '\''
|
||||
. ' AND pdf_page_number = ' . $pdf_page_number;
|
||||
$result = PMA_query_as_cu($sql);
|
||||
|
||||
if (!$result || !mysql_num_rows($result)) {
|
||||
@@ -453,20 +480,19 @@ class PMA_RT_Table
|
||||
$this->x = (double) $this->x;
|
||||
$this->y = (double) $this->y;
|
||||
|
||||
//displayfield
|
||||
$this->displayfield = getDisplayField($db,$table_name);
|
||||
// displayfield
|
||||
$this->displayfield = getDisplayField($db, $table_name);
|
||||
|
||||
// index
|
||||
$sql = 'SHOW index from '.PMA_backquote($table_name);
|
||||
$sql = 'SHOW index FROM ' . PMA_backquote($table_name);
|
||||
$result = PMA_mysql_query($sql);
|
||||
|
||||
if(mysql_num_rows($result)>0){
|
||||
if ($result && mysql_num_rows($result) > 0) {
|
||||
while ($row = PMA_mysql_fetch_array($result)) {
|
||||
if($row['Key_name'] == 'PRIMARY'){
|
||||
if ($row['Key_name'] == 'PRIMARY') {
|
||||
$this->primary[] = $row['Column_name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
} // end if
|
||||
} // end of the "PMA_RT_Table()" method
|
||||
} // end class "PMA_RT_Table"
|
||||
|
||||
@@ -794,6 +820,8 @@ class PMA_RT
|
||||
* @param boolean Whether to draw grids or not
|
||||
*
|
||||
* @global object The current PDF document
|
||||
* @global string The current db name
|
||||
* @global array The relations settings
|
||||
*
|
||||
* @access private
|
||||
*
|
||||
@@ -818,23 +846,22 @@ class PMA_RT
|
||||
$pdf->SetFont($this->ff, '', 14);
|
||||
$pdf->SetAutoPageBreak('auto');
|
||||
|
||||
// get tables on this page
|
||||
// Gets tables on this page
|
||||
$tab_sql = 'SELECT table_name FROM ' . PMA_backquote($cfgRelation['table_coords'])
|
||||
. ' WHERE db_name = \'' . $db . '\''
|
||||
. ' AND pdf_page_number=' .$which_rel;
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND pdf_page_number = ' . $which_rel;
|
||||
$tab_rs = PMA_query_as_cu($tab_sql);
|
||||
|
||||
while ($curr_table = @PMA_mysql_fetch_array($tab_rs)) {
|
||||
$alltables[] = $curr_table['table_name'];
|
||||
$intable = "'" . implode("','",$alltables) . "'";
|
||||
$alltables[] = PMA_sqlAddslashes($curr_table['table_name']);
|
||||
$intable = '\'' . implode('\', \'', $alltables) . '\'';
|
||||
}
|
||||
|
||||
$sql = 'SELECT *'
|
||||
. ' FROM ' . PMA_backquote($cfgRelation['relation'])
|
||||
. ' WHERE master_db = \'' . $db . '\' '
|
||||
. ' AND foreign_db = \'' . $db . '\' '
|
||||
. ' AND master_table IN (' . $intable .')'
|
||||
. ' AND foreign_table IN (' . $intable .')';
|
||||
$sql = 'SELECT * FROM ' . PMA_backquote($cfgRelation['relation'])
|
||||
. ' WHERE master_db = \'' . PMA_sqlAddslashes($db) . '\' '
|
||||
. ' AND foreign_db = \'' . PMA_sqlAddslashes($db) . '\' '
|
||||
. ' AND master_table IN (' . $intable . ')'
|
||||
. ' AND foreign_table IN (' . $intable . ')';
|
||||
$result = PMA_query_as_cu($sql);
|
||||
|
||||
if (!$result || !mysql_num_rows($result)) {
|
||||
|
@@ -321,7 +321,9 @@ if ($sql_query != '') {
|
||||
$pieces = array();
|
||||
PMA_splitSqlFile($pieces, $sql_query, PMA_MYSQL_INT_VERSION);
|
||||
$pieces_count = count($pieces);
|
||||
if($pieces_count>1){$is_multiple = TRUE;}
|
||||
if ($pieces_count > 1) {
|
||||
$is_multiple = TRUE;
|
||||
}
|
||||
|
||||
// Copy of the cleaned sql statement for display purpose only (see near the
|
||||
// beginning of "db_details.php3" & "tbl_properties.php3")
|
||||
|
@@ -46,20 +46,21 @@ $att7 = 'class="drop" onclick="return confirmLink(this, \'DROP TABLE ' . PMA_jsF
|
||||
* Displays links
|
||||
*/
|
||||
?>
|
||||
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="tabs">
|
||||
<table border="0" cellspacing="0" cellpadding="3" width="100%" class="tabs">
|
||||
<tr>
|
||||
<td width="8"> </td>
|
||||
<?php
|
||||
echo printTab($strStructure, 'tbl_properties_structure.php3', $url_query);
|
||||
echo printTab($strBrowse, $lnk2, $arg2);
|
||||
echo printTab($strSQL, 'tbl_properties.php3', $url_query);
|
||||
echo printTab($strSelect, $lnk4, $arg4);
|
||||
echo printTab($strInsert, 'tbl_change.php3', $url_query);
|
||||
echo printTab($strExport, 'tbl_properties_export.php3', $url_query);
|
||||
echo printTab($strOperations, 'tbl_properties_operations.php3', $url_query);
|
||||
echo printTab($strOptions, 'tbl_properties_options.php3', $url_query);
|
||||
echo printTab($strEmpty, $lnk6, $arg6, $att6);
|
||||
echo printTab($strDrop, 'sql.php3', $arg7, $att7);
|
||||
echo PMA_printTab($strStructure, 'tbl_properties_structure.php3', $url_query);
|
||||
echo PMA_printTab($strBrowse, $lnk2, $arg2);
|
||||
echo PMA_printTab($strSQL, 'tbl_properties.php3', $url_query);
|
||||
echo PMA_printTab($strSelect, $lnk4, $arg4);
|
||||
echo PMA_printTab($strInsert, 'tbl_change.php3', $url_query);
|
||||
echo PMA_printTab($strExport, 'tbl_properties_export.php3', $url_query);
|
||||
echo PMA_printTab($strOperations, 'tbl_properties_operations.php3', $url_query);
|
||||
echo PMA_printTab($strOptions, 'tbl_properties_options.php3', $url_query);
|
||||
echo PMA_printTab($strEmpty, $lnk6, $arg6, $att6);
|
||||
echo PMA_printTab($strDrop, 'sql.php3', $arg7, $att7);
|
||||
echo "\n";
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user