home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / phptriad / phptriad2-2-1.exe / htdocs / phpmyadmin / tbl_indexes.php < prev    next >
PHP Script  |  2002-01-06  |  20KB  |  522 lines

  1. <?php
  2. /* $Id: tbl_indexes.php,v 1.8 2001/12/22 16:55:32 lem9 Exp $ */
  3.  
  4. /**
  5.  * Gets some core libraries
  6.  */
  7. require('./libraries/grab_globals.lib.php');
  8. require('./libraries/common.lib.php');
  9.  
  10.  
  11. /**
  12.  * Defines the index types ("FULLTEXT" is available since MySQL 3.23.23)
  13.  */
  14. $index_types_cnt   = 3;
  15. $index_types       = array(
  16.     'PRIMARY',
  17.     'INDEX',
  18.     'UNIQUE'
  19. );
  20. if (PMA_MYSQL_INT_VERSION >= 32323) {
  21.     $index_types[] = 'FULLTEXT';
  22.     $index_types_cnt++;
  23. }
  24.  
  25.  
  26. /**
  27.  * Ensures the db & table are valid, then loads headers and gets indexes
  28.  * informations.
  29.  * Skipped if this script is called by "tbl_properties.php"
  30.  */
  31. if (!defined('PMA_IDX_INCLUDED')) {
  32.     // Not a valid db name -> back to the welcome page
  33.     if (!empty($db)) {
  34.         $is_db = @mysql_select_db($db);
  35.     }
  36.     if (empty($db) || !$is_db) {
  37.         header('Location: ' . $cfgPmaAbsoluteUri . 'main.php?lang=' . $lang . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
  38.         exit();
  39.     }
  40.     // Not a valid table name -> back to the db_details.php
  41.     if (!empty($table)) {
  42.         $is_table = @mysql_query("SHOW TABLES LIKE '" . PMA_sqlAddslashes($table, TRUE) . '\'');
  43.     }
  44.     if (empty($table) || !@mysql_numrows($is_table)) {
  45.         header('Location: ' . $cfgPmaAbsoluteUri . 'db_details.php?lang=' . $lang . '&server=' . $server . '&db=' . urlencode($db) . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
  46.         exit();
  47.     } else if (isset($is_table)) {
  48.         mysql_free_result($is_table);
  49.     }
  50.  
  51.     // Displays headers (if needed)
  52.     $js_to_run = ((isset($index) && isset($do_save_data)) ? 'functions.js' : 'indexes.js');
  53.     include('./header.inc.php');
  54. } // end if
  55.  
  56.  
  57. /**
  58.  * Gets fields and indexes informations
  59.  */
  60. if (defined('PMA_IDX_INCLUDED')) {
  61.     $err_url_0 = 'db_details.php'
  62.                . '?lang=' . $lang
  63.                . '&server=' . $server
  64.                . '&db=' . urlencode($db);
  65. }
  66.  
  67. //  Gets table keys and store them in arrays
  68. $indexes      = array();
  69. $prev_index   = '';
  70. $indexes_info = array();
  71. $indexes_data = array();
  72. // keys had already been grabbed in "tbl_properties.php"
  73. if (defined('PMA_IDX_INCLUDED')) {
  74.     $idx_cnt     = count($ret_keys);
  75. } else {
  76.     $local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
  77.     $result      = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
  78.     $idx_cnt     = mysql_num_rows($result);
  79. }
  80.  
  81. for ($i = 0; $i < $idx_cnt; $i++) {
  82.     $row = (defined('PMA_IDX_INCLUDED') ? $ret_keys[$i] : mysql_fetch_array($result));
  83.  
  84.     if ($row['Key_name'] != $prev_index ){
  85.         $indexes[]  = $row['Key_name'];
  86.         $prev_index = $row['Key_name'];
  87.     }
  88.     $indexes_info[$row['Key_name']]['Sequences'][]     = $row['Seq_in_index'];
  89.     $indexes_info[$row['Key_name']]['Non_unique']      = $row['Non_unique'];
  90.     if (isset($row['Cardinality'])) {
  91.         $indexes_info[$row['Key_name']]['Cardinality'] = $row['Cardinality'];
  92.     }
  93. //    I don't know what does following column mean....
  94. //    $indexes_info[$row['Key_name']]['Packed']          = $row['Packed'];
  95.     $indexes_info[$row['Key_name']]['Comment']         = $row['Comment'];
  96.  
  97.     $indexes_data[$row['Key_name']][$row['Seq_in_index']]['Column_name']  = $row['Column_name'];
  98.     if (isset($row['Sub_part'])) {
  99.         $indexes_data[$row['Key_name']][$row['Seq_in_index']]['Sub_part'] = $row['Sub_part'];
  100.     }
  101. } // end while
  102.  
  103. if (defined('PMA_IDX_INCLUDED')) {
  104.     unset($ret_keys);
  105. } else if ($result) {
  106.     mysql_free_result($result);
  107. }
  108.  
  109. // Get fields and stores their name/type
  110. // fields had already been grabbed in "tbl_properties.php"
  111. if (defined('PMA_IDX_INCLUDED')) {
  112.     mysql_data_seek($fields_rs, 0);
  113. } else {
  114.     $local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
  115.     $fields_rs   = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
  116.     $fields_cnt  = mysql_num_rows($fields_rs);
  117. }
  118.  
  119. $fields_names           = array();
  120. $fields_types           = array();
  121. while ($row = mysql_fetch_array($fields_rs)) {
  122.     $fields_names[]     = $row['Field'];
  123.     // loic1: set or enum types: slashes single quotes inside options
  124.     if (eregi('^(set|enum)\((.+)\)$', $row['Type'], $tmp)) {
  125.         $tmp[2]         = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
  126.         $fields_types[] = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
  127.     } else {
  128.         $fields_types[] = $row['Type'];
  129.     }
  130. } // end while
  131.  
  132. if ($fields_rs) {
  133.     mysql_free_result($fields_rs);
  134. }
  135.  
  136.  
  137. /**
  138.  * Stipslashes some variables if required
  139.  */
  140. if (get_magic_quotes_gpc()) {
  141.     if (isset($index)) {
  142.         $index     = stripslashes($index);
  143.     }
  144.     if (isset($old_index)) {
  145.         $old_index = stripslashes($old_index);
  146.     }
  147. } // end if
  148.  
  149.     
  150. /**
  151.  * Do run the query to build the new index and moves back to
  152.  * "tbl_properties.php"
  153.  */
  154. if (!defined('PMA_IDX_INCLUDED')
  155.     && (isset($index) && isset($do_save_data))) {
  156.  
  157.     $err_url     = 'tbl_indexes.php'
  158.                  . '?lang=' . $lang
  159.                  . '&server=' . $server
  160.                  . '&db=' . urlencode($db)
  161.                  . '&table=' . urlencode($table);
  162.     if (empty($old_index)) {
  163.         $err_url .= '&create_index=1&idx_num_fields=' . $idx_num_fields;
  164.     } else {
  165.         $err_url .= '&index=' . urlencode($old_index);
  166.     }
  167.  
  168.     if ($index_type == 'PRIMARY') {
  169.         if ($index == '') {
  170.             $index = 'PRIMARY';
  171.         } else if ($index != 'PRIMARY') {
  172.             PMA_mysqlDie($strPrimaryKeyName, '', FALSE, $err_url);
  173.         }
  174.     } else if ($index == 'PRIMARY') {
  175.          PMA_mysqlDie($strCantRenameIdxToPrimary, '', FALSE, $err_url);
  176.     }
  177.  
  178.     $sql_query         = 'ALTER TABLE ' . PMA_backquote($table);
  179.  
  180.     // Drops the old index
  181.     if (!empty($old_index)) {
  182.         if ($old_index == 'PRIMARY') {
  183.             $sql_query .= ' DROP PRIMARY KEY,';
  184.         } else {
  185.              $sql_query .= ' DROP INDEX ' . PMA_backquote($old_index) .',';
  186.         }
  187.     } // end if
  188.  
  189.     // Builds the new one
  190.     switch ($index_type) {
  191.         case 'PRIMARY':
  192.             $sql_query .= ' ADD PRIMARY KEY (';
  193.             break;
  194.         case 'FULLTEXT':
  195.             $sql_query .= ' ADD FULLTEXT ' . (empty($index) ? '' : PMA_backquote($index)) . ' (';
  196.             break;
  197.         case 'UNIQUE':
  198.             $sql_query .= ' ADD UNIQUE ' . (empty($index) ? '' : PMA_backquote($index)) . ' (';
  199.             break;
  200.         case 'INDEX':
  201.             $sql_query .= ' ADD INDEX ' . (empty($index) ? '' : PMA_backquote($index)) . ' (';
  202.             break;
  203.     } // end switch
  204.     $index_fields         = '';
  205.     while (list($i, $name) = each($column)) {
  206.         if ($name != '--ignore--') {
  207.             $index_fields .= (empty($index_fields) ? '' : ',')
  208.                           . PMA_backquote(get_magic_quotes_gpc() ? stripslashes($name) : $name)
  209.                           . (empty($sub_part[$i]) ? '' : '(' . $sub_part[$i] . ')');
  210.         }
  211.     } // end while
  212.     if (empty($index_fields)){
  213.         PMA_mysqlDie($strNoIndexPartsDefined, '', FALSE, $err_url);
  214.     } else {
  215.         $sql_query .= $index_fields . ')';
  216.     }
  217.  
  218.     $result    = mysql_query($sql_query) or PMA_mysqlDie('', '', FALSE, $err_url);
  219.     $message   = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered;
  220.  
  221.     include('./tbl_properties.php');
  222.     exit();
  223. } // end builds the new index
  224.  
  225.  
  226. /**
  227.  * Edits an index or defines a new one
  228.  */
  229. else if (!defined('PMA_IDX_INCLUDED')
  230.          && (isset($index) || isset($create_index))) {
  231.  
  232.     // Prepares the form values
  233.     if (!isset($index)) {
  234.         $index                                = '';
  235.     }
  236.     if (!isset($old_index)){
  237.         $old_index                            = $index;
  238.     }
  239.     if (!isset($index_type)) {
  240.         $index_type                           = '';
  241.     }
  242.     if ($old_index == '' || !isset($indexes_info[$old_index])) {
  243.         $edited_index_info['Sequences']       = array();
  244.         $edited_index_data                    = array();
  245.         for ($i = 1; $i <= $idx_num_fields; $i++) {
  246.             $edited_index_info['Sequences'][] = $i;
  247.             $edited_index_data[$i]            = array('Column_name' => '', 'Sub_part' => '');
  248.         } // end for
  249.         if ($old_index == ''
  250.             && !isset($indexes_info['PRIMARY'])
  251.             && ($index_type == '' || $index_type == 'PRIMARY')) {
  252.             $old_index                        = 'PRIMARY';
  253.         }
  254.     } else {
  255.         $edited_index_info                    = $indexes_info[$old_index];
  256.         $edited_index_data                    = $indexes_data[$old_index];
  257.         if ($edited_index_info['Comment'] == 'FULLTEXT') {
  258.             $index_type                       = 'FULLTEXT';
  259.         } else if ($index == 'PRIMARY') {
  260.             $index_type                       = 'PRIMARY';
  261.         } else if ($edited_index_info['Non_unique'] == '0') {
  262.             $index_type                       = 'UNIQUE';
  263.         } else {
  264.             $index_type                       = 'INDEX';
  265.         }
  266.     } // end if... else...
  267.  
  268.     if (isset($add_fields)) {
  269.         if (isset($prev_add_fields)) {
  270.             $added_fields += $prev_add_fields;
  271.         }
  272.         $field_cnt = count($edited_index_info['Sequences']) + 1;
  273.         for ($i = $field_cnt; $i < ($added_fields + $field_cnt); $i++) {
  274.             $edited_index_info['Sequences'][] = $i;
  275.             $edited_index_data[$i]            = array('Column_name' => '', 'Sub_part' => '');
  276.         } // end for
  277.  
  278.         // Restore entered values
  279.         while (list($i, $name) = each($column)) {
  280.             if ($name != '--ignore--'){
  281.                 $edited_index_data[$i+1]['Column_name'] = $name;
  282.                 $edited_index_data[$i+1]['Sub_part']    = $sub_part[$i];
  283.             }
  284.         } // end while
  285.     } // end if
  286.     // end preparing form values
  287.     ?>
  288.  
  289. <!-- Build index form -->
  290. <form action="tbl_indexes.php" method="post" name="index_frm"
  291.     onsubmit="if (typeof(this.elements['index'].disabled) != 'undefined') {this.elements['index'].disabled = false}">
  292.     <input type="hidden" name="lang" value="<?php echo $lang; ?>" />
  293.     <input type="hidden" name="server" value="<?php echo $server; ?>" />
  294.     <input type="hidden" name="db" value="<?php echo $db; ?>" />
  295.     <input type="hidden" name="table" value="<?php echo $table; ?>" />
  296.     <?php
  297.     if (isset($create_index)) {
  298.         echo '<input type="hidden" name="create_index" value="1" />';
  299.     }
  300.     echo "\n";
  301.     ?>
  302.     <input type="hidden" name="old_index" value="<?php echo (isset($create_index) ? '' : $old_index); ?>" />
  303.     <b><?php echo '------ ' . (isset($create_index) ? $strCreateIndexTopic : $strModifyIndexTopic) . ' ------'; ?></b>
  304.     <br /><br />
  305.  
  306.     <table border="0">
  307.     <tr>
  308.         <td><?php echo $strIndexName; ?> </td>
  309.         <td>
  310.             <input type="text" name="index" value="<?php echo htmlspecialchars($index); ?>" onfocus="this.select()" />
  311.              <?php echo $strPrimaryKeyWarning . "\n"; ?>
  312.         </td>
  313.     </tr>
  314.     <tr>
  315.         <td><?php echo $strIndexType; ?> </td>
  316.         <td>
  317.             <select name="index_type" onchange="return checkIndexName()">
  318.     <?php
  319.     echo "\n";
  320.     for ($i = 0; $i < $index_types_cnt; $i++) {
  321.         if ($index_types[$i] == 'PRIMARY') {
  322.             if ($index == 'PRIMARY' || !isset($indexes_info['PRIMARY'])) {
  323.                 echo '                '
  324.                      . '<option value="PRIMARY"' . (($index_type == 'PRIMARY') ? ' selected="selected"' : '') . '>PRIMARY</option>'
  325.                      . "\n";
  326.             }
  327.         } else {
  328.             echo '                '
  329.                  . '<option value="' . $index_types[$i] . '"' . (($index_type == $index_types[$i]) ? ' selected="selected"' : '') . '>'. $index_types[$i] . '</option>'
  330.                  . "\n";
  331.  
  332.         } // end if... else...
  333.     } // end for
  334.     ?>
  335.             </select> 
  336.             <?php echo PMA_showDocuShort('A/L/ALTER_TABLE.html') . "\n"; ?>
  337.         </td>
  338.     </tr>
  339.     </table><br />
  340.  
  341.     <table border="<?php echo $cfgBorder; ?>" cellpadding="5">
  342.     <tr>
  343.         <th><?php echo $strField; ?></th>
  344.         <th><?php echo $strSize; ?></th>
  345.     </tr>
  346.     <?php
  347.     while (list($row_no, $seq_index) = each($edited_index_info['Sequences'])) {
  348.         $add_type     = (is_array($fields_types) && count($fields_types) == count($fields_names));
  349.         $selected     = $edited_index_data[$seq_index]['Column_name'];
  350.         if (!empty($edited_index_data[$seq_index]['Sub_part'])) {
  351.             $sub_part = ' value="' . $edited_index_data[$seq_index]['Sub_part'] . '"';
  352.         } else {
  353.             $sub_part = '';
  354.         }
  355.         $bgcolor      = (($row_no % 2) ? $cfgBgcolorOne : $cfgBgcolorTwo);
  356.         echo "\n";
  357.         ?>
  358.     <tr>
  359.         <td bgcolor="<?php echo $bgcolor; ?>">
  360.             <select name="column[]">
  361.                 <option value="--ignore--"<?php if ('--ignore--' == $selected) echo ' selected="selected"'; ?>>
  362.                     -- <?php echo $strIgnore; ?> --</option>
  363.         <?php
  364.         reset($fields_names);
  365.         while (list($key, $val) = each($fields_names)) {
  366.             if ($index_type != 'FULLTEXT'
  367.                 || eregi('^(varchar|text|tinytext|mediumtext|longtext)', $fields_types[$key])) {
  368.                 echo "\n" . '                '
  369.                      . '<option value="' . htmlspecialchars($val) . '"' . (($val == $selected) ? ' selected="selected"' : '') . '>'
  370.                      . htmlspecialchars($val) . (($add_type) ? ' [' . $fields_types[$key] . ']' : '' ) . '</option>' . "\n";
  371.             }
  372.         } // end while
  373.         echo "\n";
  374.         ?>
  375.             </select>
  376.         </td>
  377.         <td bgcolor="<?php echo $bgcolor; ?>">
  378.             <input type="text" size="5" name="sub_part[]"<?php echo $sub_part; ?> onfocus="this.select()" />
  379.         </td>
  380.     </tr>
  381.         <?php
  382.     } // end while
  383.  
  384.     echo "\n";
  385.     ?>
  386.     </table><br />
  387.  
  388.     <input type="submit" name="do_save_data" value="<?php echo $strSave; ?>" /><br />
  389.  
  390.     <?php
  391.     echo "\n";
  392.     if (isset($added_fields)) {
  393.         echo '    <input type="hidden" name="prev_add_fields" value="' . $added_fields . '" />';
  394.     }
  395.     if (isset($idx_num_fields)) {
  396.         echo '    <input type="hidden" name="idx_num_fields" value="' . $idx_num_fields . '" />' . "\n";
  397.     }
  398.     echo '    <hr /><br />' . "\n";
  399.     echo '    ' . sprintf($strAddToIndex,  '<input type="text" name="added_fields" size="4" value="1" onfocus="this.select()" />') . "\n";
  400.     echo '     <input type="submit" name="add_fields" value="' . $strGo . '" onclick="return checkFormElementInRange(this.form, \'added_fields\', 1)" />' . "\n";
  401.  
  402. } else {
  403.     /**
  404.      * Display indexes
  405.      */
  406.     ?>
  407.     <!-- Indexes form -->
  408.     <form action="tbl_indexes.php" method="post">
  409.         <input type="hidden" name="lang" value="<?php echo $lang; ?>" />
  410.         <input type="hidden" name="server" value="<?php echo $server; ?>" />
  411.         <input type="hidden" name="db" value="<?php echo $db; ?>" />
  412.         <input type="hidden" name="table" value="<?php echo $table; ?>" />
  413.     <?php    
  414.     echo "\n";
  415.     echo '        ' . $strIndexes . ' :' . "\n";
  416.     echo '        ' . PMA_showDocuShort('O/p/Optimising_Database_Structure.html') . '<br />' ."\n";
  417.  
  418.     if ($idx_cnt > 0) {
  419.         ?>
  420.         <table border="<?php echo $cfgBorder; ?>">
  421.         <tr>
  422.             <th><?php echo $strKeyname; ?></th>
  423.             <th><?php echo $strType; ?></th>
  424.             <th><?php echo $strCardinality; ?></th>
  425.             <th colspan="2"><?php echo $strAction; ?></th>
  426.             <th colspan="2"><?php echo $strField; ?></th>
  427.         </tr>
  428.         <?php
  429.         echo "\n";
  430.         while (list($index_no, $index_name) = each($indexes)) {
  431.             $cell_bgd = (($index_no % 2) ? $cfgBgcolorOne : $cfgBgcolorTwo);
  432.             $index_td = '            <td bgcolor="' . $cell_bgd . '" rowspan="' . count($indexes_info[$index_name]['Sequences']) . '">' . "\n";
  433.             echo '        <tr>' . "\n";
  434.             echo $index_td
  435.                  . '                ' . htmlspecialchars($index_name) . "\n"
  436.                  . '            </td>' . "\n";
  437.  
  438.             if ($indexes_info[$index_name]['Comment'] == 'FULLTEXT') {
  439.                 $index_type = 'FULLTEXT';
  440.             } else if ($index_name == 'PRIMARY') {
  441.                 $index_type = 'PRIMARY';
  442.             } else if ($indexes_info[$index_name]['Non_unique'] == '0') {
  443.                 $index_type = 'UNIQUE';
  444.             } else {
  445.                 $index_type = 'INDEX';
  446.             }
  447.             echo $index_td
  448.                  . '                ' . $index_type . "\n"
  449.                  . '            </td>' . "\n";
  450.  
  451.             echo str_replace('">' . "\n", '" align="right">' . "\n", $index_td)
  452.                  . '                ' . (isset($indexes_info[$index_name]['Cardinality']) ? $indexes_info[$index_name]['Cardinality'] : $strNone) . ' ' . "\n"
  453.                  . '            </td>' . "\n";
  454.  
  455.             if ($index_name == 'PRIMARY') {
  456.                 $sql_query = urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP PRIMARY KEY');
  457.                 $js_msg    = 'ALTER TABLE ' . PMA_jsFormat($table) . ' DROP PRIMARY KEY';
  458.                 $zero_rows = urlencode($strPrimaryKeyHasBeenDropped);
  459.             } else {
  460.                 $sql_query = urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP INDEX ' . PMA_backquote($index_name));
  461.                 $js_msg    = 'ALTER TABLE ' . PMA_jsFormat($table) . ' DROP INDEX ' . PMA_jsFormat($index_name);
  462.                 $zero_rows = urlencode(sprintf($strIndexHasBeenDropped, htmlspecialchars($index_name)));
  463.             }
  464.             echo $index_td
  465.                  . '                <a href="sql.php?' . $url_query . '&sql_query=' . $sql_query . '&zero_rows=' . $zero_rows . '" onclick="return confirmLink(this, \'' . $js_msg . '\')">' . $strDrop . '</a>' . "\n"
  466.                  . '            </td>' . "\n";
  467.  
  468.             echo $index_td
  469.                  . '                <a href="tbl_indexes.php?' . $url_query . '&index=' . urlencode($index_name) . '">' . $strEdit . '</a>' . "\n"
  470.                  . '            </td>' . "\n";
  471.  
  472.             while (list($row_no, $seq_index) = each($indexes_info[$index_name]['Sequences'])) {
  473.                 if ($row_no > 0) {
  474.                     echo '        <tr>' . "\n";
  475.                 }
  476.                 if (!empty($indexes_data[$index_name][$seq_index]['Sub_part'])) {
  477.                     echo '            <td bgcolor="' . $cell_bgd . '">' . "\n"
  478.                          . '                ' . $indexes_data[$index_name][$seq_index]['Column_name'] . "\n"
  479.                          . '            </td>' . "\n";
  480.                     echo '            <td align="right" bgcolor="' . $cell_bgd . '">' . "\n"
  481.                          . '                ' . $indexes_data[$index_name][$seq_index]['Sub_part'] . "\n"
  482.                          . '            </td>' . "\n";
  483.                     echo '        </tr>' . "\n";
  484.                 } else {
  485.                     echo '            <td bgcolor="' . $cell_bgd . '" colspan="2">' . "\n"
  486.                          . '                ' . $indexes_data[$index_name][$seq_index]['Column_name'] . "\n"
  487.                          . '            </td>' . "\n";
  488.                     echo '        </tr>' . "\n";
  489.                 }
  490.             } // end while
  491.         } // end while
  492.         ?>
  493.         </table><br />
  494.         <?php
  495.         echo "\n\n";
  496.     } // end display indexes
  497.     else {
  498.         // none indexes
  499.         echo "\n" . '        <br />' . "\n";
  500.         echo '        <i>' . $strNoIndex . '</i><br /><br />' . "\n\n";
  501.     }
  502.  
  503.     echo '        ' . sprintf($strCreateIndex, '<input type="text" size="4" name="idx_num_fields" value="1" />') . "\n";
  504.     echo '         <input type="submit" name="create_index" value="' . $strGo . '" onclick="return checkFormElementInRange(this.form, \'idx_num_fields\', 1)" />' . "\n";
  505.     echo '    ';
  506. } // end display indexes
  507.  
  508. ?>
  509. </form>
  510.  
  511.  
  512. <?php
  513. /**
  514.  * Displays the footer
  515.  */
  516. echo "\n";
  517.  
  518. if (!defined('PMA_IDX_INCLUDED')){
  519.     require('./footer.inc.php');
  520. }
  521. ?>
  522.