Fixed some coding inconcistencies
This commit is contained in:
@@ -129,11 +129,12 @@ 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'])) {
|
||||||
|
if ($mergetable == FALSE) {
|
||||||
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
|
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
|
||||||
$sum_size += $tblsize;
|
$sum_size += $tblsize;
|
||||||
$sum_entries += $sts_data['Rows'];
|
$sum_entries += $sts_data['Rows'];
|
||||||
@@ -143,28 +144,29 @@ else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) {
|
|||||||
list($formated_size, $unit) = format_byte_down($tblsize, 3, 0);
|
list($formated_size, $unit) = format_byte_down($tblsize, 3, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($mergetable == true) // MyISAM MERGE Table
|
// MyISAM MERGE Table
|
||||||
{
|
else if ($mergetable == TRUE) {
|
||||||
$formated_size=" - ";
|
$formated_size = ' - ';
|
||||||
$unit="";
|
$unit = '';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
$formated_size = 'unknown';
|
||||||
$formated_size="unknown";
|
$unit = '';
|
||||||
$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">
|
||||||
|
|
||||||
<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 {
|
||||||
|
@@ -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();
|
$ob_mode = out_buffer_mode_get();
|
||||||
if ($ob_mode) {
|
if ($ob_mode) {
|
||||||
out_buffer_pre($ob_mode);
|
out_buffer_pre($ob_mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends http headers
|
* Sends http headers
|
||||||
*/
|
*/
|
||||||
|
@@ -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>
|
||||||
|
12
main.php3
12
main.php3
@@ -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'],
|
$userlink = mysql_connect($cfgServer['host'], $cfgServer['user'], $cfgServer['password']) or mysql_die();
|
||||||
$cfgServer['password']) or mysql_die();
|
|
||||||
} else {
|
} else {
|
||||||
$userlink = mysql_connect($cfgServer['host'].":".
|
$userlink = mysql_connect($cfgServer['host'] . ':' . $cfgServer['port'], $cfgServer['user'], $cfgServer['password']) or mysql_die();
|
||||||
$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
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
@@ -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__
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -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";
|
||||||
@@ -190,9 +191,9 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
|
|||||||
|| ($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>
|
||||||
@@ -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";
|
||||||
|
@@ -266,14 +266,16 @@ 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') {
|
||||||
|
$mergetable = TRUE;
|
||||||
|
}
|
||||||
list($data_size, $data_unit) = format_byte_down($showtable['Data_length']);
|
list($data_size, $data_unit) = format_byte_down($showtable['Data_length']);
|
||||||
|
if ($mergetable == FALSE) {
|
||||||
if ($mergetable==false) list($index_size, $index_unit) = format_byte_down($showtable['Index_length']);
|
list($index_size, $index_unit) = format_byte_down($showtable['Index_length']);
|
||||||
|
}
|
||||||
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
|
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
|
||||||
list($free_size, $free_unit) = format_byte_down($showtable['Data_free']);
|
list($free_size, $free_unit) = format_byte_down($showtable['Data_free']);
|
||||||
}
|
}
|
||||||
@@ -304,6 +306,7 @@ 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; ?>">
|
||||||
@@ -313,8 +316,8 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
|
|||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if (isset($free_size)) {
|
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
if (isset($free_size)) {
|
||||||
?>
|
?>
|
||||||
<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,8 +331,8 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
|
|||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
if (isset($tot_size) && $mergetable == FALSE) {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
if (isset($tot_size) && $mergetable == false) {
|
|
||||||
?>
|
?>
|
||||||
<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>
|
||||||
@@ -338,7 +341,6 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
|
|||||||
</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); ?> ø</td>
|
<td><?php echo ucfirst($strRowLength); ?> ø</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); ?> Autoindex</td>
|
<td><?php echo ucfirst($strNext); ?> 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
|
||||||
|
44
tbl_qbe.php3
44
tbl_qbe.php3
@@ -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,7 +326,7 @@ 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 {
|
||||||
@@ -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 {
|
||||||
|
$stripped_or = '';
|
||||||
}
|
}
|
||||||
else $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'] = '';
|
||||||
|
@@ -71,18 +71,13 @@ if (!isset($param) || $param[0] == '') {
|
|||||||
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
|
||||||
|
Reference in New Issue
Block a user