Documentation TYPO3 par Ameos

tbl_relation.php

00001 <?php
00002 /* $Id: tbl_relation.php,v 2.5 2003/12/18 20:57:28 lem9 Exp $ */
00003 // vim: expandtab sw=4 ts=4 sts=4:
00004 
00008 require_once('./libraries/grab_globals.lib.php');
00009 require_once('./libraries/common.lib.php');
00010 require('./tbl_properties_common.php');
00011 $url_query .= '&amp;goto=tbl_properties.php';
00012 
00013 // Note: in tbl_properties_table_info we get and display the table comment.
00014 // For InnoDB, this comment contains the REFER information but any update
00015 // has not been done yet (will be done in tbl_relation later).
00016 $avoid_show_comment = TRUE;
00017 require('./tbl_properties_table_info.php');
00018 require_once('./libraries/relation.lib.php');
00019 
00020 $options_array = array('CASCADE' => 'CASCADE', 'SET_NULL' => 'SET NULL', 'NO_ACTION' => 'NO ACTION', 'RESTRICT' => 'RESTRICT');
00021 
00032 function PMA_generate_dropdown($dropdown_question,$radio_name,$choices,$selected_value) {
00033     global $font_smallest;
00034 
00035     echo $dropdown_question . '&nbsp;&nbsp;';
00036 
00037     echo '<select name="' . $radio_name . '" style="font-size: ' . $font_smallest . '">' . "\n";
00038     echo '<option value="nix" style="font-size: ' . $font_smallest . '" >--</option>' . "\n";
00039 
00040     foreach($choices AS $one_value => $one_label) {
00041         echo '<option value="' . $one_value . '"';
00042         if ($selected_value == $one_value) {
00043             echo ' selected="selected" ';
00044         }
00045         echo ' style="font-size: ' . $font_smallest . '">' . $one_label . '</option>' . "\n";
00046     }
00047     echo '</select>' . "\n";
00048     echo "\n";
00049 }
00050 
00051 
00055 $cfgRelation = PMA_getRelationsParam();
00056 
00057 
00062 if ($cfgRelation['relwork']) {
00063     $existrel = PMA_getForeigners($db, $table, '', 'internal');
00064     if ($tbl_type=='INNODB') {
00065         $existrel_innodb = PMA_getForeigners($db, $table, '', 'innodb');
00066     }
00067 }
00068 if ($cfgRelation['displaywork']) {
00069     $disp     = PMA_getDisplayField($db, $table);
00070 }
00071 if ($cfgRelation['relwork']
00072     && isset($submit_rel) && $submit_rel == 'true') {
00073 
00074     // u p d a t e s   f o r   I n t e r n a l    r e l a t i o n s
00075 
00076     foreach($destination AS $master_field => $foreign_string) {
00077         if ($foreign_string != 'nix') {
00078             list($foreign_db, $foreign_table, $foreign_field) = explode('.', $foreign_string);
00079             if (!isset($existrel[$master_field])) {
00080                 $upd_query  = 'INSERT INTO ' . PMA_backquote($cfgRelation['relation'])
00081                             . '(master_db, master_table, master_field, foreign_db, foreign_table, foreign_field)'
00082                             . ' values('
00083                             . '\'' . PMA_sqlAddslashes($db) . '\', '
00084                             . '\'' . PMA_sqlAddslashes($table) . '\', '
00085                             . '\'' . PMA_sqlAddslashes($master_field) . '\', '
00086                             . '\'' . PMA_sqlAddslashes($foreign_db) . '\', '
00087                             . '\'' . PMA_sqlAddslashes($foreign_table) . '\','
00088                             . '\'' . PMA_sqlAddslashes($foreign_field) . '\')';
00089             } else if ($existrel[$master_field]['foreign_db'] . '.' .$existrel[$master_field]['foreign_table'] . '.' . $existrel[$master_field]['foreign_field'] != $foreign_string) {
00090                 $upd_query  = 'UPDATE ' . PMA_backquote($cfgRelation['relation']) . ' SET'
00091                             . ' foreign_db       = \'' . PMA_sqlAddslashes($foreign_db) . '\', '
00092                             . ' foreign_table    = \'' . PMA_sqlAddslashes($foreign_table) . '\', '
00093                             . ' foreign_field    = \'' . PMA_sqlAddslashes($foreign_field) . '\' '
00094                             . ' WHERE master_db  = \'' . PMA_sqlAddslashes($db) . '\''
00095                             . ' AND master_table = \'' . PMA_sqlAddslashes($table) . '\''
00096                             . ' AND master_field = \'' . PMA_sqlAddslashes($master_field) . '\'';
00097             } // end if... else....
00098         } else if (isset($existrel[$master_field])) {
00099             $upd_query      = 'DELETE FROM ' . PMA_backquote($cfgRelation['relation'])
00100                             . ' WHERE master_db  = \'' . PMA_sqlAddslashes($db) . '\''
00101                             . ' AND master_table = \'' . PMA_sqlAddslashes($table) . '\''
00102                             . ' AND master_field = \'' . PMA_sqlAddslashes($master_field) . '\'';
00103         } // end if... else....
00104         if (isset($upd_query)) {
00105             $upd_rs         = PMA_query_as_cu($upd_query);
00106             unset($upd_query);
00107         }
00108     } // end while
00109 
00110 
00111     // u p d a t e s   f o r   I n n o D B
00112     // ( for now, one index name; we keep the definitions if the
00113     // foreign db is not the same)
00114     if (isset($destination_innodb)) {
00115         foreach($destination_innodb AS $master_field => $foreign_string) {
00116             if ($foreign_string != 'nix') {
00117                 list($foreign_db, $foreign_table, $foreign_field) = explode('.', $foreign_string);
00118                 if (!isset($existrel_innodb[$master_field])) {
00119                     // no key defined for this field
00120 
00121                     // The next few lines are repeated below, so they
00122                     // could be put in an include file
00123                     // Note: I tried to enclose the db and table name with
00124                     // backquotes but MySQL 4.0.16 did not like the syntax
00125                     // (for example: `base2`.`table1` )
00126 
00127                     $upd_query  = 'ALTER TABLE ' . $table
00128                                 . ' ADD FOREIGN KEY ('
00129                                 . PMA_backquote(PMA_sqlAddslashes($master_field)) . ')'
00130                                 . ' REFERENCES '
00131                                 . PMA_backquote(PMA_sqlAddslashes($foreign_db) . '.'
00132                                 . PMA_sqlAddslashes($foreign_table)) . '('
00133                                 . PMA_backquote(PMA_sqlAddslashes($foreign_field)) . ')';
00134 
00135                     if (${$master_field . '_on_delete'} != 'nix') {
00136                         $upd_query   .= ' ON DELETE ' . $options_array[${$master_field . '_on_delete'}];
00137                     }
00138                     if (${$master_field . '_on_update'} != 'nix') {
00139                         $upd_query   .= ' ON UPDATE ' . $options_array[${$master_field . '_on_update'}];
00140                     }
00141 
00142                     // end repeated code
00143 
00144                 } else if (($existrel_innodb[$master_field]['foreign_db'] . '.' .$existrel_innodb[$master_field]['foreign_table'] . '.' . $existrel_innodb[$master_field]['foreign_field'] != $foreign_string)
00145                   || ( ${$master_field . '_on_delete'} != (!empty($existrel_innodb[$master_field]['on_delete']) ? $existrel_innodb[$master_field]['on_delete'] : ''))
00146                   || ( ${$master_field . '_on_update'} != (!empty($existrel_innodb[$master_field]['on_update']) ? $existrel_innodb[$master_field]['on_update'] : ''))
00147                        ) {
00148                     // another foreign key is already defined for this field
00149                     // or
00150                     // an option has been changed for ON DELETE or ON UPDATE
00151 
00152                     // remove existing key
00153                     if (PMA_MYSQL_INT_VERSION >= 40013) {
00154                         $upd_query  = 'ALTER TABLE ' . $table
00155                                     . ' DROP FOREIGN KEY '
00156                                     . PMA_backquote($existrel_innodb[$master_field]['constraint']);
00157 
00158                         // I tried to send both in one query but it failed
00159                         $upd_rs         = PMA_mysql_query($upd_query);
00160                     }
00161 
00162                     // add another
00163                     $upd_query  = 'ALTER TABLE ' . $table
00164                                 . ' ADD FOREIGN KEY ('
00165                                 . PMA_backquote(PMA_sqlAddslashes($master_field)) . ')'
00166                                 . ' REFERENCES '
00167                                 . PMA_backquote(PMA_sqlAddslashes($foreign_db) . '.'
00168                                 . PMA_sqlAddslashes($foreign_table)) . '('
00169                                 . PMA_backquote(PMA_sqlAddslashes($foreign_field)) . ')';
00170 
00171                     if (${$master_field . '_on_delete'} != 'nix') {
00172                         $upd_query   .= ' ON DELETE ' . $options_array[${$master_field . '_on_delete'}];
00173                     }
00174                     if (${$master_field . '_on_update'} != 'nix') {
00175                         $upd_query   .= ' ON UPDATE ' . $options_array[${$master_field . '_on_update'}];
00176                     }
00177 
00178                 } // end if... else....
00179             } else if (isset($existrel_innodb[$master_field])) {
00180                     if (PMA_MYSQL_INT_VERSION >= 40013) {
00181                         $upd_query  = 'ALTER TABLE ' . $table
00182                                 . ' DROP FOREIGN KEY '
00183                                 . PMA_backquote($existrel_innodb[$master_field]['constraint']);
00184                     }
00185             } // end if... else....
00186 
00187             if (isset($upd_query)) {
00188                 $upd_rs         = PMA_mysql_query($upd_query);
00189                 if (PMA_mysql_error() && mysql_errno() == 1005) {
00190                     echo '<p class="warning">' . $strNoIndex . ' (' . $master_field .')</p>'  . PMA_showMySQLDocu('manual_Table_types', 'InnoDB_foreign_key_constraints') . "\n";
00191                 }
00192                 unset($upd_query);
00193             }
00194         } // end while
00195     } // end if isset($destination_innodb)
00196 
00197 } // end if
00198 
00199 
00200 // U p d a t e s   f o r   d i s p l a y   f i e l d
00201 
00202 if ($cfgRelation['displaywork']
00203     && isset($submit_show) && $submit_show == 'true') {
00204 
00205     if ($disp) {
00206         if ($display_field != '') {
00207             $upd_query = 'UPDATE ' . PMA_backquote($cfgRelation['table_info'])
00208                        . ' SET display_field = \'' . PMA_sqlAddslashes($display_field) . '\''
00209                        . ' WHERE db_name  = \'' . PMA_sqlAddslashes($db) . '\''
00210                        . ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\'';
00211         } else {
00212             $upd_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['table_info'])
00213                        . ' WHERE db_name  = \'' . PMA_sqlAddslashes($db) . '\''
00214                        . ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\'';
00215         }
00216     } elseif ($display_field != '') {
00217         $upd_query = 'INSERT INTO ' . PMA_backquote($cfgRelation['table_info'])
00218                    . '(db_name, table_name, display_field) '
00219                    . ' VALUES('
00220                    . '\'' . PMA_sqlAddslashes($db) . '\','
00221                    . '\'' . PMA_sqlAddslashes($table) . '\','
00222                    . '\'' . PMA_sqlAddslashes($display_field) . '\')';
00223     }
00224 
00225     if (isset($upd_query)) {
00226         $upd_rs    = PMA_query_as_cu($upd_query);
00227     }
00228 } // end if
00229 
00230 if ($cfgRelation['commwork']
00231     && isset($submit_comm) && $submit_comm == 'true') {
00232     foreach($comment AS $key => $value) {
00233         // garvin: I exported the snippet here to a function (relation.lib.php) , so it can be used multiple times throughout other pages where you can set comments.
00234         PMA_setComment($db, $table, $key, $value);
00235     }  // end while (transferred data)
00236 } // end if (commwork)
00237 
00238 // If we did an update, refresh our data
00239 if ($cfgRelation['relwork']
00240     && isset($submit_rel) && $submit_rel == 'true') {
00241     $existrel = PMA_getForeigners($db, $table, '', 'internal');
00242     if ($tbl_type=='INNODB') {
00243         $existrel_innodb = PMA_getForeigners($db, $table, '', 'innodb');
00244     }
00245 }
00246 if ($cfgRelation['displaywork']) {
00247     $disp     = PMA_getDisplayField($db, $table);
00248 }
00249 if ($cfgRelation['commwork']) {
00250     $comments = PMA_getComments($db, $table);
00251 }
00252 
00253 
00257 if ($cfgRelation['relwork']) {
00258 
00259     // To choose relations we first need all tables names in current db
00260     // and if PMA version permits and the main table is innodb,
00261     // we use SHOW TABLE STATUS because we need to find other InnoDB tables
00262 
00263     if ($tbl_type=='INNODB') {
00264         $tab_query           = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
00265     // [0] of the row is the name
00266     // [1] is the type
00267     } else {
00268         $tab_query           = 'SHOW TABLES FROM ' . PMA_backquote($db);
00269     }
00270     // [0] of the row is the name
00271 
00272     $tab_rs              = PMA_mysql_query($tab_query) or PMA_mysqlDie('', $tab_query, '', $err_url_0);
00273     $selectboxall['nix'] = '--';
00274     $selectboxall_innodb['nix'] = '--';
00275 
00276     while ($curr_table = @PMA_mysql_fetch_array($tab_rs)) {
00277         if (($curr_table[0] != $table) && ($curr_table[0] != $cfg['Server']['relation'])) {
00278             $fi_query = 'SHOW KEYS FROM ' . PMA_backquote($curr_table[0]);
00279             $fi_rs    = PMA_mysql_query($fi_query) or PMA_mysqlDie('', $fi_query, '', $err_url_0);
00280             if ($fi_rs && mysql_num_rows($fi_rs) > 0) {
00281                 $seen_a_primary=FALSE;
00282                 while ($curr_field = PMA_mysql_fetch_array($fi_rs)) {
00283                     if (isset($curr_field['Key_name']) && $curr_field['Key_name'] == 'PRIMARY') {
00284                         $seen_a_primary=TRUE;
00285                         $field_full = $db . '.' .$curr_field['Table'] . '.' . $curr_field['Column_name'];
00286                         $field_v    = $curr_field['Table'] . '->' . $curr_field['Column_name'];
00287                         $selectboxall[$field_full] =  $field_v;
00288                         // there could be more than one segment of the primary
00289                         // so do not break
00290 
00291                         // Please watch here, tbl_type is INNODB but the
00292                         // resulting value of SHOW KEYS is InnoDB
00293 
00294                         if ($tbl_type=='INNODB' && isset($curr_table[1]) && $curr_table[1]=='InnoDB') {
00295                             $selectboxall_innodb[$field_full] =  $field_v;
00296                         }
00297 
00298                     } else if (isset($curr_field['Non_unique']) && $curr_field['Non_unique'] == 0 && $seen_a_primary==FALSE) {
00299                         // if we can't find a primary key we take any unique one
00300                         // (in fact, we show all segments of unique keys
00301                         //  and all unique keys)
00302                         $field_full = $db . '.' . $curr_field['Table'] . '.' . $curr_field['Column_name'];
00303                         $field_v    = $curr_field['Table'] . '->' . $curr_field['Column_name'];
00304                         $selectboxall[$field_full] =  $field_v;
00305                         if ($tbl_type=='INNODB' && isset($curr_table[1]) && $curr_table[1]=='InnoDB') {
00306                             $selectboxall_innodb[$field_full] =  $field_v;
00307                         }
00308 
00309                     // for InnoDB, any index is allowed
00310                     } else if ($tbl_type=='INNODB' && isset($curr_table[1]) && $curr_table[1]=='InnoDB') {
00311                         $field_full = $db . '.' . $curr_field['Table'] . '.' . $curr_field['Column_name'];
00312                         $field_v    = $curr_field['Table'] . '->' . $curr_field['Column_name'];
00313                         $selectboxall_innodb[$field_full] =  $field_v;
00314 
00315                     } // end if
00316                 } // end while over keys
00317             } // end if (mysql_num_rows)
00318 
00319         // Mike Beck - 24.07.02: i've been asked to add all keys of the
00320         // current table (see bug report #574851)
00321         }
00322         else if ($curr_table[0] == $table) {
00323             $fi_query = 'SHOW KEYS FROM ' . PMA_backquote($curr_table[0]);
00324             $fi_rs    = PMA_mysql_query($fi_query) or PMA_mysqlDie('', $fi_query, '', $err_url_0);
00325             if ($fi_rs && mysql_num_rows($fi_rs) > 0) {
00326                 while ($curr_field = PMA_mysql_fetch_array($fi_rs)) {
00327                     $field_full = $db . '.' . $curr_field['Table'] . '.' . $curr_field['Column_name'];
00328                     $field_v    = $curr_field['Table'] . '->' . $curr_field['Column_name'];
00329                     $selectboxall[$field_full] =  $field_v;
00330                     if ($tbl_type=='INNODB' && isset($curr_table[1]) && $curr_table[1]=='InnoDB') {
00331                         $selectboxall_innodb[$field_full] =  $field_v;
00332                     }
00333                 } // end while
00334             } // end if (mysql_num_rows)
00335         }
00336     } // end while over tables
00337 
00338 } // end if
00339 
00340 
00341 // Now find out the columns of our $table
00342 $col_query = 'SHOW COLUMNS FROM ' . PMA_backquote($table);
00343 $col_rs    = PMA_mysql_query($col_query) or PMA_mysqlDie('', $col_query, '', $err_url_0);
00344 
00345 if ($col_rs && mysql_num_rows($col_rs) > 0) {
00346     while ($row = PMA_mysql_fetch_array($col_rs)) {
00347         $save_row[] = $row;
00348     }
00349     $saved_row_cnt  = count($save_row);
00350 
00351     ?>
00352 <form method="post" action="tbl_relation.php">
00353     <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
00354     <input type="hidden" name="submit_rel" value="true" />
00355 
00356     <table>
00357     <tr>
00358         <th colspan="4" align="center"><b><?php echo $strLinksTo; ?></b></th>
00359     </tr>
00360     <tr>
00361         <th></th><th><b><?php echo $strInternalRelations;
00362         if ($tbl_type=='INNODB') {
00363             echo '&nbsp;(*)';
00364         }
00365         ?></b></th>
00366         <?php
00367         if ($tbl_type=='INNODB') {
00368             echo '<th colspan="2">InnoDB';
00369             if (PMA_MYSQL_INT_VERSION < 40013) {
00370                 echo '&nbsp;(**)';
00371             }
00372             echo '</th>';
00373         }
00374         ?>
00375     </tr>
00376     <?php
00377     for ($i = 0; $i < $saved_row_cnt; $i++) {
00378         $myfield = $save_row[$i]['Field'];
00379         echo "\n";
00380         ?>
00381     <tr>
00382         <th><?php echo $save_row[$i]['Field']; ?></th>
00383         <td>
00384             <select name="destination[<?php echo htmlspecialchars($save_row[$i]['Field']); ?>]">
00385         <?php
00386         echo "\n";
00387 
00388         // PMA internal relations
00389         if (isset($existrel[$myfield])) {
00390             $foreign_field    = $existrel[$myfield]['foreign_db'] . '.'
00391                      . $existrel[$myfield]['foreign_table'] . '.'
00392                      . $existrel[$myfield]['foreign_field'];
00393         } else {
00394             $foreign_field    = FALSE;
00395         }
00396         $seen_key = FALSE;
00397         foreach($selectboxall AS $key => $value) {
00398             echo '                '
00399                  . '<option value="' . htmlspecialchars($key) . '"';
00400             if ($foreign_field && $key == $foreign_field) {
00401                 echo ' selected="selected"';
00402                 $seen_key = TRUE;
00403             }
00404             echo '>' . $value . '</option>'. "\n";
00405         } // end while
00406 
00407         // if the link defined in relationtable points to a foreign field
00408         // that is not a key in the foreign table, we show the link
00409         // (will not be shown with an arrow)
00410         if ($foreign_field && !$seen_key) {
00411             echo '                '
00412                  . '<option value="' . htmlspecialchars($foreign_field) . '"';
00413             echo ' selected="selected"';
00414             echo '>' . $foreign_field . '</option>'. "\n";
00415         }
00416         ?>
00417             </select>
00418         </td>
00419         <?php
00420         if ($tbl_type=='INNODB') {
00421         ?>
00422         <td>
00423             <select name="destination_innodb[<?php echo htmlspecialchars($save_row[$i]['Field']); ?>]">
00424         <?php
00425             if (isset($existrel_innodb[$myfield])) {
00426                 $foreign_field    = $existrel_innodb[$myfield]['foreign_db'] . '.'
00427                          . $existrel_innodb[$myfield]['foreign_table'] . '.'
00428                          . $existrel_innodb[$myfield]['foreign_field'];
00429             } else {
00430                 $foreign_field    = FALSE;
00431             }
00432 
00433             $found_foreign_field = FALSE;
00434             foreach($selectboxall_innodb AS $key => $value) {
00435                 echo '                '
00436                      . '<option value="' . htmlspecialchars($key) . '"';
00437                 if ($foreign_field && $key == $foreign_field) {
00438                     echo ' selected="selected"';
00439                     $found_foreign_field = TRUE;
00440                 }
00441                 echo '>' . $value . '</option>'. "\n";
00442             } // end while
00443 
00444             // we did not find the foreign field in the tables of current db,
00445             // must be defined in another db so show it to avoid erasing it
00446             if (!$found_foreign_field && $foreign_field) {
00447                 echo '                '
00448                      . '<option value="' . htmlspecialchars($foreign_field) . '"';
00449                 echo ' selected="selected"';
00450                 echo '>' . $foreign_field . '</option>'. "\n";
00451             }
00452 
00453         ?>
00454                 </select>
00455         </td>
00456         <td>
00457         <?php
00458               PMA_generate_dropdown('ON DELETE',
00459                   htmlspecialchars($save_row[$i]['Field']) . '_on_delete',
00460                   $options_array,
00461                   (isset($existrel_innodb[$myfield]['on_delete']) ? $existrel_innodb[$myfield]['on_delete']: '') );
00462 
00463               echo '&nbsp;&nbsp;&nbsp;';
00464 
00465               PMA_generate_dropdown('ON UPDATE',
00466                   htmlspecialchars($save_row[$i]['Field']) . '_on_update',
00467                   $options_array,
00468                   (isset($existrel_innodb[$myfield]['on_update']) ? $existrel_innodb[$myfield]['on_update']: '') );
00469 
00470         }
00471         ?>
00472         </td>
00473     </tr>
00474         <?php
00475     } // end for
00476 
00477     echo "\n";
00478     ?>
00479     <tr>
00480         <td colspan="2" align="center">
00481             <input type="submit" value="<?php echo '  ' . $strGo . '  '; ?>" />
00482         </td>
00483     </tr>
00484     </table>
00485     <?php
00486         if ($tbl_type=='INNODB') {
00487             echo $strInternalNotNecessary . '<br />';
00488                 if (PMA_MYSQL_INT_VERSION < 40013) {
00489                     echo '** ' . sprintf($strUpgrade, 'MySQL', '4.0.13') . '<br />';
00490                 }
00491         }
00492     ?>
00493 </form>
00494 
00495     <?php
00496     if ($cfgRelation['displaywork']) {
00497         // Get "display_field" infos
00498         $disp = PMA_getDisplayField($db, $table);
00499 
00500         echo "\n";
00501         ?>
00502 <form method="post" action="tbl_relation.php">
00503     <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
00504     <input type="hidden" name="submit_show" value="true" />
00505 
00506     <p><?php echo $strChangeDisplay . ': '; ?>
00507     <select name="display_field" onchange="this.form.submit();">
00508         <option value="">---</option>
00509         <?php
00510         echo "\n";
00511         mysql_data_seek($col_rs, 0);
00512         while ($row = @PMA_mysql_fetch_array($col_rs)) {
00513             echo '        <option value="' . htmlspecialchars($row['Field']) . '"';
00514             if (isset($disp) && $row['Field'] == $disp) {
00515                 echo ' selected="selected"';
00516             }
00517             echo '>' . htmlspecialchars($row['Field']) . '</option>'. "\n";
00518         } // end while
00519         ?>
00520     </select>
00521     <script type="text/javascript" language="javascript">
00522     <!--
00523     // Fake js to allow the use of the <noscript> tag
00524     //-->
00525     </script>
00526     <noscript>
00527         <input type="submit" value="<?php echo $strGo; ?>" />
00528     </noscript>
00529 </form>
00530 </p>
00531         <?php
00532     } // end if (displayworks)
00533 
00534     if ($cfgRelation['commwork']) {
00535 
00536         echo "\n";
00537         ?>
00538 <form method="post" action="tbl_relation.php">
00539     <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
00540     <input type="hidden" name="submit_comm" value="true" />
00541 
00542     <table>
00543     <tr>
00544         <th colspan="2" align="center"><b><?php echo $strComments; ?></b></th>
00545     </tr>
00546         <?php
00547         for ($i = 0; $i < $saved_row_cnt; $i++) {
00548             $field = $save_row[$i]['Field'];
00549             echo "\n";
00550             ?>
00551     <tr>
00552         <th><?php echo $field; ?></th>
00553         <td>
00554             <input type="text" name="comment[<?php echo $field; ?>]" value="<?php echo (isset($comments[$field]) ?  htmlspecialchars($comments[$field]) : ''); ?>" />
00555         </td>
00556     </tr>
00557             <?php
00558         } // end for
00559 
00560         echo "\n";
00561         ?>
00562     <tr>
00563         <td colspan="2" align="center">
00564             <input type="submit" value="<?php echo $strGo; ?>" />
00565         </td>
00566     </tr>
00567     </table>
00568 </form>
00569         <?php
00570     } //    end if (comments work)
00571 } // end if (we have columns in this table)
00572 
00573 
00577 require_once('./footer.inc.php');
00578 ?>


Généré par TYPO3 Ameos avec  doxygen 1.4.6