Fixed some coding inconcistencies

This commit is contained in:
Loïc Chapeaux
2001-08-03 13:59:05 +00:00
parent 2bcac2ef74
commit ed04c1e6b0
9 changed files with 154 additions and 154 deletions

View File

@@ -129,42 +129,44 @@ else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) {
</td> </td>
<?php <?php
echo "\n"; echo "\n";
$mergetable=false; $mergetable = FALSE;
if (isset($sts_data['Type']) && $sts_data['Type']=="MRG_MyISAM") $mergetable=true; if (isset($sts_data['Type']) && $sts_data['Type'] == 'MRG_MyISAM') {
if (isset($sts_data['Rows'])) $mergetable = TRUE;
{ }
if ($mergetable == false){ if (isset($sts_data['Rows'])) {
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length']; if ($mergetable == FALSE) {
$sum_size += $tblsize; $tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
$sum_entries += $sts_data['Rows']; $sum_size += $tblsize;
if ($tblsize > 0) { $sum_entries += $sts_data['Rows'];
list($formated_size, $unit) = format_byte_down($tblsize, 3, 1); if ($tblsize > 0) {
} else { list($formated_size, $unit) = format_byte_down($tblsize, 3, 1);
list($formated_size, $unit) = format_byte_down($tblsize, 3, 0); } else {
list($formated_size, $unit) = format_byte_down($tblsize, 3, 0);
}
}
// MyISAM MERGE Table
else if ($mergetable == TRUE) {
$formated_size = '&nbsp;-&nbsp;';
$unit = '';
}
else {
$formated_size = 'unknown';
$unit = '';
} }
}
else if ($mergetable == true) // MyISAM MERGE Table
{
$formated_size="&nbsp;-&nbsp;";
$unit="";
}
else
{
$formated_size="unknown";
$unit="";
}
?> ?>
<td align="right"> <td align="right">
<?php <?php
if ($mergetable == true) echo "<i>"; echo "\n";
echo number_format($sts_data['Rows'], 0, $number_decimal_separator, if ($mergetable == TRUE) {
$number_thousands_separator) . "\n"; echo '<i>' . number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . '</i>' . "\n";
if ($mergetable == true) echo "</i>"; } else {
?> echo number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n";
}
?>
</td> </td>
<td align="right" nowrap="nowrap"> <td align="right" nowrap="nowrap">
&nbsp;&nbsp; &nbsp;&nbsp;
<a href="tbl_properties.php3?<?php echo $url_query; ?>#showusage"><?php echo $formated_size . ' ' . $unit; ?></a> <a href="tbl_properties.php3?<?php echo $url_query; ?>>#showusage"><?php echo $formated_size . ' ' . $unit; ?></a>
</td> </td>
<?php <?php
} else { } else {

View File

@@ -7,15 +7,14 @@
*/ */
require('./lib.inc.php3'); require('./lib.inc.php3');
require('./ob_lib.inc.php3'); require('./ob_lib.inc.php3');
if ($cfgOBGzip) {
if ($cfgOBGzip) $ob_mode = out_buffer_mode_get();
{ if ($ob_mode) {
$ob_mode = out_buffer_mode_get(); out_buffer_pre($ob_mode);
if ($ob_mode) { }
out_buffer_pre($ob_mode);
}
} }
/** /**
* Sends http headers * Sends http headers
*/ */

View File

@@ -33,7 +33,7 @@ $url_query = 'lang=' . $lang
<title>phpMyAdmin <?php echo PHPMYADMIN_VERSION; ?> - <?php echo $HTTP_HOST; ?></title> <title>phpMyAdmin <?php echo PHPMYADMIN_VERSION; ?> - <?php echo $HTTP_HOST; ?></title>
</head> </head>
<frameset cols="<?php echo $cfgLeftWidth;?>,*" rows="*" border="0" frameborder="0"> <frameset cols="<?php echo $cfgLeftWidth; ?>,*" rows="*" border="0" frameborder="0">
<frame src="left.php3?<?php echo $url_query; ?>" name="nav"> <frame src="left.php3?<?php echo $url_query; ?>" name="nav">
<frame src="<?php echo (empty($db)) ? 'main.php3' : 'db_details.php3'; ?>?<?php echo $url_query; ?>" name="phpmain"> <frame src="<?php echo (empty($db)) ? 'main.php3' : 'db_details.php3'; ?>?<?php echo $url_query; ?>" name="phpmain">
</frameset> </frameset>

View File

@@ -119,9 +119,9 @@ if ($server > 0
{ {
// Get user's rights // Get user's rights
if (empty($cfgServer['port'])) { if (empty($cfgServer['port'])) {
$stdlink = mysql_connect($cfgServer['host'], $cfgServer['stduser'], $cfgServer['stdpass']); $stdlink = mysql_connect($cfgServer['host'], $cfgServer['stduser'], $cfgServer['stdpass']);
} else { } else {
$stdlink = mysql_connect($cfgServer['host'] . ':' . $cfgServer['port'], $cfgServer['stduser'], $cfgServer['stdpass']); $stdlink = mysql_connect($cfgServer['host'] . ':' . $cfgServer['port'], $cfgServer['stduser'], $cfgServer['stdpass']);
} }
// Does user have global Create priv? // Does user have global Create priv?
$rs_usr = mysql_query('SELECT * FROM mysql.user WHERE User = \'' . sql_addslashes($cfgServer['user']) . '\'', $stdlink); $rs_usr = mysql_query('SELECT * FROM mysql.user WHERE User = \'' . sql_addslashes($cfgServer['user']) . '\'', $stdlink);
@@ -134,18 +134,14 @@ if ($server > 0
// find, in most cases it's probably the one he just dropped :) // find, in most cases it's probably the one he just dropped :)
// (Note: we only get here after a browser reload, I don't know why) // (Note: we only get here after a browser reload, I don't know why)
if (!$create) { if (!$create) {
if (empty($cfgServer['port'])) {
if (empty($cfgServer['port'])) { $userlink = mysql_connect($cfgServer['host'], $cfgServer['user'], $cfgServer['password']) or mysql_die();
$userlink = mysql_connect($cfgServer['host'], $cfgServer['user'], } else {
$cfgServer['password']) or mysql_die(); $userlink = mysql_connect($cfgServer['host'] . ':' . $cfgServer['port'], $cfgServer['user'], $cfgServer['password']) or mysql_die();
} else { }
$userlink = mysql_connect($cfgServer['host'].":".
$cfgServer['port'], $cfgServer['user'],
$cfgServer['password']) or mysql_die();
}
$rs_usr = mysql_query('SELECT Db FROM mysql.db WHERE User = \'' . sql_addslashes($cfgServer['user']) . '\'', $stdlink); $rs_usr = mysql_query('SELECT Db FROM mysql.db WHERE User = \'' . sql_addslashes($cfgServer['user']) . '\'', $stdlink);
while ($row = mysql_fetch_array($rs_usr)) { while ($row = mysql_fetch_array($rs_usr)) {
if (!mysql_select_db($row['Db'],$userlink)) { if (!mysql_select_db($row['Db'], $userlink)) {
$db_to_create = $row['Db']; $db_to_create = $row['Db'];
$create = TRUE; $create = TRUE;
break; break;
@@ -228,7 +224,7 @@ if ($server > 0
echo "\n"; echo "\n";
} // end of 2.1 (AdvAuth case) } // end of 2.1 (AdvAuth case)
// 2.2. No authentification // 2.2. No authentication
else else
{ {
?> ?>

View File

@@ -1,9 +1,9 @@
<?php <?php
/* $Id$ */ /* $Id$ */
if(!defined('__OB_LIB_INC__')) {
define('__OB_LIB_INC__', 1);
if (!defined('__OB_LIB_INC__')) {
define('__OB_LIB_INC__', 1);
# Output buffer functions for phpMyAdmin # Output buffer functions for phpMyAdmin
@@ -80,6 +80,6 @@
return $retval; return $retval;
} }
} // INC } // $__OB_LIB_INC__
?> ?>

View File

@@ -1,5 +1,5 @@
<?php <?php
/* $Id$ */ /* $Id: tbl_change.php3,v 1.26 2001/08/03 12:22:16 lem9 Exp */
/** /**
@@ -80,7 +80,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
echo "\n"; echo "\n";
// The type column // The type column
$row_table_def['True_Type']=ereg_replace('\\(.*','',$row_table_def['Type']); $row_table_def['True_Type'] = ereg_replace('\\(.*', '', $row_table_def['Type']);
switch ($row_table_def['True_Type']) { switch ($row_table_def['True_Type']) {
case 'set': case 'set':
$type = 'set'; $type = 'set';
@@ -117,20 +117,21 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
// Change by Bernard M. Piller <bernard@bmpsystems.com> // Change by Bernard M. Piller <bernard@bmpsystems.com>
// We don't want binary data to be destroyed // We don't want binary data to be destroyed
// Note: from the MySQL manual: "BINARY doesn't affect how the column // Note: from the MySQL manual: "BINARY doesn't affect how the column is
// is stored or retrieved" so it does not mean that the contents // stored or retrieved" so it does not mean that the contents is
// is binary // binary
//if ((strstr($row_table_def['Type'], 'blob') || strstr($row_table_def['Type'], 'binary')) //if ((strstr($row_table_def['Type'], 'blob') || strstr($row_table_def['Type'], 'binary'))
//if (strstr($row_table_def['Type'], 'blob') // && !empty($data)) {
if (strstr($row_table_def['True_Type'], 'blob') if (strstr($row_table_def['True_Type'], 'blob')
&& !empty($data) && !empty($data)
&& $cfgProtectBlob==TRUE) { && $cfgProtectBlob == TRUE) {
echo ' <td>' . $strBinary . '</td>' . "\n"; echo ' <td>' . $strBinary . '</td>' . "\n";
} else { } else {
?> ?>
<td> <td>
<select name="funcs[<?php echo $field; ?>]"> <option> <select name="funcs[<?php echo $field; ?>]">
<option></option>
<?php <?php
echo "\n"; echo "\n";
if (!$first_timestamp) { if (!$first_timestamp) {
@@ -161,7 +162,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
if (strstr($row_table_def['True_Type'], 'text')) { if (strstr($row_table_def['True_Type'], 'text')) {
?> ?>
<td> <td>
<textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfgTextareaRows; ?>" cols="<?php echo $cfgTextareaCols; ?>"><?php if (!empty($special_chars)) echo $special_chars . "\n"; ?></textarea> <textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfgTextareaRows; ?>" cols="<?php echo $cfgTextareaCols; ?>"><?php if (!empty($special_chars)) echo $special_chars . "\n"; ?></textarea>
</td> </td>
<?php <?php
echo "\n"; echo "\n";
@@ -187,12 +188,12 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
echo ' '; echo ' ';
echo '<option value="' . $set[$j] . '"'; echo '<option value="' . $set[$j] . '"';
if ($data == $set[$j] if ($data == $set[$j]
|| ($data == '' || ($data == ''
&& isset($row_table_def['Default']) && isset($row_table_def['Default'])
&& $set[$j] == $row_table_def['Default'])) { && $set[$j] == $row_table_def['Default'])) {
echo ' selected'; echo ' selected="selected"';
} }
echo '>' .htmlspecialchars($set[$j]) . '</option>' . "\n"; echo '>' . htmlspecialchars($set[$j]) . '</option>' . "\n";
} // end for } // end for
?> ?>
</select> </select>
@@ -208,8 +209,8 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
echo '<input type="radio" name="fields[' . urlencode($field) . ']" '; echo '<input type="radio" name="fields[' . urlencode($field) . ']" ';
echo 'value="' . substr($set[$j], 1, -1) . '"'; echo 'value="' . substr($set[$j], 1, -1) . '"';
if ($data == substr($set[$j], 1, -1) if ($data == substr($set[$j], 1, -1)
|| ($data == '' || ($data == ''
&& isset($row_table_def['Default']) && isset($row_table_def['Default'])
&& substr($set[$j], 1, -1) == $row_table_def['Default'] && substr($set[$j], 1, -1) == $row_table_def['Default']
&& $row_table_def['Null'] != 'YES')) { && $row_table_def['Null'] != 'YES')) {
// To be able to display a checkmark in the [Null] box when // To be able to display a checkmark in the [Null] box when
@@ -267,24 +268,24 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
} }
// Change by Bernard M. Piller <bernard@bmpsystems.com> // Change by Bernard M. Piller <bernard@bmpsystems.com>
// We don't want binary data destroyed // We don't want binary data destroyed
else if (strstr($row_table_def['Type'], 'blob') else if (strstr($row_table_def['Type'], 'blob') && !empty($data)) {
&& !empty($data)) { if ($cfgProtectBlob == TRUE) {
if ($cfgProtectBlob==TRUE) { echo "\n";
echo "\n"; ?>
?> <td>
<td> <?php echo $strBinaryDoNotEdit . "\n"; ?>
<?php echo $strBinaryDoNotEdit . "\n"; ?> <input type="hidden" name="fields[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" />
<input type="hidden" name="fields[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" /> </td>
</td> <?php
<?php } } else {
else { echo "\n";
?> ?>
<td> <td>
<textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfgTextareaRows; ?>" cols="<?php echo $cfgTextareaCols; ?>"><?php if (!empty($special_chars)) echo $special_chars . "\n"; ?></textarea> <textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfgTextareaRows; ?>" cols="<?php echo $cfgTextareaCols; ?>"><?php if (!empty($special_chars)) echo $special_chars . "\n"; ?></textarea>
</td>
<?php <?php
} } // end if...else
} } // end else if
else { else {
$fieldsize = (($len > 40) ? 40 : $len); $fieldsize = (($len > 40) ? 40 : $len);
echo "\n"; echo "\n";

View File

@@ -266,21 +266,23 @@ if ($index_count > 0) {
?> ?>
<?php <?php
// BEGIN - Calc Table Space - staybyte - 9 June 2001 // BEGIN - Calc Table Space - staybyte - 9 June 2001
if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type != "INNODB" && isset($showtable)) { if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type != 'INNODB' && isset($showtable)) {
// Gets some sizes // Gets some sizes
$mergetable=false; $mergetable = FALSE;
if (isset($showtable['Type']) && $showtable['Type']=="MRG_MyISAM") $mergetable=true; if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
list($data_size, $data_unit) = format_byte_down($showtable['Data_length']); $mergetable = TRUE;
if ($mergetable==false) list($index_size, $index_unit) = format_byte_down($showtable['Index_length']);
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
list($free_size, $free_unit) = format_byte_down($showtable['Data_free']);
} }
list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']); list($data_size, $data_unit) = format_byte_down($showtable['Data_length']);
list($tot_size, $tot_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']); if ($mergetable == FALSE) {
list($index_size, $index_unit) = format_byte_down($showtable['Index_length']);
}
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
list($free_size, $free_unit) = format_byte_down($showtable['Data_free']);
}
list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']);
list($tot_size, $tot_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']);
if (isset($showtable['Rows']) && $showtable['Rows']>0) { if (isset($showtable['Rows']) && $showtable['Rows']>0) {
list($avg_size, $avg_unit) = format_byte_down(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1); list($avg_size, $avg_unit) = format_byte_down(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
} }
// Displays them // Displays them
@@ -304,17 +306,18 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
<td><?php echo $data_unit; ?></td> <td><?php echo $data_unit; ?></td>
</tr> </tr>
<?php <?php
echo "\n";
if (isset($index_size)) { if (isset($index_size)) {
?> ?>
<tr bgcolor="<?php echo $cfgBgcolorTwo; ?>"> <tr bgcolor="<?php echo $cfgBgcolorTwo; ?>">
<td style="padding-right: 10px"><?php echo ucfirst($strIndex); ?></td> <td style="padding-right: 10px"><?php echo ucfirst($strIndex); ?></td>
<td align="right" nowrap="nowrap"><?php echo $index_size; ?></td> <td align="right" nowrap="nowrap"><?php echo $index_size; ?></td>
<td><?php echo $index_unit; ?></td> <td><?php echo $index_unit; ?></td>
</tr> </tr>
<?php <?php
} }
echo "\n";
if (isset($free_size)) { if (isset($free_size)) {
echo "\n";
?> ?>
<tr bgcolor="<?php echo $cfgBgcolorTwo; ?>" style="color: #bb0000"> <tr bgcolor="<?php echo $cfgBgcolorTwo; ?>" style="color: #bb0000">
<td style="padding-right: 10px"><?php echo ucfirst($strOverhead); ?></td> <td style="padding-right: 10px"><?php echo ucfirst($strOverhead); ?></td>
@@ -328,17 +331,16 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
</tr> </tr>
<?php <?php
} }
echo "\n"; if (isset($tot_size) && $mergetable == FALSE) {
if (isset($tot_size) && $mergetable == false) { echo "\n";
?> ?>
<tr bgcolor="<?php echo $cfgBgcolorOne; ?>"> <tr bgcolor="<?php echo $cfgBgcolorOne; ?>">
<td style="padding-right: 10px"><?php echo ucfirst($strTotal); ?></td> <td style="padding-right: 10px"><?php echo ucfirst($strTotal); ?></td>
<td align="right" nowrap="nowrap"><?php echo $tot_size; ?></td> <td align="right" nowrap="nowrap"><?php echo $tot_size; ?></td>
<td><?php echo $tot_unit; ?></td> <td><?php echo $tot_unit; ?></td>
</tr> </tr>
<?php <?php
} }
// Optimize link if overhead // Optimize link if overhead
if (isset($free_size) && ($tbl_type == 'MYISAM' || $tbl_type == 'BDB')) { if (isset($free_size) && ($tbl_type == 'MYISAM' || $tbl_type == 'BDB')) {
echo "\n"; echo "\n";
@@ -398,7 +400,7 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
?> ?>
<td><?php echo ucfirst($strRows); ?></td> <td><?php echo ucfirst($strRows); ?></td>
<td align="right" nowrap="nowrap"> <td align="right" nowrap="nowrap">
<?php echo number_format($showtable['Rows'], 0, $GLOBALS['number_decimal_separator'], $GLOBALS['number_thousands_separator'])."\n"; ?> <?php echo number_format($showtable['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
</td> </td>
</tr> </tr>
<?php <?php
@@ -411,12 +413,12 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
?> ?>
<td><?php echo ucfirst($strRowLength); ?>&nbsp;&oslash;</td> <td><?php echo ucfirst($strRowLength); ?>&nbsp;&oslash;</td>
<td align="right" nowrap="nowrap"> <td align="right" nowrap="nowrap">
<?php echo number_format($showtable['Avg_row_length'], 0, $GLOBALS['number_decimal_separator'], $GLOBALS['number_thousands_separator'])."\n"; ?> <?php echo number_format($showtable['Avg_row_length'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
</td> </td>
</tr> </tr>
<?php <?php
} }
if (isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable==false) { if (isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) {
echo (++$i%2) echo (++$i%2)
? ' <tr bgcolor="' . $cfgBgcolorTwo . '">' ? ' <tr bgcolor="' . $cfgBgcolorTwo . '">'
: ' <tr bgcolor="' . $cfgBgcolorOne . '">'; : ' <tr bgcolor="' . $cfgBgcolorOne . '">';
@@ -437,7 +439,7 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
?> ?>
<td><?php echo ucfirst($strNext); ?>&nbsp;Autoindex</td> <td><?php echo ucfirst($strNext); ?>&nbsp;Autoindex</td>
<td align="right" nowrap="nowrap"> <td align="right" nowrap="nowrap">
<?php echo number_format($showtable['Auto_increment'], 0, $GLOBALS['number_decimal_separator'], $GLOBALS['number_thousands_separator'])."\n"; ?> <?php echo number_format($showtable['Auto_increment'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
</td> </td>
</tr> </tr>
<?php <?php

View File

@@ -55,36 +55,36 @@ if (!isset($prev_Criteria)) {
if (!isset($Criteria)) { if (!isset($Criteria)) {
//$Criteria = ''; //$Criteria = '';
$Criteria = array(); $Criteria = array();
for ($i=0; $i<$Columns; $i++) { for ($i = 0; $i < $Columns; $i++) {
$Criteria[$i]=''; $Criteria[$i] = '';
} }
} }
if (!isset($InsRow)) { if (!isset($InsRow)) {
// $InsRow = ''; // $InsRow = '';
$InsRow = array(); $InsRow = array();
for ($i=0; $i<$Columns; $i++) { for ($i = 0; $i < $Columns; $i++) {
$InsRow[$i]=''; $InsRow[$i] = '';
} }
} }
if (!isset($DelRow)) { if (!isset($DelRow)) {
// $DelRow = ''; // $DelRow = '';
$DelRow = array(); $DelRow = array();
for ($i=0; $i<$Columns; $i++) { for ($i = 0; $i < $Columns; $i++) {
$DelRow[$i]=''; $DelRow[$i] = '';
} }
} }
if (!isset($AndOrRow)) { if (!isset($AndOrRow)) {
// $AndOrRow = ''; // $AndOrRow = '';
$AndOrRow = array(); $AndOrRow = array();
for ($i=0; $i<$Columns; $i++) { for ($i = 0; $i < $Columns; $i++) {
$AndOrRow[$i]=''; $AndOrRow[$i] = '';
} }
} }
if (!isset($AndOrCol)) { if (!isset($AndOrCol)) {
// $AndOrCol = ''; // $AndOrCol = '';
$AndOrCol = array(); $AndOrCol = array();
for ($i=0; $i<$Columns; $i++) { for ($i = 0; $i < $Columns; $i++) {
$AndOrCol[$i]=''; $AndOrCol[$i] = '';
} }
} }
$wid = 12; $wid = 12;
@@ -130,7 +130,7 @@ while ($i < mysql_num_rows($tbl_result)) {
$fld[$k++] = backquote($tbl) . '.*'; $fld[$k++] = backquote($tbl) . '.*';
while ($j < mysql_num_fields($fld_results)) { while ($j < mysql_num_fields($fld_results)) {
$fld[$k] = mysql_field_name($fld_results, $j); $fld[$k] = mysql_field_name($fld_results, $j);
$fld[$k] = backquote($tbl) . '.' . $fld[$k]; $fld[$k] = backquote($tbl) . '.' . backquote($fld[$k]);
$k++; $k++;
$j++; $j++;
} // end while } // end while
@@ -326,12 +326,12 @@ for ($x = 0; $x < $col; $x++) {
if (isset($DelCol[$x]) && $DelCol[$x] == 'on') { if (isset($DelCol[$x]) && $DelCol[$x] == 'on') {
continue; continue;
} }
if (isset($Criteria[$x])){ if (isset($Criteria[$x])) {
if (get_magic_quotes_gpc()) { if (get_magic_quotes_gpc()) {
$stripped_Criteria = stripslashes($Criteria[$x]); $stripped_Criteria = stripslashes($Criteria[$x]);
} else { } else {
$stripped_Criteria = $Criteria[$x]; $stripped_Criteria = $Criteria[$x];
} }
} }
if (!isset($prev_Criteria[$x]) if (!isset($prev_Criteria[$x])
|| urldecode($prev_Criteria[$x]) != htmlspecialchars($stripped_Criteria)) { || urldecode($prev_Criteria[$x]) != htmlspecialchars($stripped_Criteria)) {
@@ -358,7 +358,7 @@ for ($x = 0; $x < $col; $x++) {
$w = 0; $w = 0;
for ($y = 0; $y <= $row; $y++) { for ($y = 0; $y <= $row; $y++) {
$bgcolor = ($y % 2) ? $cfgBgcolorOne : $cfgBgcolorTwo; $bgcolor = ($y % 2) ? $cfgBgcolorOne : $cfgBgcolorTwo;
if (isset ($InsRow[$y]) && $InsRow[$y] == 'on') { if (isset($InsRow[$y]) && $InsRow[$y] == 'on') {
$chk['or'] = ' checked="checked"'; $chk['or'] = ' checked="checked"';
$chk['and'] = ''; $chk['and'] = '';
?> ?>
@@ -431,8 +431,9 @@ for ($y = 0; $y <= $row; $y++) {
continue; continue;
} }
if (isset($AndOrRow[$y])) {
if (isset($AndOrRow[$y])) $curAndOrRow[$w] = $AndOrRow[$y]; $curAndOrRow[$w] = $AndOrRow[$y];
}
if (isset($AndOrRow[$y]) && $AndOrRow[$y] == 'and') { if (isset($AndOrRow[$y]) && $AndOrRow[$y] == 'and') {
$chk['and'] = ' checked="checked"'; $chk['and'] = ' checked="checked"';
$chk['or'] = ''; $chk['or'] = '';
@@ -494,20 +495,23 @@ for ($y = 0; $y <= $row; $y++) {
if (!isset(${$or})) { if (!isset(${$or})) {
${$or} = ''; ${$or} = '';
} }
if (isset(${$or}[$x])){ if (isset(${$or}[$x])) {
if (get_magic_quotes_gpc()) { if (get_magic_quotes_gpc()) {
$stripped_or = stripslashes(${$or}[$x]); $stripped_or = stripslashes(${$or}[$x]);
} else { } else {
$stripped_or = ${$or}[$x]; $stripped_or = ${$or}[$x];
} }
} } else {
else $stripped_or=""; $stripped_or = '';
}
?> ?>
<td align="center" bgcolor="<?php echo $bgcolor; ?>"> <td align="center" bgcolor="<?php echo $bgcolor; ?>">
<textarea cols="20" rows="2" style="width: <?php echo $widem; ?>" name="Or<?php echo $w . '[' . $z . ']'; ?>"><?php echo htmlspecialchars($stripped_or); ?></textarea> <textarea cols="20" rows="2" style="width: <?php echo $widem; ?>" name="Or<?php echo $w . '[' . $z . ']'; ?>"><?php echo htmlspecialchars($stripped_or); ?></textarea>
</td> </td>
<?php <?php
if (isset(${$or}[$x])) ${'cur' . $or}[$z] = ${$or}[$x]; if (isset(${$or}[$x])) {
${'cur' . $or}[$z] = ${$or}[$x];
}
$z++; $z++;
} // end for } // end for
$w++; $w++;
@@ -557,7 +561,9 @@ for ($x = 0; $x < $col; $x++) {
continue; continue;
} }
if (isset($AndOrCol[$y])) $curAndOrCol[$z] = $AndOrCol[$y]; if (isset($AndOrCol[$y])) {
$curAndOrCol[$z] = $AndOrCol[$y];
}
if (isset($AndOrCol[$z]) && $AndOrCol[$z] == 'or') { if (isset($AndOrCol[$z]) && $AndOrCol[$z] == 'or') {
$chk['or'] = ' checked="checked"'; $chk['or'] = ' checked="checked"';
$chk['and'] = ''; $chk['and'] = '';

View File

@@ -70,19 +70,14 @@ if (!isset($param) || $param[0] == '') {
<?php <?php
echo "\n"; echo "\n";
for ($i = 0; $i < $fields_count; $i++) { for ($i = 0; $i < $fields_count; $i++) {
$bgcolor = ($i % 2) ? $cfgBgcolorOne : $cfgBgcolorTwo; $bgcolor = ($i % 2) ? $cfgBgcolorOne : $cfgBgcolorTwo;
$fieldsize = (($fields_len[$i] > 40) ? 40 : $fields_len[$i]);
?> ?>
<tr bgcolor="<?php echo $bgcolor; ?>"> <tr bgcolor="<?php echo $bgcolor; ?>">
<td><?php echo htmlspecialchars($fields_list[$i]); ?></td> <td><?php echo htmlspecialchars($fields_list[$i]); ?></td>
<td><?php echo $fields_type[$i]; ?></td> <td><?php echo $fields_type[$i]; ?></td>
<td> <td>
<?php <input type="text" name="fields[]" size="<?php echo $fieldsize; ?>" maxlength="<?php echo $fields_len[$i]; ?>" />
$fieldsize = (($fields_len[$i] > 40)
? 40 : $fields_len[$i]);
?>
<input type="text" name="fields[]"
size="<?php echo $fieldsize; ?>"
maxlength="<?php echo $fields_len[$i]; ?>" />
<input type="hidden" name="names[]" value="<?php echo urlencode($fields_list[$i]); ?>" /> <input type="hidden" name="names[]" value="<?php echo urlencode($fields_list[$i]); ?>" />
<input type="hidden" name="types[]" value="<?php echo $fields_type[$i]; ?>" /> <input type="hidden" name="types[]" value="<?php echo $fields_type[$i]; ?>" />
</td> </td>
@@ -152,8 +147,7 @@ else {
$cmp = ''; $cmp = '';
} }
} // end if } // end if
$sql_query .= ' AND ' . backquote(urldecode($names[$i])) $sql_query .= ' AND ' . backquote(urldecode($names[$i])) . " $cmp $quot$fields[$i]$quot";
. ' ' . "$cmp $quot$fields[$i]$quot";
} // end if } // end if
} // end for } // end for
} // end if } // end if