db operations: revised (style, code, xhtml output)
This commit is contained in:
@@ -11,6 +11,7 @@ $Source$
|
|||||||
- make use of PMA_array_merge_recursive()
|
- make use of PMA_array_merge_recursive()
|
||||||
- correctly reset config variables on changes in config.inc.php
|
- correctly reset config variables on changes in config.inc.php
|
||||||
* sql.php: hide edit/delete links for information_schema (bug #1373201)
|
* sql.php: hide edit/delete links for information_schema (bug #1373201)
|
||||||
|
* db_operations.php: revised (style, code, xhtml output)
|
||||||
|
|
||||||
2005-12-05 Michal Čihař <michal@cihar.com>
|
2005-12-05 Michal Čihař <michal@cihar.com>
|
||||||
* many files: Use same script tag, use CDATA for scripts (RFE #995065).
|
* many files: Use same script tag, use CDATA for scripts (RFE #995065).
|
||||||
|
@@ -2,10 +2,24 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
// vim: expandtab sw=4 ts=4 sts=4:
|
// vim: expandtab sw=4 ts=4 sts=4:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* handles miscellaneous db operations:
|
||||||
|
* - move/rename
|
||||||
|
* - copy
|
||||||
|
* - changing collation
|
||||||
|
* - changing comment
|
||||||
|
* - adding tables
|
||||||
|
* - viewing PDF schemas
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* requirements
|
||||||
|
*/
|
||||||
require_once('./libraries/common.lib.php');
|
require_once('./libraries/common.lib.php');
|
||||||
require_once('./libraries/mysql_charsets.lib.php');
|
require_once('./libraries/mysql_charsets.lib.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rename database or Copy database
|
* Rename/move or copy database
|
||||||
*/
|
*/
|
||||||
if (isset($db) &&
|
if (isset($db) &&
|
||||||
((isset($db_rename) && $db_rename == 'true') ||
|
((isset($db_rename) && $db_rename == 'true') ||
|
||||||
@@ -56,7 +70,8 @@ if (isset($db) &&
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this_what != 'nocopy') {
|
if ($this_what != 'nocopy') {
|
||||||
PMA_table_move_copy($db, $table, $newname, $table, isset($this_what) ? $this_what : 'data', $move);
|
PMA_table_move_copy($db, $table, $newname, $table,
|
||||||
|
isset($this_what) ? $this_what : 'data', $move);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql_query = $back . $sql_query;
|
$sql_query = $back . $sql_query;
|
||||||
@@ -68,7 +83,8 @@ if (isset($db) &&
|
|||||||
$get_fields = array('user','label','query');
|
$get_fields = array('user','label','query');
|
||||||
$where_fields = array('dbase' => $db);
|
$where_fields = array('dbase' => $db);
|
||||||
$new_fields = array('dbase' => $newname);
|
$new_fields = array('dbase' => $newname);
|
||||||
PMA_duplicate_table_info('bookmarkwork', 'bookmark', $get_fields, $where_fields, $new_fields);
|
PMA_duplicate_table_info('bookmarkwork', 'bookmark', $get_fields,
|
||||||
|
$where_fields, $new_fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($move) {
|
if ($move) {
|
||||||
@@ -79,9 +95,11 @@ if (isset($db) &&
|
|||||||
$local_query = 'DROP DATABASE ' . PMA_backquote($db) . ';';
|
$local_query = 'DROP DATABASE ' . PMA_backquote($db) . ';';
|
||||||
$sql_query .= "\n" . $local_query;
|
$sql_query .= "\n" . $local_query;
|
||||||
PMA_DBI_query($local_query);
|
PMA_DBI_query($local_query);
|
||||||
$message = sprintf($strRenameDatabaseOK, htmlspecialchars($db), htmlspecialchars($newname));
|
$message = sprintf($strRenameDatabaseOK, htmlspecialchars($db),
|
||||||
|
htmlspecialchars($newname));
|
||||||
} else {
|
} else {
|
||||||
$message = sprintf($strCopyDatabaseOK, htmlspecialchars($db), htmlspecialchars($newname));
|
$message = sprintf($strCopyDatabaseOK, htmlspecialchars($db),
|
||||||
|
htmlspecialchars($newname));
|
||||||
}
|
}
|
||||||
$reload = TRUE;
|
$reload = TRUE;
|
||||||
|
|
||||||
@@ -89,12 +107,11 @@ if (isset($db) &&
|
|||||||
if ($move) {
|
if ($move) {
|
||||||
$db = $newname;
|
$db = $newname;
|
||||||
} else {
|
} else {
|
||||||
$pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
|
|
||||||
if (isset($switch_to_new) && $switch_to_new == 'true') {
|
if (isset($switch_to_new) && $switch_to_new == 'true') {
|
||||||
setcookie('pma_switch_to_new', 'true', 0, $GLOBALS['cookie_path'], '' , $GLOBALS['is_https']);
|
PMA_setCookie( 'pma_switch_to_new', 'true' );
|
||||||
$db = $newname;
|
$db = $newname;
|
||||||
} else {
|
} else {
|
||||||
setcookie('pma_switch_to_new', '', 0, $GLOBALS['cookie_path'], '' , $GLOBALS['is_https']);
|
PMA_setCookie( 'pma_switch_to_new', '' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,7 +148,8 @@ if (empty($is_info)) {
|
|||||||
if (PMA_MYSQL_INT_VERSION >= 40101) {
|
if (PMA_MYSQL_INT_VERSION >= 40101) {
|
||||||
$db_collation = PMA_getDbCollation($db);
|
$db_collation = PMA_getDbCollation($db);
|
||||||
}
|
}
|
||||||
if (PMA_MYSQL_INT_VERSION < 50002 || (PMA_MYSQL_INT_VERSION >= 50002 && $db != 'information_schema')) {
|
if (PMA_MYSQL_INT_VERSION < 50002
|
||||||
|
|| (PMA_MYSQL_INT_VERSION >= 50002 && $db != 'information_schema')) {
|
||||||
$is_information_schema = FALSE;
|
$is_information_schema = FALSE;
|
||||||
} else {
|
} else {
|
||||||
$is_information_schema = TRUE;
|
$is_information_schema = TRUE;
|
||||||
@@ -141,127 +159,164 @@ if (!$is_information_schema) {
|
|||||||
|
|
||||||
require('./libraries/display_create_table.lib.php');
|
require('./libraries/display_create_table.lib.php');
|
||||||
|
|
||||||
echo '<table border="0" cellpadding="2" cellspacing="0">';
|
|
||||||
if ($cfgRelation['commwork']) {
|
if ($cfgRelation['commwork']) {
|
||||||
?>
|
/**
|
||||||
<!-- Alter/Enter db-comment -->
|
* database comment
|
||||||
<tr><td colspan="3"><img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" width="1" height="1" border="0" alt="" /></td></tr>
|
*/
|
||||||
|
?>
|
||||||
<tr>
|
<form method="post" action="db_operations.php">
|
||||||
<td colspan="3" class="tblHeaders"><?php
|
<?php echo PMA_generate_common_hidden_inputs($db); ?>
|
||||||
|
<input type="hidden" name="db_comment" value="true" />
|
||||||
|
<fieldset>
|
||||||
|
<legend>
|
||||||
|
<?php
|
||||||
if ($cfg['PropertiesIconic']) {
|
if ($cfg['PropertiesIconic']) {
|
||||||
echo '<img src="' . $pmaThemeImage . 'b_comment.png" border="0" width="16" height="16" hspace="2" align="middle" />';
|
echo '<img class="icon" src="' . $pmaThemeImage . 'b_comment.png"'
|
||||||
|
.' border="0" width="16" height="16" hspace="2" align="middle" />';
|
||||||
}
|
}
|
||||||
echo $strDBComment;
|
echo $strDBComment;
|
||||||
$comment = PMA_getComments($db);
|
$comment = PMA_getComments($db);
|
||||||
?></td></tr>
|
?>
|
||||||
<form method="post" action="db_operations.php">
|
</legend>
|
||||||
<tr bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
|
<input type="text" name="comment" class="textfield" size="30"
|
||||||
<td colspan="2" nowrap="nowrap">
|
value="<?php
|
||||||
<input type="hidden" name="db_comment" value="true" />
|
echo (isset($comment) && is_array($comment)
|
||||||
<?php echo PMA_generate_common_hidden_inputs($db); ?>
|
? htmlspecialchars(implode(' ', $comment))
|
||||||
<input type="text" name="comment" class="textfield" size="30" value="<?php echo (isset($comment) && is_array($comment) ? htmlspecialchars(implode(' ', $comment)) : ''); ?>" /></td><td align="right">
|
: ''); ?>" />
|
||||||
<input type="submit" value="<?php echo $strGo; ?>" />
|
<input type="submit" value="<?php echo $strGo; ?>" />
|
||||||
</td></tr>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
/**
|
||||||
<!-- Rename database -->
|
* rename database
|
||||||
<tr><td colspan="3"><img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" width="1" height="1" border="0" alt="" /></td></tr>
|
*/
|
||||||
<tr><td colspan="3" class="tblHeaders"><?php
|
?>
|
||||||
if ($cfg['PropertiesIconic']) {
|
<form method="post" action="db_operations.php"
|
||||||
echo '<img src="' . $pmaThemeImage . 'b_edit.png" border="0" width="16" height="16" hspace="2" align="middle" />';
|
onsubmit="return emptyFormElements(this, 'newname')">
|
||||||
}
|
<input type="hidden" name="what" value="data" />
|
||||||
echo $strDBRename.': ';
|
<input type="hidden" name="db_rename" value="true" />
|
||||||
?></td></tr>
|
<?php echo PMA_generate_common_hidden_inputs($db); ?>
|
||||||
<form method="post" action="db_operations.php"
|
<fieldset>
|
||||||
onsubmit="return emptyFormElements(this, 'newname')">
|
<legend>
|
||||||
<tr bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><td colspan="2"><?php
|
<?php
|
||||||
echo '<input type="hidden" name="what" value="data" />';
|
if ($cfg['PropertiesIconic']) {
|
||||||
echo '<input type="hidden" name="db_rename" value="true" />'
|
echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"'
|
||||||
. PMA_generate_common_hidden_inputs($db);
|
.' width="16" height="16" />';
|
||||||
?><input type="text" name="newname" size="30" class="textfield" value="" /></td>
|
}
|
||||||
<td align="right"><input type="submit" value="<?php echo $strGo; ?>" /></td>
|
echo $strDBRename . ':';
|
||||||
</form></tr>
|
?>
|
||||||
|
</legend>
|
||||||
<!-- Copy database -->
|
<input type="text" name="newname" size="30" class="textfield" value="" />
|
||||||
<tr><td colspan="3"><img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" width="1" height="1" border="0" alt="" /></td></tr>
|
<input type="submit" value="<?php echo $strGo; ?>" />
|
||||||
<tr><td colspan="3" class="tblHeaders"><?php
|
</fieldset>
|
||||||
if ($cfg['PropertiesIconic']) {
|
|
||||||
echo '<img src="' . $pmaThemeImage . 'b_edit.png" border="0" width="16" height="16" hspace="2" align="middle" />';
|
|
||||||
}
|
|
||||||
echo $strDBCopy.': ';
|
|
||||||
?></td></tr>
|
|
||||||
<form method="post" action="db_operations.php"
|
|
||||||
onsubmit="return emptyFormElements(this, 'newname')">
|
|
||||||
<tr bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><td colspan="3">
|
|
||||||
<?php
|
|
||||||
if (isset($db_collation)) {
|
|
||||||
echo '<input type="hidden" name="db_collation" value="' . $db_collation .'" />' . "\n";
|
|
||||||
}
|
|
||||||
echo '<input type="hidden" name="db_copy" value="true" />' . "\n"
|
|
||||||
. PMA_generate_common_hidden_inputs($db);
|
|
||||||
?><input type="text" name="newname" size="30" class="textfield" value="" /></td>
|
|
||||||
</tr><tr>
|
|
||||||
<td nowrap="nowrap" bgcolor="<?php echo $cfg['BgcolorOne']; ?>" colspan="2">
|
|
||||||
<input type="radio" name="what" value="structure" id="radio_copy_structure" style="vertical-align: middle" /><label for="radio_copy_structure"><?php echo $strStrucOnly; ?></label> <br />
|
|
||||||
<input type="radio" name="what" value="data" id="radio_copy_data" checked="checked" style="vertical-align: middle" /><label for="radio_copy_data"><?php echo $strStrucData; ?></label> <br />
|
|
||||||
<input type="radio" name="what" value="dataonly" id="radio_copy_dataonly" style="vertical-align: middle" /><label for="radio_copy_dataonly"><?php echo $strDataOnly; ?></label> <br />
|
|
||||||
|
|
||||||
|
|
||||||
<input type="checkbox" name="create_database_before_copying" value="1" id="checkbox_create_database_before_copying" style="vertical-align: middle" checked="checked" /><label for="checkbox_create_database_before_copying"><?php echo $strCreateDatabaseBeforeCopying; ?></label><br />
|
|
||||||
<input type="checkbox" name="drop_if_exists" value="true" id="checkbox_drop" style="vertical-align: middle" /><label for="checkbox_drop"><?php echo $strStrucDrop; ?></label> <br />
|
|
||||||
<input type="checkbox" name="sql_auto_increment" value="1" id="checkbox_auto_increment" style="vertical-align: middle" /><label for="checkbox_auto_increment"><?php echo $strAddAutoIncrement; ?></label><br />
|
|
||||||
<input type="checkbox" name="constraints" value="1" id="checkbox_constraints" style="vertical-align: middle" /><label for="checkbox_constraints"><?php echo $strAddConstraints; ?></label><br />
|
|
||||||
<?php
|
|
||||||
if (isset($_COOKIE) && isset($_COOKIE['pma_switch_to_new']) && $_COOKIE['pma_switch_to_new'] == 'true') {
|
|
||||||
$pma_switch_to_new = 'true';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<input type="checkbox" name="switch_to_new" value="true" id="checkbox_switch"<?php echo ((isset($pma_switch_to_new) && $pma_switch_to_new == 'true') ? ' checked="checked"' : ''); ?> style="vertical-align: middle" /><label for="checkbox_switch"><?php echo $strSwitchToDatabase; ?></label>
|
|
||||||
</td>
|
|
||||||
<td align="<?php echo $cell_align_right; ?>" valign="bottom" bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
|
|
||||||
<input type="submit" name="submit_copy" value="<?php echo $strGo; ?>" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Copy database
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<form method="post" action="db_operations.php"
|
||||||
|
onsubmit="return emptyFormElements(this, 'newname')">
|
||||||
|
<?php
|
||||||
|
if (isset($db_collation)) {
|
||||||
|
echo '<input type="hidden" name="db_collation" value="' . $db_collation
|
||||||
|
.'" />' . "\n";
|
||||||
|
}
|
||||||
|
echo '<input type="hidden" name="db_copy" value="true" />' . "\n";
|
||||||
|
echo PMA_generate_common_hidden_inputs($db);
|
||||||
|
?>
|
||||||
|
<fieldset>
|
||||||
|
<legend>
|
||||||
|
<?php
|
||||||
|
if ($cfg['PropertiesIconic']) {
|
||||||
|
echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"'
|
||||||
|
.' width="16" height="16" />';
|
||||||
|
}
|
||||||
|
echo $strDBCopy . ':';
|
||||||
|
?>
|
||||||
|
</legend>
|
||||||
|
<input type="text" name="newname" size="30" class="textfield" value="" /><br />
|
||||||
|
<input type="radio" name="what" value="structure"
|
||||||
|
id="radio_copy_structure" style="vertical-align: middle" />
|
||||||
|
<label for="radio_copy_structure"><?php echo $strStrucOnly; ?></label><br />
|
||||||
|
<input type="radio" name="what" value="data" id="radio_copy_data"
|
||||||
|
checked="checked" style="vertical-align: middle" />
|
||||||
|
<label for="radio_copy_data"><?php echo $strStrucData; ?></label><br />
|
||||||
|
<input type="radio" name="what" value="dataonly"
|
||||||
|
id="radio_copy_dataonly" style="vertical-align: middle" />
|
||||||
|
<label for="radio_copy_dataonly"><?php echo $strDataOnly; ?></label><br />
|
||||||
|
|
||||||
|
<input type="checkbox" name="create_database_before_copying" value="1"
|
||||||
|
id="checkbox_create_database_before_copying"
|
||||||
|
style="vertical-align: middle" checked="checked" />
|
||||||
|
<label for="checkbox_create_database_before_copying">
|
||||||
|
<?php echo $strCreateDatabaseBeforeCopying; ?></label><br />
|
||||||
|
<input type="checkbox" name="drop_if_exists" value="true"
|
||||||
|
id="checkbox_drop" style="vertical-align: middle" />
|
||||||
|
<label for="checkbox_drop"><?php echo $strStrucDrop; ?></label><br />
|
||||||
|
<input type="checkbox" name="sql_auto_increment" value="1"
|
||||||
|
id="checkbox_auto_increment" style="vertical-align: middle" />
|
||||||
|
<label for="checkbox_auto_increment">
|
||||||
|
<?php echo $strAddAutoIncrement; ?></label><br />
|
||||||
|
<input type="checkbox" name="constraints" value="1"
|
||||||
|
id="checkbox_constraints" style="vertical-align: middle" />
|
||||||
|
<label for="checkbox_constraints">
|
||||||
|
<?php echo $strAddConstraints; ?></label><br />
|
||||||
|
<?php
|
||||||
|
if (isset($_COOKIE) && isset($_COOKIE['pma_switch_to_new'])
|
||||||
|
&& $_COOKIE['pma_switch_to_new'] == 'true') {
|
||||||
|
$pma_switch_to_new = 'true';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<input type="checkbox" name="switch_to_new" value="true"
|
||||||
|
id="checkbox_switch"
|
||||||
|
<?php echo ((isset($pma_switch_to_new) && $pma_switch_to_new == 'true') ? ' checked="checked"' : ''); ?>
|
||||||
|
style="vertical-align: middle" />
|
||||||
|
<label for="checkbox_switch"><?php echo $strSwitchToDatabase; ?></label>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset class="tblFooters">
|
||||||
|
<input type="submit" name="submit_copy" value="<?php echo $strGo; ?>" />
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Change database charset
|
||||||
|
*/
|
||||||
if (PMA_MYSQL_INT_VERSION >= 40101) {
|
if (PMA_MYSQL_INT_VERSION >= 40101) {
|
||||||
// MySQL supports setting default charsets / collations for databases since
|
// MySQL supports setting default charsets / collations for databases since
|
||||||
// version 4.1.1.
|
// version 4.1.1.
|
||||||
echo ' <!-- Change database charset -->' . "\n"
|
echo '<form method="post" action="./db_operations.php">' . "\n"
|
||||||
. ' <tr><td colspan="3"><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" alt="" /></td></tr>' . "\n"
|
. PMA_generate_common_hidden_inputs($db, $table)
|
||||||
. ' <tr><td colspan="3" class="tblHeaders">';
|
. '<fieldset' . "\n"
|
||||||
|
. ' <legend>';
|
||||||
if ($cfg['PropertiesIconic']) {
|
if ($cfg['PropertiesIconic']) {
|
||||||
echo '<img src="' . $pmaThemeImage . 's_asci.png" border="0" width="16" height="16" hspace="2" align="middle" />';
|
echo '<img class="icon" src="' . $pmaThemeImage . 's_asci.png"'
|
||||||
|
.' width="16" height="16" />';
|
||||||
}
|
}
|
||||||
echo ' <label for="select_db_collation">' . $strCollation . '</label>: ' . "\n"
|
echo ' <label for="select_db_collation">' . $strCollation . ':</label>' . "\n"
|
||||||
. ' </td></tr>' . "\n"
|
. ' </legend>' . "\n"
|
||||||
. ' <form method="post" action="./db_operations.php">' . "\n"
|
. PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION,
|
||||||
. ' <tr bgcolor="' . $cfg['BgcolorOne'] . '"><td colspan="2" nowrap="nowrap">'
|
'db_collation', 'select_db_collation', $db_collation, FALSE, 3)
|
||||||
. PMA_generate_common_hidden_inputs($db, $table, 3)
|
. ' <input type="submit" name="submitcollation"'
|
||||||
. PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', 'select_db_collation', $db_collation, FALSE, 3)
|
. ' value="' . $strGo . '" style="vertical-align: middle" />' . "\n"
|
||||||
. ' </td><td align="right">'
|
. '</fieldset>' . "\n"
|
||||||
. ' <input type="submit" name="submitcollation" value="' . $strGo . '" style="vertical-align: middle" />' . "\n"
|
. '</form>' . "\n";
|
||||||
. ' </td></tr>' . "\n"
|
|
||||||
. ' </form>' . "\n"
|
|
||||||
. ' ' . "\n\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</table>';
|
|
||||||
|
|
||||||
if ( $num_tables > 0
|
if ( $num_tables > 0
|
||||||
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == FALSE) {
|
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == FALSE) {
|
||||||
echo '<div class="error"><h1>' . $strError . '</h1>'
|
echo '<div class="error"><h1>' . $strError . '</h1>'
|
||||||
. sprintf( $strRelationNotWorking, '<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', '</a>')
|
. sprintf( $strRelationNotWorking,
|
||||||
|
'<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">',
|
||||||
|
'</a>')
|
||||||
. '</div>';
|
. '</div>';
|
||||||
} // end if
|
} // end if
|
||||||
} // end if (!$is_information_schema)
|
} // end if (!$is_information_schema)
|
||||||
// not sure about leaving the PDF dialog for information_schema
|
|
||||||
|
|
||||||
|
// not sure about leaving the PDF dialog for information_schema
|
||||||
?>
|
?>
|
||||||
<form method="post" action="pdf_schema.php">
|
<form method="post" action="pdf_schema.php">
|
||||||
<?php
|
<?php
|
||||||
@@ -270,36 +325,8 @@ if ($num_tables > 0) {
|
|||||||
$takeaway = $url_query . '&table=' . urlencode($table);
|
$takeaway = $url_query . '&table=' . urlencode($table);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($cfgRelation['pdfwork'] && $num_tables > 0) ||
|
|
||||||
($num_tables > 0
|
|
||||||
&& $cfgRelation['relwork'] && $cfgRelation['commwork']
|
|
||||||
&& isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])
|
|
||||||
)) { ?>
|
|
||||||
<hr /><table border="0" cellpadding="2" cellspacing="0">
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>
|
if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>
|
||||||
<!-- Work on PDF Pages -->
|
<!-- Work on PDF Pages -->
|
||||||
<tr>
|
|
||||||
<td colspan="3" class="tblHeaders">
|
|
||||||
<?php
|
|
||||||
if ($cfg['PropertiesIconic']) {
|
|
||||||
echo '<img src="' . $pmaThemeImage . 'b_pdfdoc.png" border="0" width="16" height="16" hspace="2" align="middle" />';
|
|
||||||
} ?>PDF</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
|
|
||||||
<td colspan="3">
|
|
||||||
<?php
|
|
||||||
echo '<a href="pdf_pages.php?' . $takeaway . '">';
|
|
||||||
if ($cfg['PropertiesIconic']) {
|
|
||||||
echo '<img src="' . $pmaThemeImage . 'b_edit.png" border="0" width="16" height="16" hspace="2" align="middle" />';
|
|
||||||
}
|
|
||||||
echo ''. $strEditPDFPages . '</a>';
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- PDF schema -->
|
<!-- PDF schema -->
|
||||||
<?php
|
<?php
|
||||||
@@ -310,102 +337,102 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>
|
|||||||
$test_rs = PMA_query_as_cu($test_query, NULL, PMA_DBI_QUERY_STORE);
|
$test_rs = PMA_query_as_cu($test_query, NULL, PMA_DBI_QUERY_STORE);
|
||||||
|
|
||||||
if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) { ?>
|
if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) { ?>
|
||||||
<tr bgcolor="<?php echo $cfg['BgcolorTwo']; ?>">
|
<fieldset>
|
||||||
<td colspan="3">
|
<legend>
|
||||||
<?php
|
<?php
|
||||||
echo PMA_generate_common_hidden_inputs($db);
|
echo PMA_generate_common_hidden_inputs($db);
|
||||||
if ($cfg['PropertiesIconic']) {
|
if ($cfg['PropertiesIconic']) {
|
||||||
echo '<img src="' . $pmaThemeImage . 'b_view.png" border="0" width="16" height="16" hspace="2" align="middle" />';
|
echo '<img class="icon" src="' . $pmaThemeImage . 'b_view.png"'
|
||||||
}
|
.' width="16" height="16" />';
|
||||||
echo $strDisplayPDF; ?>:
|
}
|
||||||
</td>
|
echo $strDisplayPDF;
|
||||||
</tr>
|
?>:
|
||||||
|
</legend>
|
||||||
|
<label for="pdf_page_number_opt"><?php echo $strPageNumber; ?></label>
|
||||||
|
<select name="pdf_page_number" id="pdf_page_number_opt">
|
||||||
|
<?php
|
||||||
|
while ($pages = @PMA_DBI_fetch_assoc($test_rs)) {
|
||||||
|
echo ' <option value="' . $pages['page_nr'] . '">'
|
||||||
|
. $pages['page_nr'] . ': ' . $pages['page_descr'] . '</option>' . "\n";
|
||||||
|
} // end while
|
||||||
|
PMA_DBI_free_result($test_rs);
|
||||||
|
unset($test_rs);
|
||||||
|
?>
|
||||||
|
</select><br />
|
||||||
|
|
||||||
<tr bgcolor="<?php echo $cfg['BgcolorTwo']; ?>">
|
<input type="checkbox" name="show_grid" id="show_grid_opt" />
|
||||||
<td width="20"> </td>
|
<label for="show_grid_opt"><?php echo $strShowGrid; ?></label><br />
|
||||||
<td colspan="2">
|
<input type="checkbox" name="show_color" id="show_color_opt"
|
||||||
<label for="pdf_page_number_opt"><?php echo $strPageNumber; ?></label>
|
checked="checked" />
|
||||||
<select name="pdf_page_number" id="pdf_page_number_opt">
|
<label for="show_color_opt"><?php echo $strShowColor; ?></label><br />
|
||||||
<?php
|
<input type="checkbox" name="show_table_dimension" id="show_table_dim_opt" />
|
||||||
while ($pages = @PMA_DBI_fetch_assoc($test_rs)) {
|
<label for="show_table_dim_opt"><?php echo $strShowTableDimension; ?>
|
||||||
echo ' <option value="' . $pages['page_nr'] . '">' . $pages['page_nr'] . ': ' . $pages['page_descr'] . '</option>' . "\n";
|
</label><br />
|
||||||
} // end while
|
<input type="checkbox" name="all_tab_same_wide" id="all_tab_same_wide" />
|
||||||
PMA_DBI_free_result($test_rs);
|
<label for="all_tab_same_wide"><?php echo $strAllTableSameWidth; ?>
|
||||||
unset($test_rs);
|
</label><br />
|
||||||
?>
|
<input type="checkbox" name="with_doc" id="with_doc" checked="checked" />
|
||||||
</select><br />
|
<label for="with_doc"><?php echo $strDataDict; ?></label><br />
|
||||||
|
|
||||||
<input type="checkbox" name="show_grid" id="show_grid_opt" /><label for="show_grid_opt"><?php echo $strShowGrid; ?></label><br />
|
<label for="orientation_opt"><?php echo $strShowDatadictAs; ?></label>
|
||||||
<input type="checkbox" name="show_color" id="show_color_opt" checked="checked" /><label for="show_color_opt"><?php echo $strShowColor; ?></label><br />
|
<select name="orientation" id="orientation_opt">
|
||||||
<input type="checkbox" name="show_table_dimension" id="show_table_dim_opt" /><label for="show_table_dim_opt"><?php echo $strShowTableDimension; ?></label><br />
|
<option value="L"><?php echo $strLandscape;?></option>
|
||||||
<input type="checkbox" name="all_tab_same_wide" id="all_tab_same_wide" /><label for="all_tab_same_wide"><?php echo $strAllTableSameWidth; ?></label><br />
|
<option value="P"><?php echo $strPortrait;?></option>
|
||||||
<input type="checkbox" name="with_doc" id="with_doc" checked="checked" /><label for="with_doc"><?php echo $strDataDict; ?></label><br />
|
</select><br />
|
||||||
|
|
||||||
<label for="orientation_opt"><?php echo $strShowDatadictAs; ?></label>
|
<label for="paper_opt"><?php echo $strPaperSize; ?></label>
|
||||||
<select name="orientation" id="orientation_opt">
|
<select name="paper" id="paper_opt">
|
||||||
<option value="L"><?php echo $strLandscape;?></option>
|
<?php
|
||||||
<option value="P"><?php echo $strPortrait;?></option>
|
foreach ($cfg['PDFPageSizes'] AS $key => $val) {
|
||||||
</select><br />
|
echo '<option value="' . $val . '"';
|
||||||
|
if ($val == $cfg['PDFDefaultPageSize']) {
|
||||||
<label for="paper_opt"><?php echo $strPaperSize; ?></label>
|
echo ' selected="selected"';
|
||||||
<select name="paper" id="paper_opt">
|
|
||||||
<?php
|
|
||||||
foreach ($cfg['PDFPageSizes'] AS $key => $val) {
|
|
||||||
echo '<option value="' . $val . '"';
|
|
||||||
if ($val == $cfg['PDFDefaultPageSize']) {
|
|
||||||
echo ' selected="selected"';
|
|
||||||
}
|
|
||||||
echo ' >' . $val . '</option>' . "\n";
|
|
||||||
}
|
}
|
||||||
?>
|
echo ' >' . $val . '</option>' . "\n";
|
||||||
</select>
|
}
|
||||||
</td>
|
?>
|
||||||
</tr>
|
</select>
|
||||||
|
</fieldset>
|
||||||
<tr bgcolor="<?php echo $cfg['BgcolorTwo']; ?>">
|
<fieldset class="tblFooters">
|
||||||
<td width="20"> </td>
|
<input type="submit" value="<?php echo $strGo; ?>" />
|
||||||
<td colspan="3" align="right"> <input type="submit" value="<?php echo $strGo; ?>" /></td>
|
</fieldset>
|
||||||
</tr>
|
</form>
|
||||||
<tr>
|
|
||||||
<td colspan="3"><img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" width="1" height="1" border="0" alt="" /></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
<?php
|
||||||
} // end if
|
} // end if
|
||||||
|
?>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<?php
|
||||||
|
echo '<a href="pdf_pages.php?' . $takeaway . '">';
|
||||||
|
if ($cfg['PropertiesIconic']) {
|
||||||
|
echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"'
|
||||||
|
.' width="16" height="16" />';
|
||||||
|
}
|
||||||
|
echo $strEditPDFPages . '</a>';
|
||||||
|
?>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<?php
|
||||||
} // end if
|
} // end if
|
||||||
|
|
||||||
if ($num_tables > 0
|
if ( $num_tables > 0
|
||||||
&& $cfgRelation['relwork'] && $cfgRelation['commwork']
|
&& $cfgRelation['relwork'] && $cfgRelation['commwork']
|
||||||
&& isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])
|
&& isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir']) ) {
|
||||||
) {
|
/**
|
||||||
?>
|
* import docSQL files
|
||||||
<!-- import docSQL files -->
|
*/
|
||||||
<tr bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
|
echo '<ul>' . "\n"
|
||||||
<td colspan="3">
|
.'<li><a href="db_details_importdocsql.php?' . $takeaway . '">' . "\n";
|
||||||
<?php
|
if ($cfg['PropertiesIconic']) {
|
||||||
echo '<a href="db_details_importdocsql.php?' . $takeaway . '">';
|
echo '<img class="icon" src="' . $pmaThemeImage . 'b_docsql.png"'
|
||||||
if ($cfg['PropertiesIconic']) {
|
.' width="16" height="16" />';
|
||||||
echo '<img src="' . $pmaThemeImage . 'b_docsql.png" border="0" width="16" height="16" hspace="2" align="middle" />';
|
}
|
||||||
}
|
echo $strImportDocSQL . '</a></li>' . "\n"
|
||||||
echo $strImportDocSQL . '</a>';
|
.'</ul>';
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
echo "\n";
|
|
||||||
if (($cfgRelation['pdfwork'] && $num_tables > 0) ||
|
|
||||||
($num_tables > 0
|
|
||||||
&& $cfgRelation['relwork'] && $cfgRelation['commwork']
|
|
||||||
&& isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])
|
|
||||||
)) { ?>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the footer
|
* Displays the footer
|
||||||
*/
|
*/
|
||||||
echo "\n";
|
|
||||||
require_once('./libraries/footer.inc.php');
|
require_once('./libraries/footer.inc.php');
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user