2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * @todo we must handle the case if sql.php is called directly with a query
5 * that returns 0 rows - to prevent cyclic redirects or includes
11 * Gets some core libraries
13 require_once './libraries/common.inc.php';
14 require_once './libraries/Table.class.php';
15 require_once './libraries/check_user_privileges.lib.php';
16 require_once './libraries/bookmark.lib.php';
18 $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
21 * Defines the url to return to in case of error in a sql statement
25 $is_gotofile = preg_replace('@^([^?]+).*$@s', '\\1', $goto);
26 if (! @file_exists
('./' . $is_gotofile)) {
29 $is_gotofile = ($is_gotofile == $goto);
32 $goto = (! strlen($table)) ?
$cfg['DefaultTabDatabase'] : $cfg['DefaultTabTable'];
36 if (!isset($err_url)) {
37 $err_url = (!empty($back) ?
$back : $goto)
38 . '?' . PMA_generate_common_url($db)
39 . ((strpos(' ' . $goto, 'db_') != 1 && strlen($table)) ?
'&table=' . urlencode($table) : '');
42 // Coming from a bookmark dialog
43 if (isset($fields['query'])) {
44 $sql_query = $fields['query'];
47 // This one is just to fill $db
48 if (isset($fields['dbase'])) {
49 $db = $fields['dbase'];
52 // Default to browse if no query set and we have table
53 // (needed for browsing from DefaultTabTable)
54 if (empty($sql_query) && strlen($table) && strlen($db)) {
55 require_once './libraries/bookmark.lib.php';
56 $book_sql_query = PMA_Bookmark_get($db, '\'' . PMA_sqlAddslashes($table) . '\'',
59 if (! empty($book_sql_query)) {
60 $sql_query = $book_sql_query;
62 $sql_query = 'SELECT * FROM ' . PMA_backquote($table);
64 unset($book_sql_query);
66 // set $goto to what will be displayed if query returns 0 rows
67 $goto = 'tbl_structure.php';
69 // Now we can check the parameters
70 PMA_checkParameters(array('sql_query'));
73 // instead of doing the test twice
74 $is_drop_database = preg_match('/DROP[[:space:]]+(DATABASE|SCHEMA)[[:space:]]+/i',
78 * Check rights in case of DROP DATABASE
80 * This test may be bypassed if $is_js_confirmed = 1 (already checked with js)
81 * but since a malicious user may pass this variable by url/form, we don't take
82 * into account this case.
84 if (!defined('PMA_CHK_DROP')
85 && !$cfg['AllowUserDropDatabase']
88 require_once './libraries/header.inc.php';
89 PMA_mysqlDie(__('"DROP DATABASE" statements are disabled.'), '', '', $err_url);
92 require_once './libraries/display_tbl.lib.php';
93 PMA_displayTable_checkConfigParams();
96 * Need to find the real end of rows?
98 if (isset($find_real_end) && $find_real_end) {
99 $unlim_num_rows = PMA_Table
::countRecords($db, $table, $force_exact = true);
100 $_SESSION['tmp_user_values']['pos'] = @((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows']) - 1) * $_SESSION['tmp_user_values']['max_rows']);
107 if (isset($store_bkm)) {
108 PMA_Bookmark_save($fields, (isset($bkm_all_users) && $bkm_all_users == 'true' ?
true : false));
109 // go back to sql.php to redisplay query; do not use & in this case:
110 PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . $goto . '&label=' . $fields['label']);
114 * Parse and analyze the query
116 require_once './libraries/parse_analyze.lib.php';
119 * Sets or modifies the $goto variable if required
121 if ($goto == 'sql.php') {
122 $is_gotofile = false;
124 . PMA_generate_common_url($db, $table)
125 . '&sql_query=' . urlencode($sql_query);
130 * Go back to further page if table should not be dropped
132 if (isset($btnDrop) && $btnDrop == __('No')) {
137 if (strpos($goto, 'db_') === 0 && strlen($table)) {
140 $active_page = $goto;
141 require './' . PMA_securePath($goto);
143 PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . str_replace('&', '&', $goto));
150 * Displays the confirm page if required
152 * This part of the script is bypassed if $is_js_confirmed = 1 (already checked
153 * with js) because possible security issue is not so important here: at most,
154 * the confirm message isn't displayed.
156 * Also bypassed if only showing php code.or validating a SQL query
158 if (! $cfg['Confirm'] ||
isset($_REQUEST['is_js_confirmed']) ||
isset($btnDrop)
159 // if we are coming from a "Create PHP code" or a "Without PHP Code"
160 // dialog, we won't execute the query anyway, so don't confirm
161 ||
isset($GLOBALS['show_as_php'])
162 ||
!empty($GLOBALS['validatequery'])) {
165 $do_confirm = isset($analyzed_sql[0]['queryflags']['need_confirm']);
169 $stripped_sql_query = $sql_query;
170 require_once './libraries/header.inc.php';
171 if ($is_drop_database) {
172 echo '<h1 class="warning">' . __('You are about to DESTROY a complete database!') . '</h1>';
174 echo '<form action="sql.php" method="post">' . "\n"
175 .PMA_generate_common_hidden_inputs($db, $table);
177 <input type
="hidden" name
="sql_query" value
="<?php echo htmlspecialchars($sql_query); ?>" />
178 <input type
="hidden" name
="zero_rows" value
="<?php echo isset($zero_rows) ? PMA_sanitize($zero_rows) : ''; ?>" />
179 <input type
="hidden" name
="goto" value
="<?php echo $goto; ?>" />
180 <input type
="hidden" name
="back" value
="<?php echo isset($back) ? PMA_sanitize($back) : ''; ?>" />
181 <input type
="hidden" name
="reload" value
="<?php echo isset($reload) ? PMA_sanitize($reload) : 0; ?>" />
182 <input type
="hidden" name
="purge" value
="<?php echo isset($purge) ? PMA_sanitize($purge) : ''; ?>" />
183 <input type
="hidden" name
="cpurge" value
="<?php echo isset($cpurge) ? PMA_sanitize($cpurge) : ''; ?>" />
184 <input type
="hidden" name
="purgekey" value
="<?php echo isset($purgekey) ? PMA_sanitize($purgekey) : ''; ?>" />
185 <input type
="hidden" name
="show_query" value
="<?php echo isset($show_query) ? PMA_sanitize($show_query) : ''; ?>" />
187 echo '<fieldset class="confirmation">' . "\n"
188 .' <legend>' . __('Do you really want to ') . '</legend>'
189 .' <tt>' . htmlspecialchars($stripped_sql_query) . '</tt>' . "\n"
190 .'</fieldset>' . "\n"
191 .'<fieldset class="tblFooters">' . "\n";
193 <input type
="submit" name
="btnDrop" value
="<?php echo __('Yes'); ?>" id
="buttonYes" />
194 <input type
="submit" name
="btnDrop" value
="<?php echo __('No'); ?>" id
="buttonNo" />
196 echo '</fieldset>' . "\n"
200 * Displays the footer and exit
202 require_once './libraries/footer.inc.php';
203 } // end if $do_confirm
206 // Defines some variables
207 // A table has to be created, renamed, dropped -> navi frame should be reloaded
209 * @todo use the parser/analyzer
213 && preg_match('/^(CREATE|ALTER|DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', $sql_query)) {
217 // SK -- Patch: $is_group added for use in calculation of total number of
219 // $is_count is changed for more correct "LIMIT" clause
220 // appending in queries like
221 // "SELECT COUNT(...) FROM ... GROUP BY ..."
224 * @todo detect all this with the parser, to avoid problems finding
225 * those strings in comments or backquoted identifiers
228 $is_explain = $is_count = $is_export = $is_delete = $is_insert = $is_affected = $is_show = $is_maint = $is_analyse = $is_group = $is_func = $is_replace = false;
229 if ($is_select) { // see line 141
230 $is_group = preg_match('@(GROUP[[:space:]]+BY|HAVING|SELECT[[:space:]]+DISTINCT)[[:space:]]+@i', $sql_query);
231 $is_func = !$is_group && (preg_match('@[[:space:]]+(SUM|AVG|STD|STDDEV|MIN|MAX|BIT_OR|BIT_AND)\s*\(@i', $sql_query));
232 $is_count = !$is_group && (preg_match('@^SELECT[[:space:]]+COUNT\((.*\.+)?.*\)@i', $sql_query));
233 $is_export = (preg_match('@[[:space:]]+INTO[[:space:]]+OUTFILE[[:space:]]+@i', $sql_query));
234 $is_analyse = (preg_match('@[[:space:]]+PROCEDURE[[:space:]]+ANALYSE@i', $sql_query));
235 } elseif (preg_match('@^EXPLAIN[[:space:]]+@i', $sql_query)) {
237 } elseif (preg_match('@^DELETE[[:space:]]+@i', $sql_query)) {
240 } elseif (preg_match('@^(INSERT|LOAD[[:space:]]+DATA|REPLACE)[[:space:]]+@i', $sql_query)) {
243 if (preg_match('@^(REPLACE)[[:space:]]+@i', $sql_query)) {
246 } elseif (preg_match('@^UPDATE[[:space:]]+@i', $sql_query)) {
248 } elseif (preg_match('@^[[:space:]]*SHOW[[:space:]]+@i', $sql_query)) {
250 } elseif (preg_match('@^(CHECK|ANALYZE|REPAIR|OPTIMIZE)[[:space:]]+TABLE[[:space:]]+@i', $sql_query)) {
254 // Do append a "LIMIT" clause?
255 if ((! $cfg['ShowAll'] ||
$_SESSION['tmp_user_values']['max_rows'] != 'all')
256 && ! ($is_count ||
$is_export ||
$is_func ||
$is_analyse)
257 && isset($analyzed_sql[0]['queryflags']['select_from'])
258 && ! isset($analyzed_sql[0]['queryflags']['offset'])
259 && empty($analyzed_sql[0]['limit_clause'])
261 $sql_limit_to_append = ' LIMIT ' . $_SESSION['tmp_user_values']['pos'] . ', ' . $_SESSION['tmp_user_values']['max_rows'] . " ";
263 $full_sql_query = $analyzed_sql[0]['section_before_limit'] . "\n" . $sql_limit_to_append . $analyzed_sql[0]['section_after_limit'];
265 * @todo pretty printing of this modified query
267 if (isset($display_query)) {
268 // if the analysis of the original query revealed that we found
269 // a section_after_limit, we now have to analyze $display_query
270 // to display it correctly
272 if (!empty($analyzed_sql[0]['section_after_limit']) && trim($analyzed_sql[0]['section_after_limit']) != ';') {
273 $analyzed_display_query = PMA_SQP_analyze(PMA_SQP_parse($display_query));
274 $display_query = $analyzed_display_query[0]['section_before_limit'] . "\n" . $sql_limit_to_append . $analyzed_display_query[0]['section_after_limit'];
279 $full_sql_query = $sql_query;
283 PMA_DBI_select_db($db);
286 // E x e c u t e t h e q u e r y
288 // Only if we didn't ask to see the php code (mikebeck)
289 if (isset($GLOBALS['show_as_php']) ||
!empty($GLOBALS['validatequery'])) {
293 if (isset($_SESSION['profiling']) && PMA_profilingSupported()) {
294 PMA_DBI_query('SET PROFILING=1;');
297 // Measure query time.
298 // TODO-Item http://sourceforge.net/tracker/index.php?func=detail&aid=571934&group_id=23067&atid=377411
299 $querytime_before = array_sum(explode(' ', microtime()));
301 $result = @PMA_DBI_try_query
($full_sql_query, null, PMA_DBI_QUERY_STORE
);
303 $querytime_after = array_sum(explode(' ', microtime()));
305 $GLOBALS['querytime'] = $querytime_after - $querytime_before;
307 // Displays an error message if required and stop parsing the script
308 if ($error = PMA_DBI_getError()) {
310 if (strpos($goto, 'db_') === 0 && strlen($table)) {
313 $active_page = $goto;
314 $message = htmlspecialchars(PMA_Message
::rawError($error));
318 require './' . PMA_securePath($goto);
323 require_once './libraries/header.inc.php';
324 $full_err_url = (preg_match('@^(db|tbl)_@', $err_url))
325 ?
$err_url . '&show_query=1&sql_query=' . urlencode($sql_query)
327 PMA_mysqlDie($error, $full_sql_query, '', $full_err_url);
333 // Gets the number of rows affected/returned
334 // (This must be done immediately after the query because
335 // mysql_affected_rows() reports about the last query done)
338 $num_rows = ($result) ? @PMA_DBI_num_rows
($result) : 0;
339 } elseif (!isset($num_rows)) {
340 $num_rows = @PMA_DBI_affected_rows
();
343 // Grabs the profiling results
344 if (isset($_SESSION['profiling']) && PMA_profilingSupported()) {
345 $profiling_results = PMA_DBI_fetch_result('SHOW PROFILE;');
348 // Checks if the current database has changed
349 // This could happen if the user sends a query like "USE `database`;"
351 * commented out auto-switching to active database - really required?
352 * bug #1814718 win: table list disappears (mixed case db names)
353 * https://sourceforge.net/support/tracker.php?aid=1814718
354 * @todo RELEASE test and comit or rollback before release
355 $current_db = PMA_DBI_fetch_value('SELECT DATABASE()');
356 if ($db !== $current_db) {
363 // tmpfile remove after convert encoding appended by Y.Kawada
364 if (function_exists('PMA_kanji_file_conv')
365 && (isset($textfile) && file_exists($textfile))) {
369 // Counts the total number of rows for the same 'SELECT' query without the
370 // 'LIMIT' clause that may have been programatically added
372 if (empty($sql_limit_to_append)) {
373 $unlim_num_rows = $num_rows;
374 // if we did not append a limit, set this to get a correct
375 // "Showing rows..." message
376 //$_SESSION['tmp_user_values']['max_rows'] = 'all';
377 } elseif ($is_select) {
379 // c o u n t q u e r y
381 // If we are "just browsing", there is only one table,
382 // and no WHERE clause (or just 'WHERE 1 '),
383 // we do a quick count (which uses MaxExactCount) because
384 // SQL_CALC_FOUND_ROWS is not quick on large InnoDB tables
386 // However, do not count again if we did it previously
387 // due to $find_real_end == true
390 && !isset($analyzed_sql[0]['queryflags']['union'])
391 && !isset($analyzed_sql[0]['table_ref'][1]['table_name'])
392 && (empty($analyzed_sql[0]['where_clause'])
393 ||
$analyzed_sql[0]['where_clause'] == '1 ')
394 && !isset($find_real_end)
397 // "j u s t b r o w s i n g"
398 $unlim_num_rows = PMA_Table
::countRecords($db, $table);
400 } else { // n o t " j u s t b r o w s i n g "
402 // add select expression after the SQL_CALC_FOUND_ROWS
404 // for UNION, just adding SQL_CALC_FOUND_ROWS
405 // after the first SELECT works.
407 // take the left part, could be:
410 $count_query = PMA_SQP_formatHtml($parsed_sql, 'query_only', 0, $analyzed_sql[0]['position_of_first_select'] +
1);
411 $count_query .= ' SQL_CALC_FOUND_ROWS ';
412 // add everything that was after the first SELECT
413 $count_query .= PMA_SQP_formatHtml($parsed_sql, 'query_only', $analyzed_sql[0]['position_of_first_select']+
1);
414 // ensure there is no semicolon at the end of the
415 // count query because we'll probably add
416 // a LIMIT 1 clause after it
417 $count_query = rtrim($count_query);
418 $count_query = rtrim($count_query, ';');
420 // if using SQL_CALC_FOUND_ROWS, add a LIMIT to avoid
421 // long delays. Returned count will be complete anyway.
422 // (but a LIMIT would disrupt results in an UNION)
424 if (!isset($analyzed_sql[0]['queryflags']['union'])) {
425 $count_query .= ' LIMIT 1';
428 // run the count query
430 PMA_DBI_try_query($count_query);
431 // if (mysql_error()) {
434 // (SELECT `User`, `Host`, `Db`, `Select_priv` FROM `db`)
435 // UNION (SELECT `User`, `Host`, "%" AS "Db",
437 // FROM `user`) ORDER BY `User`, `Host`, `Db`;
438 // and although the generated count_query is wrong
439 // the SELECT FOUND_ROWS() work! (maybe it gets the
440 // count from the latest query that worked)
442 // another case where the count_query is wrong:
443 // SELECT COUNT(*), f1 from t1 group by f1
444 // and you click to sort on count(*)
446 $unlim_num_rows = PMA_DBI_fetch_value('SELECT FOUND_ROWS()');
447 } // end else "just browsing"
449 } else { // not $is_select
451 } // end rows total count
453 // if a table or database gets dropped, check column comments.
454 if (isset($purge) && $purge == '1') {
458 require_once './libraries/relation_cleanup.lib.php';
460 if (strlen($table) && strlen($db)) {
461 PMA_relationsCleanupTable($db, $table);
462 } elseif (strlen($db)) {
463 PMA_relationsCleanupDatabase($db);
465 // VOID. No DB/Table gets deleted.
466 } // end if relation-stuff
469 // If a column gets dropped, do relation magic.
470 if (isset($cpurge) && $cpurge == '1' && isset($purgekey)
471 && strlen($db) && strlen($table) && !empty($purgekey)) {
472 require_once './libraries/relation_cleanup.lib.php';
473 PMA_relationsCleanupColumn($db, $table, $purgekey);
475 } // end if column PMA_* purge
476 } // end else "didn't ask to see php code"
478 // No rows returned -> move back to the calling page
479 if (0 == $num_rows ||
$is_affected) {
481 $message = PMA_Message
::deleted_rows($num_rows);
482 } elseif ($is_insert) {
484 /* For replace we get DELETED + INSERTED row count, so we have to call it affected */
485 $message = PMA_Message
::affected_rows($num_rows);
487 $message = PMA_Message
::inserted_rows($num_rows);
489 $insert_id = PMA_DBI_insert_id();
490 if ($insert_id != 0) {
491 // insert_id is id of FIRST record inserted in one insert, so if we inserted multiple rows, we had to increment this
492 $message->addMessage('[br]');
493 // need to use a temporary because the Message class
494 // currently supports adding parameters only to the first
496 $_inserted = PMA_Message
::notice(__('Inserted row id: %1$d'));
497 $_inserted->addParam($insert_id +
$num_rows - 1);
498 $message->addMessage($_inserted);
500 } elseif ($is_affected) {
501 $message = PMA_Message
::affected_rows($num_rows);
503 // Ok, here is an explanation for the !$is_select.
504 // The form generated by sql_query_form.lib.php
505 // and db_sql.php has many submit buttons
506 // on the same form, and some confusion arises from the
507 // fact that $zero_rows is sent for every case.
508 // The $zero_rows containing a success message and sent with
509 // the form should not have priority over errors
510 } elseif (!empty($zero_rows) && !$is_select) {
511 $message = PMA_Message
::rawSuccess(htmlspecialchars($zero_rows));
512 } elseif (!empty($GLOBALS['show_as_php'])) {
513 $message = PMA_Message
::success(__('Showing as PHP code'));
514 } elseif (isset($GLOBALS['show_as_php'])) {
515 /* User disable showing as PHP, query is only displayed */
516 $message = PMA_Message
::notice(__('Showing SQL query'));
517 } elseif (!empty($GLOBALS['validatequery'])) {
518 $message = PMA_Message
::notice(__('Validate SQL'));
520 $message = PMA_Message
::success(__('MySQL returned an empty result set (i.e. zero rows).'));
523 if (isset($GLOBALS['querytime'])) {
524 $_querytime = PMA_Message
::notice(__('Query took %01.4f sec'));
525 $_querytime->addParam($GLOBALS['querytime']);
526 $message->addMessage('(');
527 $message->addMessage($_querytime);
528 $message->addMessage(')');
532 $goto = PMA_securePath($goto);
533 // Checks for a valid target script
534 $is_db = $is_table = false;
535 include 'libraries/db_table_exists.lib.php';
536 if (strpos($goto, 'tbl_') === 0 && ! $is_table) {
537 if (strlen($table)) {
540 $goto = 'db_sql.php';
542 if (strpos($goto, 'db_') === 0 && ! $is_db) {
548 // Loads to target script
549 if (strpos($goto, 'db_') === 0
550 ||
strpos($goto, 'tbl_') === 0) {
551 $GLOBALS['js_include'][] = 'functions.js';
553 if ($goto != 'main.php') {
554 require_once './libraries/header.inc.php';
556 $active_page = $goto;
557 require './' . $goto;
559 // avoid a redirect loop when last record was deleted
560 if (0 == $num_rows && 'sql.php' == $cfg['DefaultTabTable']) {
561 $goto = str_replace('sql.php','tbl_structure.php',$goto);
563 PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . str_replace('&', '&', $goto) . '&message=' . urlencode($message));
566 } // end no rows returned
568 // At least one row is returned -> displays a table with results
570 // Displays the headers
571 if (isset($show_query)) {
574 if (isset($printview) && $printview == '1') {
575 require_once './libraries/header_printview.inc.php';
577 $GLOBALS['js_include'][] = 'functions.js';
579 if (strlen($table)) {
580 require './libraries/tbl_common.php';
581 $url_query .= '&goto=tbl_sql.php&back=tbl_sql.php';
582 require './libraries/tbl_info.inc.php';
583 require './libraries/tbl_links.inc.php';
584 } elseif (strlen($db)) {
585 require './libraries/db_common.inc.php';
586 require './libraries/db_info.inc.php';
588 require './libraries/server_common.inc.php';
589 require './libraries/server_links.inc.php';
594 require_once './libraries/relation.lib.php';
595 $cfgRelation = PMA_getRelationsParam();
598 // Gets the list of fields properties
599 if (isset($result) && $result) {
600 $fields_meta = PMA_DBI_get_fields_meta($result);
601 $fields_cnt = count($fields_meta);
604 // Display previous update query (from tbl_replace)
605 if (isset($disp_query) && $cfg['ShowSQL'] == true) {
606 PMA_showMessage($disp_message, $disp_query, 'success');
609 if (isset($profiling_results)) {
610 PMA_profilingResults($profiling_results);
613 // Displays the results in a table
614 if (empty($disp_mode)) {
615 // see the "PMA_setDisplayMode()" function in
616 // libraries/display_tbl.lib.php
617 $disp_mode = 'urdr111101';
620 // hide edit and delete links for information_schema
621 if ($db == 'information_schema') {
622 $disp_mode = 'nnnn110111';
626 $message = PMA_message
::success('strBookmarkCreated');
627 $message->addParam($label);
631 PMA_displayTable($result, $disp_mode, $analyzed_sql);
632 PMA_DBI_free_result($result);
634 // BEGIN INDEX CHECK See if indexes should be checked.
635 if (isset($query_type) && $query_type == 'check_tbl' && isset($selected) && is_array($selected)) {
636 foreach ($selected as $idx => $tbl_name) {
637 $check = PMA_Index
::findDuplicates($tbl_name, $db);
638 if (! empty($check)) {
639 printf(__('Problems with indexes of table `%s`'), $tbl_name);
645 // Bookmark support if required
646 if ($disp_mode[7] == '1'
647 && (! empty($cfg['Bookmark']) && empty($id_bookmark))
648 && !empty($sql_query)) {
652 . PMA_generate_common_url($db, $table)
653 . '&sql_query=' . urlencode($sql_query)
654 . '&id_bookmark=1';
657 <form action
="sql.php" method
="post" onsubmit
="return emptyFormElements(this, 'fields[label]');">
658 <?php
echo PMA_generate_common_hidden_inputs(); ?
>
659 <input type
="hidden" name
="goto" value
="<?php echo $goto; ?>" />
660 <input type
="hidden" name
="fields[dbase]" value
="<?php echo htmlspecialchars($db); ?>" />
661 <input type
="hidden" name
="fields[user]" value
="<?php echo $cfg['Bookmark']['user']; ?>" />
662 <input type
="hidden" name
="fields[query]" value
="<?php echo urlencode(isset($complete_query) ? $complete_query : $sql_query); ?>" />
665 echo ($cfg['PropertiesIconic'] ?
'<img class="icon" src="' . $pmaThemeImage . 'b_bookmark.png" width="16" height="16" alt="' . __('Bookmark this SQL query') . '" />' : '')
666 . __('Bookmark this SQL query');
670 <div
class="formelement">
671 <label
for="fields_label_"><?php
echo __('Label'); ?
>:</label
>
672 <input type
="text" id
="fields_label_" name
="fields[label]" value
="" />
675 <div
class="formelement">
676 <input type
="checkbox" name
="bkm_all_users" id
="bkm_all_users" value
="true" />
677 <label
for="bkm_all_users"><?php
echo __('Let every user access this bookmark'); ?
></label
>
680 <div
class="clearfloat"></div
>
682 <fieldset
class="tblFooters">
683 <input type
="submit" name
="store_bkm" value
="<?php echo __('Bookmark this SQL query'); ?>" />
687 } // end bookmark support
689 // Do print the page if required
690 if (isset($printview) && $printview == '1') {
692 <script type
="text/javascript">
695 window
.onload
= function()
697 if (typeof(window
.print) != 'undefined') {
705 } // end rows returned
708 * Displays the footer
710 require_once './libraries/footer.inc.php';