Loic cleanup
This commit is contained in:
@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$Source$
|
||||
|
||||
2002-11-06 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||
* db_datadict.php3, tbl_printview.php3: code cleanup
|
||||
|
||||
2002-11-06 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* lang/ukrainian: update, thanks to Markijan Baran
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* $Id$ */
|
||||
|
||||
|
||||
/**
|
||||
* Gets the variables sent or posted to this script, then displays headers
|
||||
*/
|
||||
@@ -9,10 +10,13 @@ if (!isset($selected_tbl)) {
|
||||
include('./header.inc.php3');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the relations settings
|
||||
*/
|
||||
require('./libraries/relation.lib.php3');
|
||||
|
||||
|
||||
/**
|
||||
* Defines the url to return to in case of error in a sql statement
|
||||
*/
|
||||
@@ -30,28 +34,30 @@ if (isset($table)) {
|
||||
. '&server=' . $server
|
||||
. '&db=' . urlencode($db);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects the database
|
||||
* Selects the database and gets tables names
|
||||
*/
|
||||
PMA_mysql_select_db($db);
|
||||
$sql="show tables from $db";
|
||||
$rowset=mysql_query($sql);
|
||||
$count=0;
|
||||
while ($row=mysql_fetch_array($rowset)) {
|
||||
$sql = 'SHOW TABLES FROM ' . PMA_backquote($db);
|
||||
$rowset = mysql_query($sql);
|
||||
$count = 0;
|
||||
while ($row = mysql_fetch_array($rowset)) {
|
||||
if (PMA_MYSQL_INT_VERSION >= 32303) {
|
||||
$myfieldname="Tables_in_".$db;
|
||||
$myfieldname = 'Tables_in_' . $db;
|
||||
}
|
||||
else {
|
||||
$myfieldname="Tables in ".$db;
|
||||
$myfieldname = 'Tables in ' . $db;
|
||||
}
|
||||
$table=$row[$myfieldname];
|
||||
$table = $row[$myfieldname];
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
if ($cfgRelation['commwork']) {
|
||||
$comments = PMA_getComments($db, $table);
|
||||
}
|
||||
|
||||
if ($count!=0){
|
||||
echo "<p style='page-break-before:always'>";
|
||||
if ($count != 0) {
|
||||
echo '<div style="page-break-before: always">' . "\n";
|
||||
}
|
||||
echo '<h1>' . $table . '</h1>' . "\n";
|
||||
|
||||
@@ -156,25 +162,25 @@ while ($row=mysql_fetch_array($rowset)) {
|
||||
*/
|
||||
?>
|
||||
|
||||
<!-- TABLE INFORMATIONS -->
|
||||
<table width=100% bordercolorlight=black border style='border-collapse:collapse;background-color:white'>
|
||||
<tr>
|
||||
<th width=50><?php echo ucfirst($strField); ?></th>
|
||||
<th width=50><?php echo ucfirst($strType); ?></th>
|
||||
<!--<th width=50><?php echo ucfirst($strAttr); ?></th>-->
|
||||
<th width=50><?php echo ucfirst($strNull); ?></th>
|
||||
<th width=50><?php echo ucfirst($strDefault); ?></th>
|
||||
<!--<th width=50><?php echo ucfirst($strExtra); ?></th>-->
|
||||
<!-- TABLE INFORMATIONS -->
|
||||
<table width="100%" bordercolorlight="black" border="border" style="border-collapse: collapse;background-color: white">
|
||||
<tr>
|
||||
<th width="50"><?php echo ucfirst($strField); ?></th>
|
||||
<th width="50"><?php echo ucfirst($strType); ?></th>
|
||||
<!--<th width="50"><?php echo ucfirst($strAttr); ?></th>-->
|
||||
<th width="50"><?php echo ucfirst($strNull); ?></th>
|
||||
<th width="50"><?php echo ucfirst($strDefault); ?></th>
|
||||
<!--<th width="50"><?php echo ucfirst($strExtra); ?></th>-->
|
||||
<?php
|
||||
echo "\n";
|
||||
if ($have_rel) {
|
||||
echo ' <th width=50>' . ucfirst($strLinksTo) . '</th>' . "\n";
|
||||
echo ' <th width="50">' . ucfirst($strLinksTo) . '</th>' . "\n";
|
||||
}
|
||||
if ($cfgRelation['commwork']) {
|
||||
echo ' <th width=400>' . ucfirst($strComments) . '</th>' . "\n";
|
||||
echo ' <th width="400">' . ucfirst($strComments) . '</th>' . "\n";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$i = 0;
|
||||
@@ -222,9 +228,10 @@ while ($row=mysql_fetch_array($rowset)) {
|
||||
$field_name = htmlspecialchars($row['Field']);
|
||||
echo "\n";
|
||||
?>
|
||||
<tr>
|
||||
<tr>
|
||||
<td width=50 class='print' nowrap="nowrap">
|
||||
<?php
|
||||
echo "\n";
|
||||
if (isset($pk_array[$row['Field']])) {
|
||||
echo ' <u>' . $field_name . '</u> ' . "\n";
|
||||
} else {
|
||||
@@ -232,58 +239,64 @@ while ($row=mysql_fetch_array($rowset)) {
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td width=50 class='print' <?php echo $type_nowrap; ?>><?php echo $type; ?><bdo dir="ltr"></bdo></td>
|
||||
<!--<td width=50 bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>-->
|
||||
<td width=50 class='print'><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?> </td>
|
||||
<td width=50 class='print' nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?> </td>
|
||||
<!--<td width=50 bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?> </td>-->
|
||||
<td width="50" class="print"<?php echo $type_nowrap; ?>><?php echo $type; ?><bdo dir="ltr"></bdo></td>
|
||||
<!--<td width="50" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>-->
|
||||
<td width="50" class="print"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?> </td>
|
||||
<td width="50" class="print" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?> </td>
|
||||
<!--<td width="50" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?> </td>-->
|
||||
<?php
|
||||
echo "\n";
|
||||
if ($have_rel) {
|
||||
echo ' <td width=50 class="print" >';
|
||||
echo ' <td width="50" class="print">';
|
||||
if (isset($res_rel[$field_name])) {
|
||||
echo htmlspecialchars($res_rel[$field_name]['foreign_table'] . ' -> ' . $res_rel[$field_name]['foreign_field'] );
|
||||
echo htmlspecialchars($res_rel[$field_name]['foreign_table'] . ' -> ' . $res_rel[$field_name]['foreign_field']);
|
||||
}
|
||||
echo ' </td>' . "\n";
|
||||
}
|
||||
if ($cfgRelation['commwork']) {
|
||||
echo ' <td width=400 class="print" >';
|
||||
echo ' <td width="400" class="print">';
|
||||
if (isset($comments[$field_name])) {
|
||||
echo htmlspecialchars($comments[$field_name]);
|
||||
}
|
||||
echo ' </td>' . "\n";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</tr>
|
||||
<?php
|
||||
} // end while
|
||||
mysql_free_result($result);
|
||||
|
||||
echo "\n";
|
||||
?>
|
||||
</table>
|
||||
<?echo '</div>' . "\n";
|
||||
</table>
|
||||
|
||||
<?php
|
||||
echo '</div>' . "\n";
|
||||
|
||||
$count++;
|
||||
}//ends main while
|
||||
} //ends main while
|
||||
|
||||
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n";
|
||||
echo '<br><br> <input type="button" style="visibility:;width:100px;height:25px" name="print" value="' . $strPrint . '" onclick="printPage()">';
|
||||
require('./footer.inc.php3');
|
||||
?>
|
||||
<script type="text/javascript" language="javascript1.2">
|
||||
<!--
|
||||
function printPage()
|
||||
{
|
||||
document.all.print.style.visibility='hidden';
|
||||
document.all.print.style.visibility = 'hidden';
|
||||
// Do print the page
|
||||
if (typeof(window.print) != 'undefined') {
|
||||
window.print();
|
||||
}
|
||||
document.all.print.style.visibility='';
|
||||
document.all.print.style.visibility = '';
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<?php
|
||||
echo '<br /><br /> <input type="button" style="visibility: ; width: 100px; height: 25px" name="print" value="' . $strPrint . '" onclick="printPage()">' . "\n";
|
||||
|
||||
require('./footer.inc.php3');
|
||||
?>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
|
||||
@@ -18,6 +17,7 @@ if (!isset($selected_tbl)) {
|
||||
require('./libraries/relation.lib.php3');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
|
||||
/**
|
||||
* Defines the url to return to in case of error in a sql statement
|
||||
*/
|
||||
@@ -165,8 +165,7 @@ while (list($key, $table) = each($the_tables)) {
|
||||
}
|
||||
else {
|
||||
$have_rel = FALSE;
|
||||
}
|
||||
// end if
|
||||
} // end if
|
||||
|
||||
|
||||
/**
|
||||
@@ -182,21 +181,21 @@ while (list($key, $table) = each($the_tables)) {
|
||||
?>
|
||||
|
||||
<!-- TABLE INFORMATIONS -->
|
||||
<table width=100% bordercolorlight=black border style='border-collapse:collapse;background-color:white'>
|
||||
<table width="100%" bordercolorlight="black" border="border" style="border-collapse: collapse; background-color: white">
|
||||
<tr>
|
||||
<th width=50><?php echo ucfirst($strField); ?></th>
|
||||
<th width=50><?php echo ucfirst($strType); ?></th>
|
||||
<!--<th width=50><?php echo ucfirst($strAttr); ?></th>-->
|
||||
<th width=50><?php echo ucfirst($strNull); ?></th>
|
||||
<th width=50><?php echo ucfirst($strDefault); ?></th>
|
||||
<!--<th width=50><?php echo ucfirst($strExtra); ?></th>-->
|
||||
<th width="50"><?php echo ucfirst($strField); ?></th>
|
||||
<th width="50"><?php echo ucfirst($strType); ?></th>
|
||||
<!--<th width="50"><?php echo ucfirst($strAttr); ?></th>-->
|
||||
<th width="50"><?php echo ucfirst($strNull); ?></th>
|
||||
<th width="50"><?php echo ucfirst($strDefault); ?></th>
|
||||
<!--<th width="50"><?php echo ucfirst($strExtra); ?></th>-->
|
||||
<?php
|
||||
echo "\n";
|
||||
if ($have_rel) {
|
||||
echo ' <th width=50>' . ucfirst($strLinksTo) . '</th>' . "\n";
|
||||
echo ' <th width="50">' . ucfirst($strLinksTo) . '</th>' . "\n";
|
||||
}
|
||||
if ($cfgRelation['commwork']) {
|
||||
echo ' <th width=400>' . ucfirst($strComments) . '</th>' . "\n";
|
||||
echo ' <th width="400">' . ucfirst($strComments) . '</th>' . "\n";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
@@ -248,7 +247,7 @@ while (list($key, $table) = each($the_tables)) {
|
||||
echo "\n";
|
||||
?>
|
||||
<tr>
|
||||
<td width=50 class='print' nowrap="nowrap">
|
||||
<td width="50" class="print" nowrap="nowrap">
|
||||
<?php
|
||||
if (isset($pk_array[$row['Field']])) {
|
||||
echo ' <u>' . $field_name . '</u> ' . "\n";
|
||||
@@ -257,22 +256,22 @@ while (list($key, $table) = each($the_tables)) {
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td width=50 class='print' <?php echo $type_nowrap; ?>><?php echo $type; ?><bdo dir="ltr"></bdo></td>
|
||||
<!--<td width=50 bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>-->
|
||||
<td width=50 class='print'><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?> </td>
|
||||
<td width=50 class='print' nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?> </td>
|
||||
<!--<td width=50 bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?> </td>-->
|
||||
<td width="50" class="print"<?php echo $type_nowrap; ?>><?php echo $type; ?><bdo dir="ltr"></bdo></td>
|
||||
<!--<td width="50" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>-->
|
||||
<td width="50" class="print"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?> </td>
|
||||
<td width="50" class="print" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?> </td>
|
||||
<!--<td width="50" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?> </td>-->
|
||||
<?php
|
||||
echo "\n";
|
||||
if ($have_rel) {
|
||||
echo ' <td width=50 class="print" >';
|
||||
echo ' <td width="50" class="print">';
|
||||
if (isset($res_rel[$field_name])) {
|
||||
echo htmlspecialchars($res_rel[$field_name]['foreign_table'] . ' -> ' . $res_rel[$field_name]['foreign_field'] );
|
||||
}
|
||||
echo ' </td>' . "\n";
|
||||
}
|
||||
if ($cfgRelation['commwork']) {
|
||||
echo ' <td width=400 class="print" >';
|
||||
echo ' <td width="400" class="print">';
|
||||
$comments = PMA_getComments($db, $table);
|
||||
if (isset($comments[$field_name])) {
|
||||
echo htmlspecialchars($comments[$field_name]);
|
||||
@@ -304,7 +303,7 @@ while (list($key, $table) = each($the_tables)) {
|
||||
|
||||
<!-- Indexes -->
|
||||
<big><?php echo $strIndexes . ' :'; ?></big>
|
||||
<table bordercolorlight=black border style='border-collapse:collapse;background-color:white'>
|
||||
<table bordercolorlight="black" border="border" style="border-collapse: collapse; background-color: white">
|
||||
<tr>
|
||||
<th><?php echo $strKeyname; ?></th>
|
||||
<th><?php echo $strType; ?></th>
|
||||
@@ -409,7 +408,7 @@ while (list($key, $table) = each($the_tables)) {
|
||||
<!-- Space usage -->
|
||||
<td class="print" valign="top">
|
||||
<big><?php echo $strSpaceUsage . ' :'; ?></big>
|
||||
<table width=100% bordercolorlight=black border style='border-collapse:collapse;background-color:white'>
|
||||
<table width="100%" bordercolorlight="black" border="border" style="border-collapse: collapse; background-color: white">
|
||||
<tr>
|
||||
<th><?php echo $strType; ?></th>
|
||||
<th colspan="2" align="center"><?php echo $strUsage; ?></th>
|
||||
@@ -465,7 +464,7 @@ while (list($key, $table) = each($the_tables)) {
|
||||
<!-- Rows Statistic -->
|
||||
<td valign="top">
|
||||
<big><?php echo $strRowsStatistic . ' :'; ?></big>
|
||||
<table width=100% bordercolorlight=black border style='border-collapse:collapse;background-color:white'>
|
||||
<table width=100% bordercolorlight="black" border="border" style="border-collapse: collapse; background-color: white">
|
||||
<tr>
|
||||
<th><?php echo $strStatement; ?></th>
|
||||
<th align="center"><?php echo $strValue; ?></th>
|
||||
@@ -570,13 +569,22 @@ while (list($key, $table) = each($the_tables)) {
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n";
|
||||
echo "<br><br> <input type=button style='visibility:;width:100px;height:25px' name='print' value='Print' onclick='printPage()'>";
|
||||
require('./footer.inc.php3');
|
||||
?><script>
|
||||
?>
|
||||
<script type="text/javascript" language="javascript1.2">
|
||||
<!--
|
||||
function printPage()
|
||||
{
|
||||
document.all.print.style.visibility='hidden';
|
||||
window.print();
|
||||
document.all.print.style.visibility='';
|
||||
document.all.print.style.visibility = 'hidden';
|
||||
// Do print the page
|
||||
if (typeof(window.print) != 'undefined') {
|
||||
window.print();
|
||||
}
|
||||
document.all.print.style.visibility = '';
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<?php
|
||||
echo '<br /><br /> <input type="button" style="visibility: ; width: 100px; height: 25px" name="print" value="Print" onclick="printPage()">' . "\n";
|
||||
|
||||
require('./footer.inc.php3');
|
||||
?>
|
||||
|
Reference in New Issue
Block a user