mult_submits.lib.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * functions for multi submit forms
  5. *
  6. * @usedby mult_submits.inc.php
  7. *
  8. * @package PhpMyAdmin
  9. */
  10. if (! defined('PHPMYADMIN')) {
  11. exit;
  12. }
  13. /**
  14. * Gets url params
  15. *
  16. * @param string $what mult submit type
  17. * @param bool $reload is reload
  18. * @param string $action action type
  19. * @param string $db database name
  20. * @param string $table table name
  21. * @param array $selected selected rows(table,db)
  22. * @param array $views table views
  23. * @param string $original_sql_query original sql query
  24. * @param string $original_url_query original url query
  25. *
  26. * @return array
  27. */
  28. function PMA_getUrlParams(
  29. $what, $reload, $action, $db, $table, $selected, $views,
  30. $original_sql_query, $original_url_query
  31. ) {
  32. $_url_params = array(
  33. 'query_type' => $what,
  34. 'reload' => (! empty($reload) ? 1 : 0),
  35. );
  36. if (strpos(' ' . $action, 'db_') == 1) {
  37. $_url_params['db']= $db;
  38. } elseif (strpos(' ' . $action, 'tbl_') == 1 || $what == 'row_delete') {
  39. $_url_params['db']= $db;
  40. $_url_params['table']= $table;
  41. }
  42. foreach ($selected as $sval) {
  43. if ($what == 'row_delete') {
  44. $_url_params['selected'][] = 'DELETE FROM '
  45. . PMA_Util::backquote($db) . '.' . PMA_Util::backquote($table)
  46. . ' WHERE ' . urldecode($sval) . ' LIMIT 1;';
  47. } else {
  48. $_url_params['selected'][] = $sval;
  49. }
  50. }
  51. if ($what == 'drop_tbl' && !empty($views)) {
  52. foreach ($views as $current) {
  53. $_url_params['views'][] = $current;
  54. }
  55. }
  56. if ($what == 'row_delete') {
  57. $_url_params['original_sql_query'] = $original_sql_query;
  58. if (! empty($original_url_query)) {
  59. $_url_params['original_url_query'] = $original_url_query;
  60. }
  61. }
  62. return $_url_params;
  63. }
  64. /**
  65. * Gets query results from
  66. *
  67. * @param string $query_type query type
  68. * @param array $selected selected tables
  69. * @param string $db db name
  70. * @param string $table table name
  71. * @param string $views table views
  72. * @param string $primary table primary
  73. * @param string $from_prefix from prefix original
  74. * @param string $to_prefix to prefix original
  75. *
  76. * @return array
  77. */
  78. function PMA_getQueryStrFromSelected(
  79. $query_type, $selected, $db, $table, $views, $primary,
  80. $from_prefix, $to_prefix
  81. ) {
  82. $rebuild_database_list = false;
  83. $reload = null;
  84. $a_query = null;
  85. $sql_query = '';
  86. $sql_query_views = null;
  87. // whether to run query after each pass
  88. $run_parts = false;
  89. // whether to execute the query at the end (to display results)
  90. $use_sql = false;
  91. $result = null;
  92. if ($query_type == 'drop_tbl') {
  93. $sql_query_views = '';
  94. }
  95. $selected_cnt = count($selected);
  96. $deletes = false;
  97. for ($i = 0; $i < $selected_cnt; $i++) {
  98. switch ($query_type) {
  99. case 'row_delete':
  100. $deletes = true;
  101. $a_query = $selected[$i];
  102. $run_parts = true;
  103. break;
  104. case 'drop_db':
  105. PMA_relationsCleanupDatabase($selected[$i]);
  106. $a_query = 'DROP DATABASE '
  107. . PMA_Util::backquote($selected[$i]);
  108. $reload = 1;
  109. $run_parts = true;
  110. $rebuild_database_list = true;
  111. break;
  112. case 'drop_tbl':
  113. PMA_relationsCleanupTable($db, $selected[$i]);
  114. $current = $selected[$i];
  115. if (!empty($views) && in_array($current, $views)) {
  116. $sql_query_views .= (empty($sql_query_views) ? 'DROP VIEW ' : ', ')
  117. . PMA_Util::backquote($current);
  118. } else {
  119. $sql_query .= (empty($sql_query) ? 'DROP TABLE ' : ', ')
  120. . PMA_Util::backquote($current);
  121. }
  122. $reload = 1;
  123. break;
  124. case 'check_tbl':
  125. $sql_query .= (empty($sql_query) ? 'CHECK TABLE ' : ', ')
  126. . PMA_Util::backquote($selected[$i]);
  127. $use_sql = true;
  128. break;
  129. case 'optimize_tbl':
  130. $sql_query .= (empty($sql_query) ? 'OPTIMIZE TABLE ' : ', ')
  131. . PMA_Util::backquote($selected[$i]);
  132. $use_sql = true;
  133. break;
  134. case 'analyze_tbl':
  135. $sql_query .= (empty($sql_query) ? 'ANALYZE TABLE ' : ', ')
  136. . PMA_Util::backquote($selected[$i]);
  137. $use_sql = true;
  138. break;
  139. case 'repair_tbl':
  140. $sql_query .= (empty($sql_query) ? 'REPAIR TABLE ' : ', ')
  141. . PMA_Util::backquote($selected[$i]);
  142. $use_sql = true;
  143. break;
  144. case 'empty_tbl':
  145. $deletes = true;
  146. $a_query = 'TRUNCATE ';
  147. $a_query .= PMA_Util::backquote($selected[$i]);
  148. $run_parts = true;
  149. break;
  150. case 'drop_fld':
  151. PMA_relationsCleanupColumn($db, $table, $selected[$i]);
  152. $sql_query .= (empty($sql_query)
  153. ? 'ALTER TABLE ' . PMA_Util::backquote($table)
  154. : ',')
  155. . ' DROP ' . PMA_Util::backquote($selected[$i])
  156. . (($i == $selected_cnt-1) ? ';' : '');
  157. break;
  158. case 'primary_fld':
  159. $sql_query .= (empty($sql_query)
  160. ? 'ALTER TABLE ' . PMA_Util::backquote($table) . (empty($primary)
  161. ? ''
  162. : ' DROP PRIMARY KEY,') . ' ADD PRIMARY KEY( '
  163. : ', ')
  164. . PMA_Util::backquote($selected[$i])
  165. . (($i == $selected_cnt-1) ? ');' : '');
  166. break;
  167. case 'index_fld':
  168. $sql_query .= (empty($sql_query)
  169. ? 'ALTER TABLE ' . PMA_Util::backquote($table) . ' ADD INDEX( '
  170. : ', ')
  171. . PMA_Util::backquote($selected[$i])
  172. . (($i == $selected_cnt-1) ? ');' : '');
  173. break;
  174. case 'unique_fld':
  175. $sql_query .= (empty($sql_query)
  176. ? 'ALTER TABLE ' . PMA_Util::backquote($table) . ' ADD UNIQUE( '
  177. : ', ')
  178. . PMA_Util::backquote($selected[$i])
  179. . (($i == $selected_cnt-1) ? ');' : '');
  180. break;
  181. case 'spatial_fld':
  182. $sql_query .= (empty($sql_query)
  183. ? 'ALTER TABLE ' . PMA_Util::backquote($table) . ' ADD SPATIAL( '
  184. : ', ')
  185. . PMA_Util::backquote($selected[$i])
  186. . (($i == $selected_cnt-1) ? ');' : '');
  187. break;
  188. case 'fulltext_fld':
  189. $sql_query .= (empty($sql_query)
  190. ? 'ALTER TABLE ' . PMA_Util::backquote($table) . ' ADD FULLTEXT( '
  191. : ', ')
  192. . PMA_Util::backquote($selected[$i])
  193. . (($i == $selected_cnt-1) ? ');' : '');
  194. break;
  195. case 'add_prefix_tbl':
  196. $newtablename = $_POST['add_prefix'] . $selected[$i];
  197. // ADD PREFIX TO TABLE NAME
  198. $a_query = 'ALTER TABLE '
  199. . PMA_Util::backquote($selected[$i])
  200. . ' RENAME '
  201. . PMA_Util::backquote($newtablename);
  202. $run_parts = true;
  203. break;
  204. case 'replace_prefix_tbl':
  205. $current = $selected[$i];
  206. if (substr($current, 0, strlen($from_prefix)) == $from_prefix) {
  207. $newtablename = $to_prefix . substr($current, strlen($from_prefix));
  208. } else {
  209. $newtablename = $current;
  210. }
  211. // CHANGE PREFIX PATTERN
  212. $a_query = 'ALTER TABLE '
  213. . PMA_Util::backquote($selected[$i])
  214. . ' RENAME '
  215. . PMA_Util::backquote($newtablename);
  216. $run_parts = true;
  217. break;
  218. case 'copy_tbl_change_prefix':
  219. $current = $selected[$i];
  220. if (substr($current, 0, strlen($from_prefix)) == $from_prefix) {
  221. $newtablename = $to_prefix . substr($current, strlen($from_prefix));
  222. } else {
  223. $newtablename = $current;
  224. }
  225. $newtablename = $to_prefix . substr($current, strlen($from_prefix));
  226. // COPY TABLE AND CHANGE PREFIX PATTERN
  227. $a_query = 'CREATE TABLE '
  228. . PMA_Util::backquote($newtablename)
  229. . ' SELECT * FROM '
  230. . PMA_Util::backquote($selected[$i]);
  231. $run_parts = true;
  232. break;
  233. } // end switch
  234. // All "DROP TABLE", "DROP FIELD", "OPTIMIZE TABLE" and "REPAIR TABLE"
  235. // statements will be run at once below
  236. if ($run_parts) {
  237. $sql_query .= $a_query . ';' . "\n";
  238. if ($query_type != 'drop_db') {
  239. $GLOBALS['dbi']->selectDb($db);
  240. }
  241. $result = $GLOBALS['dbi']->query($a_query);
  242. if ($query_type == 'drop_db') {
  243. PMA_clearTransformations($selected[$i]);
  244. } elseif ($query_type == 'drop_tbl') {
  245. PMA_clearTransformations($db, $selected[$i]);
  246. } else if ($query_type == 'drop_fld') {
  247. PMA_clearTransformations($db, $table, $selected[$i]);
  248. }
  249. } // end if
  250. } // end for
  251. if ($deletes) {
  252. $_REQUEST['pos'] = PMA_calculatePosForLastPage(
  253. $db, $table, $_REQUEST['pos']
  254. );
  255. }
  256. return array(
  257. $result, $rebuild_database_list, $reload,
  258. $run_parts, $use_sql, $sql_query, $sql_query_views
  259. );
  260. }
  261. /**
  262. * Gets table primary key
  263. *
  264. * @param string $db name of db
  265. * @param string $table name of table
  266. *
  267. * @return string
  268. */
  269. function PMA_getKeyForTablePrimary($db, $table)
  270. {
  271. $GLOBALS['dbi']->selectDb($db);
  272. $result = $GLOBALS['dbi']->query(
  273. 'SHOW KEYS FROM ' . PMA_Util::backquote($table) . ';'
  274. );
  275. $primary = '';
  276. while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
  277. // Backups the list of primary keys
  278. if ($row['Key_name'] == 'PRIMARY') {
  279. $primary .= $row['Column_name'] . ', ';
  280. }
  281. } // end while
  282. $GLOBALS['dbi']->freeResult($result);
  283. return $primary;
  284. }
  285. /**
  286. * Gets HTML for replace_prefix_tbl or copy_tbl_change_prefix
  287. *
  288. * @param string $what mult_submit type
  289. * @param string $action action type
  290. * @param array $_url_params URL params
  291. *
  292. * @return string
  293. */
  294. function PMA_getHtmlForReplacePrefixTable($what, $action, $_url_params)
  295. {
  296. $html = '<form action="' . $action . '" method="post">';
  297. $html .= PMA_URL_getHiddenInputs($_url_params);
  298. $html .= '<fieldset class = "input">';
  299. $html .= '<legend>';
  300. if ($what == 'replace_prefix_tbl') {
  301. $html .= __('Replace table prefix:');
  302. } else {
  303. $html .= __('Copy table with prefix:');
  304. }
  305. $html .= '</legend>';
  306. $html .= '<table>';
  307. $html .= '<tr>';
  308. $html .= '<td>' . __('From') . '</td>';
  309. $html .= '<td>';
  310. $html .= '<input type="text" name="from_prefix" id="initialPrefix" />';
  311. $html .= '</td>';
  312. $html .= '</tr>';
  313. $html .= '<tr>';
  314. $html .= '<td>' . __('To') . '</td>';
  315. $html .= '<td>';
  316. $html .= '<input type="text" name="to_prefix" id="newPrefix" />';
  317. $html .= '</td>';
  318. $html .= '</tr>';
  319. $html .= '</table>';
  320. $html .= '</fieldset>';
  321. $html .= '<fieldset class="tblFooters">';
  322. $html .= '<input type="hidden" name="mult_btn" value="' . __('Yes') . '" />';
  323. $html .= '<input type="submit" value="' . __('Submit') . '" id="buttonYes" />';
  324. $html .= '</fieldset>';
  325. $html .= '</form>';
  326. return $html;
  327. }
  328. /**
  329. * Gets HTML for add_prefix_tbl
  330. *
  331. * @param string $action action type
  332. * @param array $_url_params URL params
  333. *
  334. * @return string
  335. */
  336. function PMA_getHtmlForAddPrefixTable($action, $_url_params)
  337. {
  338. $html = '<form action="' . $action . '" method="post">';
  339. $html .= PMA_URL_getHiddenInputs($_url_params);
  340. $html .= '<fieldset class = "input">';
  341. $html .= '<legend>' . __('Add table prefix:') . '</legend>';
  342. $html .= '<table>';
  343. $html .= '<tr>';
  344. $html .= '<td>' . __('Add prefix') . '</td>';
  345. $html .= '<td>';
  346. $html .= '<input type="text" name="add_prefix" id="txtPrefix" />';
  347. $html .= '</td>';
  348. $html .= '</tr>';
  349. $html .= '<tr>';
  350. $html .= '</table>';
  351. $html .= '</fieldset>';
  352. $html .= '<fieldset class="tblFooters">';
  353. $html .= '<input type="hidden" name="mult_btn" value="' . __('Yes') . '" />';
  354. $html .= '<input type="submit" value="' . __('Submit') . '" id="buttonYes" />';
  355. $html .= '</fieldset>';
  356. $html .= '</form>';
  357. return $html;
  358. }
  359. /**
  360. * Gets HTML for other mult_submits actions
  361. *
  362. * @param string $what mult_submit type
  363. * @param string $action action type
  364. * @param array $_url_params URL params
  365. * @param array $full_query full sql query string
  366. *
  367. * @return string
  368. */
  369. function PMA_getHtmlForOtherActions($what, $action, $_url_params, $full_query)
  370. {
  371. $html = '<fieldset class="confirmation">';
  372. $html .= '<legend>';
  373. if ($what == 'drop_db') {
  374. $html .= __('You are about to DESTROY a complete database!') . ' ';
  375. }
  376. $html .= __('Do you really want to execute the following query?');
  377. if ($what == 'row_delete') {
  378. $response = array('Yes','No');
  379. foreach ($response as $resp) {
  380. $html .= '<form action="' . $action . '" method="post">';
  381. $html .= PMA_URL_getHiddenInputs($_url_params);
  382. $html .= '<input type="hidden" name="mult_btn" value="'
  383. . __($resp) . '" />';
  384. $html .= '<input type="submit" value="' . __($resp) . '" />';
  385. $html .= '</form>';
  386. }
  387. }
  388. $html .= '</legend>';
  389. $html .= '<code>' . $full_query . '</code>';
  390. $html .= '</fieldset>';
  391. $html .= '<fieldset class="tblFooters">';
  392. $html .= '<form action="' . $action . '" method="post">';
  393. $html .= PMA_URL_getHiddenInputs($_url_params);
  394. // Display option to disable foreign key checks while dropping tables
  395. if ($what == 'drop_tbl') {
  396. $html .= '<div id="foreignkeychk">';
  397. $html .= '<span class="fkc_switch">';
  398. $html .= __('Foreign key check:');
  399. $html .= '</span>';
  400. $html .= '<span class="checkbox">';
  401. $html .= '<input type="checkbox" name="fk_check" value="1" '
  402. . 'id="fkc_checkbox"';
  403. $default_fk_check_value = $GLOBALS['dbi']->fetchValue(
  404. 'SHOW VARIABLES LIKE \'foreign_key_checks\';', 0, 1
  405. ) == 'ON';
  406. if ($default_fk_check_value) {
  407. $html .= ' checked="checked"';
  408. }
  409. $html .= '/></span>';
  410. $html .= '<span id="fkc_status" class="fkc_switch">';
  411. $html .= ($default_fk_check_value) ? __('(Enabled)') : __('(Disabled)');
  412. $html .= '</span>';
  413. $html .= '</div>';
  414. }
  415. $html .= '<input type="hidden" name="mult_btn" value="' . __('Yes') . '" />';
  416. $html .= '<input type="submit" value="' . __('Yes') . '" id="buttonYes" />';
  417. $html .= '</form>';
  418. $html .= '<form action="' . $action . '" method="post">';
  419. $html .= PMA_URL_getHiddenInputs($_url_params);
  420. $html .= '<input type="hidden" name="mult_btn" value="' . __('No') . '" />';
  421. $html .= '<input type="submit" value="' . __('No') . '" id="buttonNo" />';
  422. $html .= '</form>';
  423. $html .= '</fieldset>';
  424. return $html;
  425. }
  426. /**
  427. * Get List of information for Submit Mult
  428. *
  429. * @param string $submit_mult mult_submit type
  430. * @param string $db dtabase name
  431. * @param array $table table name
  432. * @param array $selected the selected columns
  433. * @param array $action action type
  434. *
  435. * @return array()
  436. */
  437. function PMA_getDataForSubmitMult($submit_mult, $db, $table, $selected, $action)
  438. {
  439. $what = null;
  440. $query_type = null;
  441. $is_unset_submit_mult = false;
  442. $mult_btn = null;
  443. switch ($submit_mult) {
  444. case 'drop':
  445. $what = 'drop_fld';
  446. break;
  447. case 'primary':
  448. // Gets table primary key
  449. $primary = PMA_getKeyForTablePrimary($db, $table);
  450. if (empty($primary)) {
  451. // no primary key, so we can safely create new
  452. $is_unset_submit_mult = true;
  453. $query_type = 'primary_fld';
  454. $mult_btn = __('Yes');
  455. } else {
  456. // primary key exists, so lets as user
  457. $what = 'primary_fld';
  458. }
  459. break;
  460. case 'index':
  461. $is_unset_submit_mult = true;
  462. $query_type = 'index_fld';
  463. $mult_btn = __('Yes');
  464. break;
  465. case 'unique':
  466. $is_unset_submit_mult = true;
  467. $query_type = 'unique_fld';
  468. $mult_btn = __('Yes');
  469. break;
  470. case 'spatial':
  471. $is_unset_submit_mult = true;
  472. $query_type = 'spatial_fld';
  473. $mult_btn = __('Yes');
  474. break;
  475. case 'ftext':
  476. $is_unset_submit_mult = true;
  477. $query_type = 'fulltext_fld';
  478. $mult_btn = __('Yes');
  479. break;
  480. case 'change':
  481. PMA_displayHtmlForColumnChange($db, $table, $selected, $action);
  482. // execution stops here but PMA_Response correctly finishes
  483. // the rendering
  484. exit;
  485. case 'browse':
  486. // this should already be handled by tbl_structure.php
  487. }
  488. return array($what, $query_type, $is_unset_submit_mult, $mult_btn);
  489. }
  490. /**
  491. * Get query string from Selected
  492. *
  493. * @param string $what mult_submit type
  494. * @param string $db dtabase name
  495. * @param array $table table name
  496. * @param array $selected the selected columns
  497. * @param array $action action type
  498. * @param array $views table views
  499. *
  500. * @return array()
  501. */
  502. function PMA_getQueryFromSelected($what, $db, $table, $selected, $action, $views)
  503. {
  504. $reload = null;
  505. $full_query_views = null;
  506. $full_query = '';
  507. if ($what == 'drop_tbl') {
  508. $full_query_views = '';
  509. }
  510. $selected_cnt = count($selected);
  511. $i = 0;
  512. foreach ($selected as $sval) {
  513. switch ($what) {
  514. case 'row_delete':
  515. $full_query .= 'DELETE FROM ' . PMA_Util::backquote($db)
  516. . '.' . PMA_Util::backquote($table)
  517. // Do not append a "LIMIT 1" clause here
  518. // (it's not binlog friendly).
  519. // We don't need the clause because the calling panel permits
  520. // this feature only when there is a unique index.
  521. . ' WHERE ' . urldecode($sval)
  522. . ';<br />';
  523. break;
  524. case 'drop_db':
  525. $full_query .= 'DROP DATABASE '
  526. . PMA_Util::backquote(htmlspecialchars($sval))
  527. . ';<br />';
  528. $reload = 1;
  529. break;
  530. case 'drop_tbl':
  531. $current = $sval;
  532. if (!empty($views) && in_array($current, $views)) {
  533. $full_query_views .= (empty($full_query_views) ? 'DROP VIEW ' : ', ')
  534. . PMA_Util::backquote(htmlspecialchars($current));
  535. } else {
  536. $full_query .= (empty($full_query) ? 'DROP TABLE ' : ', ')
  537. . PMA_Util::backquote(htmlspecialchars($current));
  538. }
  539. break;
  540. case 'empty_tbl':
  541. $full_query .= 'TRUNCATE ';
  542. $full_query .= PMA_Util::backquote(htmlspecialchars($sval))
  543. . ';<br />';
  544. break;
  545. case 'primary_fld':
  546. if ($full_query == '') {
  547. $full_query .= 'ALTER TABLE '
  548. . PMA_Util::backquote(htmlspecialchars($table))
  549. . '<br />&nbsp;&nbsp;DROP PRIMARY KEY,'
  550. . '<br />&nbsp;&nbsp; ADD PRIMARY KEY('
  551. . '<br />&nbsp;&nbsp;&nbsp;&nbsp; '
  552. . PMA_Util::backquote(htmlspecialchars($sval))
  553. . ',';
  554. } else {
  555. $full_query .= '<br />&nbsp;&nbsp;&nbsp;&nbsp; '
  556. . PMA_Util::backquote(htmlspecialchars($sval))
  557. . ',';
  558. }
  559. if ($i == $selected_cnt-1) {
  560. $full_query = preg_replace('@,$@', ');<br />', $full_query);
  561. }
  562. break;
  563. case 'drop_fld':
  564. if ($full_query == '') {
  565. $full_query .= 'ALTER TABLE '
  566. . PMA_Util::backquote(htmlspecialchars($table));
  567. }
  568. $full_query .= '<br />&nbsp;&nbsp;DROP '
  569. . PMA_Util::backquote(htmlspecialchars($sval))
  570. . ',';
  571. if ($i == $selected_cnt - 1) {
  572. $full_query = preg_replace('@,$@', ';<br />', $full_query);
  573. }
  574. break;
  575. } // end switch
  576. $i++;
  577. }
  578. if ($what == 'drop_tbl') {
  579. if (!empty($full_query)) {
  580. $full_query .= ';<br />' . "\n";
  581. }
  582. if (!empty($full_query_views)) {
  583. $full_query .= $full_query_views . ';<br />' . "\n";
  584. }
  585. unset($full_query_views);
  586. }
  587. $full_query_views = isset($full_query_views)? $full_query_views : null;
  588. return array($full_query, $reload, $full_query_views);
  589. }
  590. ?>