PageRenderTime 47ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/phpMyAdmin/tbl_relation.php

https://bitbucket.org/izubizarreta/https-bitbucket.org-bityvip
PHP | 569 lines | 395 code | 62 blank | 112 comment | 93 complexity | ff39fd15f932a83cc9ddf7dc75531aef MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.0, JSON, GPL-2.0, BSD-3-Clause, LGPL-2.1, MIT
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Display table relations for viewing and editing
  5. *
  6. * includes phpMyAdmin relations and InnoDB relations
  7. *
  8. * @todo fix name handling: currently names with dots (.) are not properly handled for internal relations (but foreign keys relations are correct)
  9. * @todo foreign key constraints require both fields being of equal type and size
  10. * @todo check foreign fields to be from same type and size, all other makes no sense
  11. * @todo add an link to create an index required for constraints, or an option to do automatically
  12. * @todo if above todos are fullfilled we can add all fields meet requirements in the select dropdown
  13. * @package PhpMyAdmin
  14. */
  15. /**
  16. * Gets some core libraries
  17. */
  18. require_once './libraries/common.inc.php';
  19. $GLOBALS['js_include'][] = 'tbl_relation.js';
  20. require_once './libraries/tbl_common.php';
  21. $url_query .= '&amp;goto=tbl_sql.php';
  22. /**
  23. * Gets tables informations
  24. */
  25. require_once './libraries/tbl_info.inc.php';
  26. // Note: in libraries/tbl_links.inc.php we get and display the table comment.
  27. // For InnoDB, this comment contains the REFER information but any update
  28. // has not been done yet (will be done in tbl_relation.php later).
  29. $avoid_show_comment = true;
  30. /**
  31. * Displays top menu links
  32. */
  33. require_once './libraries/tbl_links.inc.php';
  34. $options_array = array(
  35. 'CASCADE' => 'CASCADE',
  36. 'SET_NULL' => 'SET NULL',
  37. 'NO_ACTION' => 'NO ACTION',
  38. 'RESTRICT' => 'RESTRICT',
  39. );
  40. /**
  41. * Generate dropdown choices
  42. *
  43. * @param string $dropdown_question Message to display
  44. * @param string $select_name Name of the <select> field
  45. * @param array $choices Choices for dropdown
  46. * @param string $selected_value Selected value
  47. *
  48. * @return string The existing value (for selected)
  49. *
  50. * @access public
  51. */
  52. function PMA_generate_dropdown($dropdown_question, $select_name, $choices, $selected_value)
  53. {
  54. echo htmlspecialchars($dropdown_question) . '&nbsp;&nbsp;';
  55. echo '<select name="' . htmlspecialchars($select_name) . '">' . "\n";
  56. foreach ($choices as $one_value => $one_label) {
  57. echo '<option value="' . htmlspecialchars($one_value) . '"';
  58. if ($selected_value == $one_value) {
  59. echo ' selected="selected" ';
  60. }
  61. echo '>' . htmlspecialchars($one_label) . '</option>' . "\n";
  62. }
  63. echo '</select>' . "\n";
  64. }
  65. /**
  66. * Split a string on backquote pairs
  67. *
  68. * @param string $text original string
  69. *
  70. * @return array containing the elements (and their surrounding backquotes)
  71. *
  72. * @access public
  73. */
  74. function PMA_backquote_split($text)
  75. {
  76. $elements = array();
  77. $final_pos = strlen($text) - 1;
  78. $pos = 0;
  79. while ($pos <= $final_pos) {
  80. $first_backquote = strpos($text, '`', $pos);
  81. $second_backquote = strpos($text, '`', $first_backquote + 1);
  82. // after the second one, there might be another one which means
  83. // this is an escaped backquote
  84. if ($second_backquote < $final_pos && '`' == $text[$second_backquote + 1]) {
  85. $second_backquote = strpos($text, '`', $second_backquote + 2);
  86. }
  87. if (false === $first_backquote || false === $second_backquote) {
  88. break;
  89. }
  90. $elements[] = substr($text, $first_backquote, $second_backquote - $first_backquote + 1);
  91. $pos = $second_backquote + 1;
  92. }
  93. return($elements);
  94. }
  95. /**
  96. * Gets the relation settings
  97. */
  98. $cfgRelation = PMA_getRelationsParam();
  99. /**
  100. * Updates
  101. */
  102. if ($cfgRelation['relwork']) {
  103. $existrel = PMA_getForeigners($db, $table, '', 'internal');
  104. }
  105. if (PMA_foreignkey_supported($tbl_type)) {
  106. $existrel_foreign = PMA_getForeigners($db, $table, '', 'foreign');
  107. }
  108. if ($cfgRelation['displaywork']) {
  109. $disp = PMA_getDisplayField($db, $table);
  110. }
  111. // will be used in the logic for internal relations and foreign keys:
  112. $me_fields_name = isset($_REQUEST['fields_name'])
  113. ? $_REQUEST['fields_name']
  114. : null;
  115. // 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
  116. if (isset($destination) && $cfgRelation['relwork']) {
  117. foreach ($destination as $master_field_md5 => $foreign_string) {
  118. $upd_query = false;
  119. // Map the fieldname's md5 back to its real name
  120. $master_field = $me_fields_name[$master_field_md5];
  121. if (! empty($foreign_string)) {
  122. $foreign_string = trim($foreign_string, '`');
  123. list($foreign_db, $foreign_table, $foreign_field) = explode('.', $foreign_string);
  124. if (! isset($existrel[$master_field])) {
  125. $upd_query = 'INSERT INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['relation'])
  126. . '(master_db, master_table, master_field, foreign_db, foreign_table, foreign_field)'
  127. . ' values('
  128. . '\'' . PMA_sqlAddSlashes($db) . '\', '
  129. . '\'' . PMA_sqlAddSlashes($table) . '\', '
  130. . '\'' . PMA_sqlAddSlashes($master_field) . '\', '
  131. . '\'' . PMA_sqlAddSlashes($foreign_db) . '\', '
  132. . '\'' . PMA_sqlAddSlashes($foreign_table) . '\','
  133. . '\'' . PMA_sqlAddSlashes($foreign_field) . '\')';
  134. } elseif ($existrel[$master_field]['foreign_db'] . '.' .$existrel[$master_field]['foreign_table'] . '.' . $existrel[$master_field]['foreign_field'] != $foreign_string) {
  135. $upd_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['relation']) . ' SET'
  136. . ' foreign_db = \'' . PMA_sqlAddSlashes($foreign_db) . '\', '
  137. . ' foreign_table = \'' . PMA_sqlAddSlashes($foreign_table) . '\', '
  138. . ' foreign_field = \'' . PMA_sqlAddSlashes($foreign_field) . '\' '
  139. . ' WHERE master_db = \'' . PMA_sqlAddSlashes($db) . '\''
  140. . ' AND master_table = \'' . PMA_sqlAddSlashes($table) . '\''
  141. . ' AND master_field = \'' . PMA_sqlAddSlashes($master_field) . '\'';
  142. } // end if... else....
  143. } elseif (isset($existrel[$master_field])) {
  144. $upd_query = 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['relation'])
  145. . ' WHERE master_db = \'' . PMA_sqlAddSlashes($db) . '\''
  146. . ' AND master_table = \'' . PMA_sqlAddSlashes($table) . '\''
  147. . ' AND master_field = \'' . PMA_sqlAddSlashes($master_field) . '\'';
  148. } // end if... else....
  149. if ($upd_query) {
  150. PMA_query_as_controluser($upd_query);
  151. }
  152. } // end while
  153. } // end if (updates for internal relations)
  154. // u p d a t e s f o r f o r e i g n k e y s
  155. // (for now, one index name only; we keep the definitions if the
  156. // foreign db is not the same)
  157. // I use $sql_query to be able to display directly the query via
  158. // PMA_showMessage()
  159. if (isset($_REQUEST['destination_foreign'])) {
  160. $display_query = '';
  161. $seen_error = false;
  162. foreach ($_REQUEST['destination_foreign'] as $master_field_md5 => $foreign_string) {
  163. // Map the fieldname's md5 back to it's real name
  164. $master_field = $me_fields_name[$master_field_md5];
  165. if (! empty($foreign_string)) {
  166. list($foreign_db, $foreign_table, $foreign_field) = PMA_backquote_split($foreign_string);
  167. if (! isset($existrel_foreign[$master_field])) {
  168. // no key defined for this field
  169. // The next few lines are repeated below, so they
  170. // could be put in an include file
  171. // Note: I tried to enclose the db and table name with
  172. // backquotes but MySQL 4.0.16 did not like the syntax
  173. // (for example: `base2`.`table1`)
  174. $sql_query = 'ALTER TABLE ' . PMA_backquote($table)
  175. . ' ADD FOREIGN KEY ('
  176. . PMA_backquote($master_field) . ')'
  177. . ' REFERENCES '
  178. . $foreign_db . '.'
  179. . $foreign_table . '('
  180. . $foreign_field . ')';
  181. if (! empty($_REQUEST['on_delete'][$master_field_md5])) {
  182. $sql_query .= ' ON DELETE ' . $options_array[$_REQUEST['on_delete'][$master_field_md5]];
  183. }
  184. if (! empty($_REQUEST['on_update'][$master_field_md5])) {
  185. $sql_query .= ' ON UPDATE ' . $options_array[$_REQUEST['on_update'][$master_field_md5]];
  186. }
  187. $sql_query .= ';';
  188. $display_query .= $sql_query . "\n";
  189. // end repeated code
  190. } elseif (PMA_backquote($existrel_foreign[$master_field]['foreign_db']) != $foreign_db
  191. || PMA_backquote($existrel_foreign[$master_field]['foreign_table']) != $foreign_table
  192. || PMA_backquote($existrel_foreign[$master_field]['foreign_field']) != $foreign_field
  193. || ($_REQUEST['on_delete'][$master_field_md5] != (!empty($existrel_foreign[$master_field]['on_delete']) ? $existrel_foreign[$master_field]['on_delete'] : 'RESTRICT'))
  194. || ($_REQUEST['on_update'][$master_field_md5] != (!empty($existrel_foreign[$master_field]['on_update']) ? $existrel_foreign[$master_field]['on_update'] : 'RESTRICT'))
  195. ) {
  196. // another foreign key is already defined for this field
  197. // or
  198. // an option has been changed for ON DELETE or ON UPDATE
  199. // remove existing key and add the new one
  200. $sql_query = 'ALTER TABLE ' . PMA_backquote($table)
  201. . ' DROP FOREIGN KEY '
  202. . PMA_backquote($existrel_foreign[$master_field]['constraint']) . ', '
  203. . 'ADD FOREIGN KEY ('
  204. . PMA_backquote($master_field) . ')'
  205. . ' REFERENCES '
  206. . $foreign_db . '.'
  207. . $foreign_table . '('
  208. . $foreign_field . ')';
  209. if (! empty($_REQUEST['on_delete'][$master_field_md5])) {
  210. $sql_query .= ' ON DELETE '
  211. . $options_array[$_REQUEST['on_delete'][$master_field_md5]];
  212. }
  213. if (! empty($_REQUEST['on_update'][$master_field_md5])) {
  214. $sql_query .= ' ON UPDATE '
  215. . $options_array[$_REQUEST['on_update'][$master_field_md5]];
  216. }
  217. $sql_query .= ';';
  218. $display_query .= $sql_query . "\n";
  219. } // end if... else....
  220. } elseif (isset($existrel_foreign[$master_field])) {
  221. $sql_query = 'ALTER TABLE ' . PMA_backquote($table)
  222. . ' DROP FOREIGN KEY '
  223. . PMA_backquote($existrel_foreign[$master_field]['constraint']);
  224. $sql_query .= ';';
  225. $display_query .= $sql_query . "\n";
  226. } // end if... else....
  227. if (! empty($sql_query)) {
  228. PMA_DBI_try_query($sql_query);
  229. $tmp_error = PMA_DBI_getError();
  230. if (! empty($tmp_error)) {
  231. $seen_error = true;
  232. }
  233. if (substr($tmp_error, 1, 4) == '1216'
  234. || substr($tmp_error, 1, 4) == '1452'
  235. ) {
  236. PMA_mysqlDie($tmp_error, $sql_query, false, '', false);
  237. echo PMA_showMySQLDocu('manual_Table_types', 'InnoDB_foreign_key_constraints') . "\n";
  238. }
  239. if (substr($tmp_error, 1, 4) == '1005') {
  240. $message = PMA_Message::error(__('Error creating foreign key on %1$s (check data types)'));
  241. $message->addParam($master_field);
  242. $message->display();
  243. echo PMA_showMySQLDocu('manual_Table_types', 'InnoDB_foreign_key_constraints') . "\n";
  244. }
  245. unset($tmp_error);
  246. $sql_query = '';
  247. }
  248. } // end foreach
  249. if (!empty($display_query)) {
  250. if ($seen_error) {
  251. PMA_showMessage(__('Error'), null, 'error');
  252. } else {
  253. PMA_showMessage(__('Your SQL query has been executed successfully'), null, 'success');
  254. }
  255. }
  256. } // end if isset($destination_foreign)
  257. // U p d a t e s f o r d i s p l a y f i e l d
  258. if ($cfgRelation['displaywork'] && isset($display_field)) {
  259. $upd_query = false;
  260. if ($disp) {
  261. if ($display_field != '') {
  262. $upd_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_info'])
  263. . ' SET display_field = \'' . PMA_sqlAddSlashes($display_field) . '\''
  264. . ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\''
  265. . ' AND table_name = \'' . PMA_sqlAddSlashes($table) . '\'';
  266. } else {
  267. $upd_query = 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_info'])
  268. . ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\''
  269. . ' AND table_name = \'' . PMA_sqlAddSlashes($table) . '\'';
  270. }
  271. } elseif ($display_field != '') {
  272. $upd_query = 'INSERT INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_info'])
  273. . '(db_name, table_name, display_field) '
  274. . ' VALUES('
  275. . '\'' . PMA_sqlAddSlashes($db) . '\','
  276. . '\'' . PMA_sqlAddSlashes($table) . '\','
  277. . '\'' . PMA_sqlAddSlashes($display_field) . '\')';
  278. }
  279. if ($upd_query) {
  280. PMA_query_as_controluser($upd_query);
  281. }
  282. } // end if
  283. // If we did an update, refresh our data
  284. if (isset($destination) && $cfgRelation['relwork']) {
  285. $existrel = PMA_getForeigners($db, $table, '', 'internal');
  286. }
  287. if (isset($destination_foreign) && PMA_foreignkey_supported($tbl_type)) {
  288. $existrel_foreign = PMA_getForeigners($db, $table, '', 'foreign');
  289. }
  290. if ($cfgRelation['displaywork']) {
  291. $disp = PMA_getDisplayField($db, $table);
  292. }
  293. /**
  294. * Dialog
  295. */
  296. // common form
  297. echo '<form method="post" action="tbl_relation.php">' . "\n";
  298. echo PMA_generate_common_hidden_inputs($db, $table);
  299. // relations
  300. if ($cfgRelation['relwork'] || PMA_foreignkey_supported($tbl_type)) {
  301. // To choose relations we first need all tables names in current db
  302. // and if the main table supports foreign keys
  303. // we use SHOW TABLE STATUS because we need to find other tables of the
  304. // same engine.
  305. if (PMA_foreignkey_supported($tbl_type)) {
  306. $tab_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
  307. // [0] of the row is the name
  308. // [1] is the type
  309. } else {
  310. $tab_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
  311. // [0] of the row is the name
  312. }
  313. $tab_rs = PMA_DBI_query($tab_query, null, PMA_DBI_QUERY_STORE);
  314. $selectboxall[] = '';
  315. $selectboxall_foreign[] = '';
  316. while ($curr_table = PMA_DBI_fetch_row($tab_rs)) {
  317. $current_table = new PMA_Table($curr_table[0], $db);
  318. // explicitely ask for non-quoted list of indexed columns
  319. $selectboxall = array_merge($selectboxall, $current_table->getUniqueColumns($backquoted = false));
  320. // if foreign keys are supported, collect all keys from other
  321. // tables of the same engine
  322. if (PMA_foreignkey_supported($tbl_type)
  323. && isset($curr_table[1])
  324. && strtoupper($curr_table[1]) == $tbl_type
  325. ) {
  326. // explicitely ask for non-quoted list of indexed columns
  327. // need to obtain backquoted values to support dots inside values
  328. $selectboxall_foreign = array_merge($selectboxall_foreign, $current_table->getIndexedColumns($backquoted = true));
  329. }
  330. } // end while over tables
  331. } // end if
  332. // Now find out the columns of our $table
  333. // need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
  334. $columns = PMA_DBI_get_columns($db, $table);
  335. if (count($columns) > 0) {
  336. foreach ($columns as $row) {
  337. $save_row[] = $row;
  338. }
  339. $saved_row_cnt = count($save_row);
  340. ?>
  341. <fieldset>
  342. <legend><?php echo __('Relations'); ?></legend>
  343. <table>
  344. <tr><th><?php echo __('Column'); ?></th>
  345. <?php
  346. if ($cfgRelation['relwork']) {
  347. echo '<th>' . __('Internal relation');
  348. if (PMA_foreignkey_supported($tbl_type)) {
  349. echo PMA_showHint(__('An internal relation is not necessary when a corresponding FOREIGN KEY relation exists.'));
  350. }
  351. echo '</th>';
  352. }
  353. if (PMA_foreignkey_supported($tbl_type)) {
  354. // this does not have to be translated, it's part of the MySQL syntax
  355. echo '<th colspan="2">' . __('Foreign key constraint') . ' (' . $tbl_type . ')';
  356. echo '</th>';
  357. }
  358. ?>
  359. </tr>
  360. <?php
  361. $odd_row = true;
  362. for ($i = 0; $i < $saved_row_cnt; $i++) {
  363. $myfield = $save_row[$i]['Field'];
  364. // Use an md5 as array index to avoid having special characters in the name atttibure (see bug #1746964 )
  365. $myfield_md5 = md5($myfield);
  366. $myfield_html = htmlspecialchars($myfield);
  367. ?>
  368. <tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">
  369. <td align="center">
  370. <strong><?php echo $myfield_html; ?></strong>
  371. <input type="hidden" name="fields_name[<?php echo $myfield_md5; ?>]" value="<?php echo $myfield_html; ?>"/>
  372. </td>
  373. <?php
  374. if ($cfgRelation['relwork']) {
  375. ?>
  376. <td><select name="destination[<?php echo $myfield_md5; ?>]">
  377. <?php
  378. // PMA internal relations
  379. if (isset($existrel[$myfield])) {
  380. $foreign_field = $existrel[$myfield]['foreign_db'] . '.'
  381. . $existrel[$myfield]['foreign_table'] . '.'
  382. . $existrel[$myfield]['foreign_field'];
  383. } else {
  384. $foreign_field = false;
  385. }
  386. $seen_key = false;
  387. foreach ($selectboxall as $value) {
  388. echo ' '
  389. . '<option value="' . htmlspecialchars($value) . '"';
  390. if ($foreign_field && $value == $foreign_field) {
  391. echo ' selected="selected"';
  392. $seen_key = true;
  393. }
  394. echo '>' . htmlspecialchars($value) . '</option>'. "\n";
  395. } // end while
  396. // if the link defined in relationtable points to a foreign field
  397. // that is not a key in the foreign table, we show the link
  398. // (will not be shown with an arrow)
  399. if ($foreign_field && !$seen_key) {
  400. echo ' '
  401. .'<option value="' . htmlspecialchars($foreign_field) . '"'
  402. .' selected="selected"'
  403. .'>' . $foreign_field . '</option>'. "\n";
  404. }
  405. ?>
  406. </select>
  407. </td>
  408. <?php
  409. } // end if (internal relations)
  410. if (PMA_foreignkey_supported($tbl_type)) {
  411. echo '<td>';
  412. if (!empty($save_row[$i]['Key'])) {
  413. ?>
  414. <span class="formelement">
  415. <select name="destination_foreign[<?php echo $myfield_md5; ?>]" class="referenced_column_dropdown">
  416. <?php
  417. if (isset($existrel_foreign[$myfield])) {
  418. // need to backquote to support a dot character inside
  419. // an element
  420. $foreign_field = PMA_backquote($existrel_foreign[$myfield]['foreign_db']) . '.'
  421. . PMA_backquote($existrel_foreign[$myfield]['foreign_table']) . '.'
  422. . PMA_backquote($existrel_foreign[$myfield]['foreign_field']);
  423. } else {
  424. $foreign_field = false;
  425. }
  426. $found_foreign_field = false;
  427. foreach ($selectboxall_foreign as $value) {
  428. echo ' '
  429. . '<option value="' . htmlspecialchars($value) . '"';
  430. if ($foreign_field && $value == $foreign_field) {
  431. echo ' selected="selected"';
  432. $found_foreign_field = true;
  433. }
  434. echo '>' . htmlspecialchars($value) . '</option>'. "\n";
  435. } // end while
  436. // we did not find the foreign field in the tables of current db,
  437. // must be defined in another db so show it to avoid erasing it
  438. if (!$found_foreign_field && $foreign_field) {
  439. echo ' '
  440. . '<option value="' . htmlspecialchars($foreign_field) . '"';
  441. echo ' selected="selected"';
  442. echo '>' . $foreign_field . '</option>' . "\n";
  443. }
  444. ?>
  445. </select>
  446. </span>
  447. <span class="formelement">
  448. <?php
  449. // For ON DELETE and ON UPDATE, the default action
  450. // is RESTRICT as per MySQL doc; however, a SHOW CREATE TABLE
  451. // won't display the clause if it's set as RESTRICT.
  452. PMA_generate_dropdown('ON DELETE',
  453. 'on_delete[' . $myfield_md5 . ']',
  454. $options_array,
  455. isset($existrel_foreign[$myfield]['on_delete']) ? $existrel_foreign[$myfield]['on_delete']: 'RESTRICT');
  456. echo '</span>' . "\n"
  457. .'<span class="formelement">' . "\n";
  458. PMA_generate_dropdown('ON UPDATE',
  459. 'on_update[' . $myfield_md5 . ']',
  460. $options_array,
  461. isset($existrel_foreign[$myfield]['on_update']) ? $existrel_foreign[$myfield]['on_update']: 'RESTRICT');
  462. echo '</span>' . "\n";
  463. } else {
  464. echo __('No index defined!');
  465. } // end if (a key exists)
  466. echo ' </td>';
  467. } // end if (InnoDB)
  468. ?>
  469. </tr>
  470. <?php
  471. } // end for
  472. unset( $myfield, $myfield_md5, $myfield_html);
  473. echo ' </table>' . "\n";
  474. echo '</fieldset>' . "\n";
  475. if ($cfgRelation['displaywork']) {
  476. // Get "display_field" infos
  477. $disp = PMA_getDisplayField($db, $table);
  478. ?>
  479. <fieldset>
  480. <label><?php echo __('Choose column to display') . ': '; ?></label>
  481. <select name="display_field">
  482. <option value="">---</option>
  483. <?php
  484. foreach ($save_row AS $row) {
  485. echo ' <option value="' . htmlspecialchars($row['Field']) . '"';
  486. if (isset($disp) && $row['Field'] == $disp) {
  487. echo ' selected="selected"';
  488. }
  489. echo '>' . htmlspecialchars($row['Field']) . '</option>'. "\n";
  490. } // end while
  491. ?>
  492. </select>
  493. </fieldset>
  494. <?php
  495. } // end if (displayworks)
  496. ?>
  497. <fieldset class="tblFooters">
  498. <input type="submit" value="<?php echo __('Save'); ?>" />
  499. </fieldset>
  500. </form>
  501. <?php
  502. } // end if (we have columns in this table)
  503. /**
  504. * Displays the footer
  505. */
  506. require './libraries/footer.inc.php';
  507. ?>