📄 db_details_qbe.php
字号:
<!-- And/Or columns and rows --><?php$w = 0;for ($y = 0; $y <= $row; $y++) { $bgcolor = ($y % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; if (isset($ins_row[$y]) && $ins_row[$y] == 'on') { $chk['or'] = ' checked="checked"'; $chk['and'] = ''; ?> <tr> <td align="<?php echo $cell_align_right; ?>" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"> <!-- Row controls --> <table bgcolor="<?php echo $bgcolor; ?>" cellpadding="0" cellspacing="0" border="0"> <tr> <td align="<?php echo $cell_align_right; ?>" nowrap="nowrap"> <small><?php echo $strQBEIns; ?>:</small> <input type="checkbox" name="ins_row[<?php echo $w; ?>]" /> </td> <td align="<?php echo $cell_align_right; ?>"> <b><?php echo $strAnd; ?>:</b> </td> <td> <input type="radio" name="and_or_row[<?php echo $w; ?>]" value="and"<?php echo $chk['and']; ?> /> </td> </tr> <tr> <td align="<?php echo $cell_align_right; ?>" nowrap="nowrap"> <small><?php echo $strQBEDel; ?>:</small> <input type="checkbox" name="del_row[<?php echo $w; ?>]" /> </td> <td align="<?php echo $cell_align_right; ?>"> <b><?php echo $strOr; ?>:</b> </td> <td> <input type="radio" name="and_or_row[<?php echo $w; ?>]" value="or"<?php echo $chk['or']; ?> /> </td> </tr> </table> </td> <?php $z = 0; for ($x = 0; $x < $col; $x++) { if (isset($ins_col[$x]) && $ins_col[$x] == 'on') { echo "\n"; $or = 'Or' . $w . '[' . $z . ']'; ?> <td align="center" bgcolor="<?php echo $bgcolor; ?>"> <textarea cols="20" rows="2" style="width: <?php echo $realwidth; ?>" name="<?php echo $or; ?>" dir="<?php echo $text_dir; ?>"></textarea> </td> <?php $z++; } // end if if (isset($del_col[$x]) && $del_col[$x] == 'on') { continue; } echo "\n"; $or = 'Or' . $w . '[' . $z . ']'; ?> <td align="center" bgcolor="<?php echo $bgcolor; ?>"> <textarea cols="20" rows="2" style="width: <?php echo $realwidth; ?>" name="<?php echo $or; ?>" dir="<?php echo $text_dir; ?>"></textarea> </td> <?php $z++; } // end for $w++; echo "\n"; ?> </tr> <?php } // end if if (isset($del_row[$y]) && $del_row[$y] == 'on') { continue; } if (isset($and_or_row[$y])) { $curAndOrRow[$w] = $and_or_row[$y]; } if (isset($and_or_row[$y]) && $and_or_row[$y] == 'and') { $chk['and'] = ' checked="checked"'; $chk['or'] = ''; } else { $chk['or'] = ' checked="checked"'; $chk['and'] = ''; } echo "\n"; ?> <tr> <td align="<?php echo $cell_align_right; ?>" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"> <!-- Row controls --> <table bgcolor="<?php echo $bgcolor; ?>" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="<?php echo $cell_align_right; ?>" nowrap="nowrap"> <small><?php echo $strQBEIns; ?>:</small> <input type="checkbox" name="ins_row[<?php echo $w; ?>]" /> </td> <td align="<?php echo $cell_align_right; ?>"> <b><?php echo $strAnd; ?>:</b> </td> <td> <input type="radio" name="and_or_row[<?php echo $w; ?>]" value="and"<?php echo $chk['and']; ?> /> </td> </tr> <tr> <td align="<?php echo $cell_align_right; ?>" nowrap="nowrap"> <small><?php echo $strQBEDel; ?>:</small> <input type="checkbox" name="del_row[<?php echo $w; ?>]" /> </td> <td align="<?php echo $cell_align_right; ?>"> <b><?php echo $strOr; ?>:</b> </td> <td> <input type="radio" name="and_or_row[<?php echo $w; ?>]" value="or"<?php echo $chk['or']; ?> /> </td> </tr> </table> </td> <?php $z = 0; for ($x = 0; $x < $col; $x++) { if (!empty($ins_col) && isset($ins_col[$x]) && $ins_col[$x] == 'on') { echo "\n"; $or = 'Or' . $w . '[' . $z . ']'; ?> <td align="center" bgcolor="<?php echo $bgcolor; ?>"> <textarea cols="20" rows="2" style="width: <?php echo $realwidth; ?>" name="<?php echo $or; ?>" dir="<?php echo $text_dir; ?>"></textarea> </td> <?php $z++; } // end if if (!empty($del_col) && isset($del_col[$x]) && $del_col[$x] == 'on') { continue; } echo "\n"; $or = 'Or' . $y; if (!isset(${$or})) { ${$or} = ''; } if (!empty(${$or}) && isset(${$or}[$x])) { $stripped_or = ${$or}[$x]; } else { $stripped_or = ''; } ?> <td align="center" bgcolor="<?php echo $bgcolor; ?>"> <textarea cols="20" rows="2" style="width: <?php echo $realwidth; ?>" name="Or<?php echo $w . '[' . $z . ']'; ?>" dir="<?php echo $text_dir; ?>"><?php echo htmlspecialchars($stripped_or); ?></textarea> </td> <?php if (!empty(${$or}) && isset(${$or}[$x])) { ${'cur' . $or}[$z] = ${$or}[$x]; } $z++; } // end for $w++; echo "\n"; ?> </tr> <?php echo "\n";} // end for?> <!-- Modify columns --> <tr> <td class="tblHeaders" align="<?php echo $cell_align_right; ?>"> <b><?php echo $strModify; ?>: </b> </td><?php$z = 0;for ($x = 0; $x < $col; $x++) { if (!empty($ins_col) && isset($ins_col[$x]) && $ins_col[$x] == 'on') { $curAndOrCol[$z] = $and_or_col[$y]; if ($and_or_col[$z] == 'or') { $chk['or'] = ' checked="checked"'; $chk['and'] = ''; } else { $chk['and'] = ' checked="checked"'; $chk['or'] = ''; } ?> <td align="center" bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"> <b><?php echo $strOr; ?>:</b> <input type="radio" name="and_or_col[<?php echo $z; ?>]" value="or"<?php echo $chk['or']; ?> /> <b><?php echo $strAnd; ?>:</b> <input type="radio" name="and_or_col[<?php echo $z; ?>]" value="and"<?php echo $chk['and']; ?> /> <br /> <?php echo $strQBEIns . "\n"; ?> <input type="checkbox" name="ins_col[<?php echo $z; ?>]" /> <?php echo $strQBEDel . "\n"; ?> <input type="checkbox" name="del_col[<?php echo $z; ?>]" /> </td> <?php $z++; } // end if echo "\n"; if (!empty($del_col) && isset($del_col[$x]) && $del_col[$x] == 'on') { continue; } if (isset($and_or_col[$y])) { $curAndOrCol[$z] = $and_or_col[$y]; } if (isset($and_or_col[$z]) && $and_or_col[$z] == 'or') { $chk['or'] = ' checked="checked"'; $chk['and'] = ''; } else { $chk['and'] = ' checked="checked"'; $chk['or'] = ''; } ?> <td align="center" bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"> <b><?php echo $strOr; ?>:</b> <input type="radio" name="and_or_col[<?php echo $z; ?>]" value="or"<?php echo $chk['or']; ?> /> <b><?php echo $strAnd; ?>:</b> <input type="radio" name="and_or_col[<?php echo $z; ?>]" value="and"<?php echo $chk['and']; ?> /> <br /> <?php echo $strQBEIns . "\n"; ?> <input type="checkbox" name="ins_col[<?php echo $z; ?>]" /> <?php echo $strQBEDel . "\n"; ?> <input type="checkbox" name="del_col[<?php echo $z; ?>]" /> </td> <?php $z++; echo "\n";} // end for?> </tr></table><!-- Other controls --><?php echo PMA_generate_common_hidden_inputs(); ?><table border="0" cellpadding="2" cellspacing="1"> <tr> <td nowrap="nowrap"><input type="hidden" value="<?php echo htmlspecialchars($db); ?>" name="db" /> <input type="hidden" value="<?php echo $z; ?>" name="col_cnt" /> <?php $w--; ?> <input type="hidden" value="<?php echo $w; ?>" name="rows" /> <?php echo $strAddDeleteRow; ?>: <select size="1" name="add_row" style="vertical-align: middle"> <option value="-3">-3</option> <option value="-2">-2</option> <option value="-1">-1</option> <option value="0" selected="selected">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> </td> <td width="10"> </td> <td nowrap="nowrap"><?php echo $strAddDeleteColumn; ?>: <select size="1" name="add_col" style="vertical-align: middle"> <option value="-3">-3</option> <option value="-2">-2</option> <option value="-1">-1</option> <option value="0" selected="selected">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> </td> <td width="10"> </td> <!-- Generates a query --> <td><input type="submit" name="modify" value="<?php echo $strUpdateQuery; ?>" /></td> </tr></table><br /><table border="0" cellpadding="2" cellspacing="1"> <tr> <td class="tblHeaders"> <?php echo $strUseTables; ?>: </td> <td width="20"> </td> <td class="tblHeaders"> <?php echo sprintf($strQueryOnDb, htmlspecialchars($db)); ?> </td> </tr> <tr> <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php$strTableListOptions = '';$numTableListOptions = 0;foreach ($tbl_names AS $key => $val) { $strTableListOptions .= ' '; $strTableListOptions .= '<option value="' . htmlspecialchars($key) . '"' . $val . '>' . htmlspecialchars($key) . '</option>' . "\n"; $numTableListOptions++;}?> <select name="TableList[]" size="<?php echo ($numTableListOptions > 30) ? '15' : '7'; ?>" multiple="multiple" id="listTable"> <?php echo $strTableListOptions; ?> </select> </td> <td> </td> <!-- Displays the current query --> <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"> <textarea cols="30" rows="<?php echo ($numTableListOptions > 30) ? '15' : '7'; ?>" name="sql_query" dir="<?php echo $text_dir; ?>" id="textSqlquery"><?php// 1. SELECT$last_select = 0;$encoded_qry = '';if (!isset($qry_select)) { $qry_select = '';}for ($x = 0; $x < $col; $x++) { if (!empty($curField[$x]) && isset($curShow[$x]) && $curShow[$x] == 'on') { if ($last_select) { $qry_select .= ', '; } $qry_select .= $curField[$x]; $last_select = 1; }} // end forif (!empty($qry_select)) { $encoded_qry .= urlencode('SELECT ' . $qry_select . "\n"); echo 'SELECT ' . htmlspecialchars($qry_select) . "\n";}// 2. FROM// Create LEFT JOINS out of Relations// Code originally by Mike Beck <mike.beck@ibmiller.de>// If we can use Relations we could make some left joins.// First find out if relations are available in this database.// First we need the really needed Tables - those in TableList might still be// all Tables.if (isset($Field) && count($Field) > 0) { // Initialize some variables $tab_all = array(); $col_all = array(); $tab_wher = array(); $tab_know = array(); $tab_left = array(); $col_where = array(); $fromclause = ''; // We only start this if we have fields, otherwise it would be dumb foreach ($Field AS $value) { $parts = explode('.', $value); if (!empty($parts[0]) && !empty($parts[1])) { $tab_raw = urldecode($parts[0]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -