- replaced $cfg['Bgcolor*'] with classes

- reduced output size by 40%
This commit is contained in:
Sebastian Mendel
2005-11-02 17:10:27 +00:00
parent 131d56cf90
commit e033b3f347
3 changed files with 55 additions and 60 deletions

View File

@@ -17,6 +17,9 @@ $Source$
* libraries/common.lib.php, browse_foreigners.php: * libraries/common.lib.php, browse_foreigners.php:
- replaced $cfg['Bgcolor*'] with classes - replaced $cfg['Bgcolor*'] with classes
- make use of fieldset - make use of fieldset
* css/print.css, dbv_datadict.php:
- replaced $cfg['Bgcolor*'] with classes
- reduced output size by 40%
2005-11-01 Marc Delisle <lem9@users.sourceforge.net> 2005-11-01 Marc Delisle <lem9@users.sourceforge.net>
* server_privileges.php: undefined variable when changing a password * server_privileges.php: undefined variable when changing a password

View File

@@ -1,3 +1,13 @@
.print_ignore { .print_ignore {
display: none; display: none;
} }
table,
table tr td,
table tr th {
border: 1px solid black;
border-collapse: collapse;
background-color: white;
color: white;
font-size: 8pt;
}

View File

@@ -41,10 +41,8 @@ if ($cfgRelation['commwork']) {
*/ */
if (is_array($comment)) { if (is_array($comment)) {
?> ?>
<!-- DB comment --> <p> <?php echo $strDBComment; ?>
<p><?php echo $strDBComment; ?> <i> <i><?php echo htmlspecialchars( implode( ' ', $comment ) ); ?></i></p>
<?php echo htmlspecialchars(implode(' ', $comment)) . "\n"; ?>
</i></p>
<?php <?php
} // end if } // end if
} }
@@ -75,11 +73,10 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
* Gets table informations * Gets table informations
*/ */
// The 'show table' statement works correct since 3.23.03 // The 'show table' statement works correct since 3.23.03
$result = PMA_DBI_query('SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'', NULL, PMA_DBI_QUERY_STORE); $showtable = PMA_DBI_get_tables_full( $db, $table );
$showtable = PMA_DBI_fetch_assoc($result); $num_rows = (isset($showtable[$table]['TABLE_ROWS']) ? $showtable[$table]['TABLE_ROWS'] : 0);
$num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0); $show_comment = (isset($showtable[$table]['TABLE_COMMENT']) ? $showtable[$table]['TABLE_COMMENT'] : '');
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : ''); unset( $showtable );
PMA_DBI_free_result($result);
/** /**
@@ -153,7 +150,7 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
* Displays the comments of the table if MySQL >= 3.23 * Displays the comments of the table if MySQL >= 3.23
*/ */
if (!empty($show_comment)) { if (!empty($show_comment)) {
echo $strTableComments . ':&nbsp;' . $show_comment . '<br /><br />'; echo $strTableComments . ': ' . $show_comment . '<br /><br />';
} }
/** /**
@@ -161,17 +158,14 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
*/ */
?> ?>
<!-- TABLE INFORMATIONS --> <table width="100%" class="print">
<table width="100%" style="border: 1px solid black; border-collapse: collapse; background-color: white;"> <tr><th width="50"><?php echo $strField; ?></th>
<tr>
<th width="50"><?php echo $strField; ?></th>
<th width="80"><?php echo $strType; ?></th> <th width="80"><?php echo $strType; ?></th>
<!--<th width="50"><?php echo $strAttr; ?></th>--> <?php /* <th width="50"><?php echo $strAttr; ?></th>*/ ?>
<th width="40"><?php echo $strNull; ?></th> <th width="40"><?php echo $strNull; ?></th>
<th width="70"><?php echo $strDefault; ?></th> <th width="70"><?php echo $strDefault; ?></th>
<!--<th width="50"><?php echo $strExtra; ?></th>--> <?php /* <th width="50"><?php echo $strExtra; ?></th>*/ ?>
<?php <?php
echo "\n";
if ($have_rel) { if ($have_rel) {
echo ' <th>' . $strLinksTo . '</th>' . "\n"; echo ' <th>' . $strLinksTo . '</th>' . "\n";
} }
@@ -183,12 +177,9 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
} }
?> ?>
</tr> </tr>
<?php <?php
$i = 0; $odd_row = true;
while ($row = PMA_DBI_fetch_assoc($result)) { while ($row = PMA_DBI_fetch_assoc($result)) {
$bgcolor = ($i % 2) ?$cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
$i++;
$type = $row['Type']; $type = $row['Type'];
// reformat mysql query output - staybyte - 9. June 2001 // reformat mysql query output - staybyte - 9. June 2001
@@ -210,10 +201,10 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
$type = preg_replace('@ZEROFILL@i', '', $type); $type = preg_replace('@ZEROFILL@i', '', $type);
$type = preg_replace('@UNSIGNED@i', '', $type); $type = preg_replace('@UNSIGNED@i', '', $type);
if (empty($type)) { if (empty($type)) {
$type = '&nbsp;'; $type = ' ';
} }
} }
$strAttribute = '&nbsp;'; $strAttribute = ' ';
if ($binary) { if ($binary) {
$strAttribute = 'BINARY'; $strAttribute = 'BINARY';
} }
@@ -231,73 +222,64 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
$row['Default'] = htmlspecialchars($row['Default']); $row['Default'] = htmlspecialchars($row['Default']);
} }
$field_name = htmlspecialchars($row['Field']); $field_name = htmlspecialchars($row['Field']);
echo "\n";
?> ?>
<tr> <tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">
<td width=50 class='print' nowrap="nowrap"> <td nowrap="nowrap">
<?php <?php
echo "\n";
if (isset($pk_array[$row['Field']])) { if (isset($pk_array[$row['Field']])) {
echo ' <u>' . $field_name . '</u>&nbsp;' . "\n"; echo '<u>' . $field_name . '</u>';
} else { } else {
echo ' ' . $field_name . '&nbsp;' . "\n"; echo $field_name;
} }
?> ?>
</td> </td>
<td width="80" class="print"<?php echo $type_nowrap; ?>><?php echo $type; ?><bdo dir="ltr"></bdo></td> <td<?php echo $type_nowrap; ?> xml:lang="en" dir="ltr"><?php echo $type; ?></td>
<!--<td width="50" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>--> <?php /* <td<?php echo $type_nowrap; ?>><?php echo $strAttribute; ?></td>*/ ?>
<td width="40" class="print"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?>&nbsp;</td> <td><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?></td>
<td width="70" class="print" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?>&nbsp;</td> <td nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?></td>
<!--<td width="50" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?>&nbsp;</td>--> <?php /* <td<?php echo $type_nowrap; ?>><?php echo $row['Extra']; ?></td>*/ ?>
<?php <?php
echo "\n";
if ($have_rel) { if ($have_rel) {
echo ' <td class="print">'; echo ' <td>';
if (isset($res_rel[$field_name])) { 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 '&nbsp;</td>' . "\n"; echo '</td>' . "\n";
} }
if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) { if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) {
echo ' <td class="print">'; echo ' <td>';
if (isset($comments[$field_name])) { if (isset($comments[$field_name])) {
echo htmlspecialchars($comments[$field_name]); echo htmlspecialchars($comments[$field_name]);
} }
echo '&nbsp;</td>' . "\n"; echo '</td>' . "\n";
} }
if ($cfgRelation['mimework']) { if ($cfgRelation['mimework']) {
$mime_map = PMA_getMIME($db, $table, true); $mime_map = PMA_getMIME($db, $table, true);
echo ' <td class="print">'; echo ' <td>';
if (isset($mime_map[$field_name])) { if (isset($mime_map[$field_name])) {
echo htmlspecialchars(str_replace('_', '/', $mime_map[$field_name]['mimetype'])); echo htmlspecialchars(str_replace('_', '/', $mime_map[$field_name]['mimetype']));
} }
echo '&nbsp;</td>' . "\n"; echo '</td>' . "\n";
} }
?> ?>
</tr> </tr>
<?php <?php
} // end while } // end while
PMA_DBI_free_result($result); PMA_DBI_free_result( $result );
$count++;
echo "\n";
?> ?>
</table> </table>
</div>
<?php <?php
echo '</div>' . "\n";
$count++;
} //ends main while } //ends main while
/** /**
* Displays the footer * Displays the footer
*/ */
echo "\n";
?> ?>
<script type="text/javascript" language="javascript1.2"> <script type="text/javascript" language="javascript">
<!-- //<![CDATA[
function printPage() function printPage()
{ {
document.getElementById('print').style.visibility = 'hidden'; document.getElementById('print').style.visibility = 'hidden';
@@ -307,10 +289,10 @@ function printPage()
} }
document.getElementById('print').style.visibility = ''; document.getElementById('print').style.visibility = '';
} }
//--> //]]>
</script> </script>
<?php <?php
echo '<br /><br />&nbsp;<input type="button" style="width: 100px; height: 25px;" id="print" value="' . $strPrint . '" onclick="printPage()" />' . "\n"; echo '<br /><br /><input type="button" id="print" value="' . $strPrint . '" onclick="printPage()" />';
require_once('./footer.inc.php'); require_once('./footer.inc.php');
?> ?>