3 // vim: expandtab sw=4 ts=4 sts=4:
6 * Gets some core libraries
8 require('./libraries/grab_globals.lib.php3');
9 require('./libraries/common.lib.php3');
12 * Defines the url to return to in case of error in a sql statement
16 $is_gotofile = ereg_replace('^([^?]+).*$', '\\1', $goto);
17 if (!@file_exists
('./' . $is_gotofile)) {
20 $is_gotofile = ($is_gotofile == $goto);
22 } // end if (security checkings)
25 $goto = (empty($table)) ?
$cfg['DefaultTabDatabase'] : $cfg['DefaultTabTable'];
28 if (!isset($err_url)) {
29 $err_url = (!empty($back) ?
$back : $goto)
30 . '?' . PMA_generate_common_url(isset($db) ?
$db : '')
31 . ((strpos(' ' . $goto, 'db_details') != 1 && isset($table)) ?
'&table=' . urlencode($table) : '');
34 // Coming from a bookmark dialog
35 if (isset($fields['query'])) {
36 $sql_query = $fields['query'];
40 * Check rights in case of DROP DATABASE
42 * This test may be bypassed if $is_js_confirmed = 1 (already checked with js)
43 * but since a malicious user may pass this variable by url/form, we don't take
44 * into account this case.
46 if (!defined('PMA_CHK_DROP')
47 && !$cfg['AllowUserDropDatabase']
48 && eregi('DROP[[:space:]]+(IF EXISTS[[:space:]]+)?DATABASE[[:space:]]', $sql_query)) {
49 // Checks if the user is a Superuser
50 // TODO: set a global variable with this information
51 // loic1: optimized query
52 $result = @PMA_mysql_query
('USE mysql');
53 if (PMA_mysql_error()) {
54 include('./header.inc.php3');
55 PMA_mysqlDie($strNoDropDatabases, '', '', $err_url);
63 if (isset($store_bkm)) {
64 include('./libraries/bookmark.lib.php3');
65 PMA_addBookmarks($fields, $cfg['Bookmark']);
66 header('Location: ' . $cfg['PmaAbsoluteUri'] . $goto);
71 * Gets the true sql query
73 // $sql_query has been urlencoded in the confirmation form for drop/delete
74 // queries or in the navigation bar for browsing among records
75 if (isset($btnDrop) ||
isset($navig)) {
76 $sql_query = urldecode($sql_query);
83 $parsed_sql = PMA_SQP_parse($sql_query);
84 $analyzed_sql = PMA_SQP_analyze($parsed_sql);
85 // Bug #641765 - Robbat2 - 12 January 2003, 10:49PM
86 // Reverted - Robbat2 - 13 January 2003, 2:40PM
87 $sql_query = PMA_SQP_formatHtml($parsed_sql, 'query_only');
89 // old code did not work, for example, when there is a bracket
91 // so I guess it's ok to check for a real SELECT ... FROM
92 //$is_select = eregi('^SELECT[[:space:]]+', $sql_query);
93 $is_select = isset($analyzed_sql[0]['queryflags']['select_from']);
95 // If the query is a Select, extract the db and table names and modify
96 // $db and $table, to have correct page headers, links and left frame.
97 // db and table name may be enclosed with backquotes, db is optionnal,
98 // query may contain aliases.
100 // (TODO: if there are more than one table name in the Select:
101 // - do not extract the first table name
102 // - do not show a table name in the page header
103 // - do not display the sub-pages links)
107 if (isset($analyzed_sql[0]['table_ref'][0]['table_true_name'])) {
108 $table = $analyzed_sql[0]['table_ref'][0]['table_true_name'];
110 if (isset($analyzed_sql[0]['table_ref'][0]['db'])
111 && !empty($analyzed_sql[0]['table_ref'][0]['db'])) {
112 $db = $analyzed_sql[0]['table_ref'][0]['db'];
117 $reload = ($db == $prev_db) ?
0 : 1;
121 * Sets or modifies the $goto variable if required
123 if ($goto == 'sql.php3') {
125 . PMA_generate_common_url($db, $table)
127 . '&sql_query=' . urlencode($sql_query);
132 * Go back to further page if table should not be dropped
134 if (isset($btnDrop) && $btnDrop == $strNo) {
139 if (strpos(' ' . $goto, 'db_details') == 1 && !empty($table)) {
142 include('./' . ereg_replace('\.\.*', '.', $goto));
144 header('Location: ' . $cfg['PmaAbsoluteUri'] . str_replace('&', '&', $goto));
151 * Displays the confirm page if required
153 * This part of the script is bypassed if $is_js_confirmed = 1 (already checked
154 * with js) because possible security issue is not so important here: at most,
155 * the confirm message isn't displayed.
157 * Also bypassed if only showing php code.or validating a SQL query
160 ||
(isset($is_js_confirmed) && $is_js_confirmed)
162 ||
!empty($GLOBALS['show_as_php'])
163 ||
!empty($GLOBALS['validatequery'])) {
166 //$do_confirm = (eregi('DROP[[:space:]]+(IF[[:space:]]+EXISTS[[:space:]]+)?(TABLE|DATABASE[[:space:]])|ALTER[[:space:]]+TABLE[[:space:]]+((`[^`]+`)|([A-Za-z0-9_$]+))[[:space:]]+DROP[[:space:]]|DELETE[[:space:]]+FROM[[:space:]]', $sql_query));
168 $do_confirm = isset($analyzed_sql[0]['queryflags']['need_confirm']);
172 $stripped_sql_query = $sql_query;
173 include('./header.inc.php3');
174 echo $strDoYouReally . ' :<br />' . "\n";
175 echo '<tt>' . htmlspecialchars($stripped_sql_query) . '</tt> ?<br/>' . "\n";
177 <form action
="sql.php3" method
="post">
178 <?php
echo PMA_generate_common_hidden_inputs($db, (isset($table)?
$table:'')); ?
>
179 <input type
="hidden" name
="sql_query" value
="<?php echo urlencode(addslashes($sql_query)); ?>" />
180 <input type
="hidden" name
="zero_rows" value
="<?php echo isset($zero_rows) ? $zero_rows : ''; ?>" />
181 <input type
="hidden" name
="goto" value
="<?php echo $goto; ?>" />
182 <input type
="hidden" name
="back" value
="<?php echo isset($back) ? $back : ''; ?>" />
183 <input type
="hidden" name
="reload" value
="<?php echo isset($reload) ? $reload : 0; ?>" />
184 <input type
="hidden" name
="show_query" value
="<?php echo isset($show_query) ? $show_query : ''; ?>" />
185 <input type
="submit" name
="btnDrop" value
="<?php echo $strYes; ?>" />
186 <input type
="submit" name
="btnDrop" value
="<?php echo $strNo; ?>" />
194 * Executes the query and displays results
197 if (!isset($sql_query)) {
200 // Defines some variables
201 // loic1: A table has to be created -> left frame should be reloaded
202 if ((!isset($reload) ||
$reload == 0)
203 && eregi('^CREATE TABLE[[:space:]]+(.*)', $sql_query)) {
206 // Gets the number of rows per page
207 if (!isset($session_max_rows)) {
208 $session_max_rows = $cfg['MaxRows'];
209 } else if ($session_max_rows != 'all') {
210 $cfg['MaxRows'] = $session_max_rows;
212 // Defines the display mode (horizontal/vertical) and header "frequency"
213 if (empty($disp_direction)) {
214 $disp_direction = $cfg['DefaultDisplay'];
216 if (empty($repeat_cells)) {
217 $repeat_cells = $cfg['RepeatCells'];
220 // SK -- Patch: $is_group added for use in calculation of total number of
222 // $is_count is changed for more correct "LIMIT" clause
223 // appending in queries like
224 // "SELECT COUNT(...) FROM ... GROUP BY ..."
225 $is_explain = $is_count = $is_export = $is_delete = $is_insert = $is_affected = $is_show = $is_maint = $is_analyse = $is_group = $is_func = FALSE;
226 if ($is_select) { // see line 141
227 $is_group = eregi('[[:space:]]+(GROUP[[:space:]]+BY|HAVING|SELECT[[:space:]]+DISTINCT)[[:space:]]+', $sql_query);
229 $is_func = !$is_group && (eregi('[[:space:]]+(SUM|AVG|STD|STDDEV|MIN|MAX|BIT_OR|BIT_AND)\s*\(', $sql_query));
230 $is_count = !$is_group && (eregi('^SELECT[[:space:]]+COUNT\((.*\.+)?.*\)', $sql_query));
231 $is_export = (eregi('[[:space:]]+INTO[[:space:]]+OUTFILE[[:space:]]+', $sql_query));
232 $is_analyse = (eregi('[[:space:]]+PROCEDURE[[:space:]]+ANALYSE\(', $sql_query));
233 } else if (eregi('^EXPLAIN[[:space:]]+', $sql_query)) {
235 } else if (eregi('^DELETE[[:space:]]+', $sql_query)) {
238 } else if (eregi('^(INSERT|LOAD[[:space:]]+DATA|REPLACE)[[:space:]]+', $sql_query)) {
241 } else if (eregi('^UPDATE[[:space:]]+', $sql_query)) {
243 } else if (eregi('^SHOW[[:space:]]+', $sql_query)) {
245 } else if (eregi('^(CHECK|ANALYZE|REPAIR|OPTIMIZE)[[:space:]]+TABLE[[:space:]]+', $sql_query)) {
249 // Do append a "LIMIT" clause?
251 && (!$cfg['ShowAll'] ||
$session_max_rows != 'all')
252 && !($is_count ||
$is_export ||
$is_func ||
$is_analyse)
253 && isset($analyzed_sql[0]['queryflags']['select_from'])
254 && !eregi('[[:space:]]LIMIT[[:space:]0-9,-]+$', $sql_query)) {
255 $sql_limit_to_append = " LIMIT $pos, ".$cfg['MaxRows'];
256 if (eregi('(.*)([[:space:]](PROCEDURE[[:space:]](.*)|FOR[[:space:]]+UPDATE|LOCK[[:space:]]+IN[[:space:]]+SHARE[[:space:]]+MODE))$', $sql_query, $regs)) {
257 $full_sql_query = $regs[1] . $sql_limit_to_append . $regs[2];
259 $full_sql_query = $sql_query . $sql_limit_to_append;
262 $full_sql_query = $sql_query;
265 PMA_mysql_select_db($db);
267 // If the query is a DELETE query with no WHERE clause, get the number of
268 // rows that will be deleted (mysql_affected_rows will always return 0 in
271 && eregi('^DELETE([[:space:]].+)?([[:space:]]FROM[[:space:]](.+))$', $sql_query, $parts)
272 && !eregi('[[:space:]]WHERE[[:space:]]', $parts[3])) {
273 $cnt_all_result = @PMA_mysql_query
('SELECT COUNT(*) as count' . $parts[2]);
274 if ($cnt_all_result) {
275 $num_rows = PMA_mysql_result($cnt_all_result, 0, 'count');
276 mysql_free_result($cnt_all_result);
282 // E x e c u t e t h e q u e r y
284 // Only if we didn't ask to see the php code (mikebeck)
285 if (!empty($GLOBALS['show_as_php']) ||
!empty($GLOBALS['validatequery'])) {
290 // garvin: Measure query time. TODO-Item http://sourceforge.net/tracker/index.php?func=detail&aid=571934&group_id=23067&atid=377411
291 list($usec, $sec) = explode(' ',microtime());
292 $querytime_before = ((float)$usec +
(float)$sec);
294 $result = @PMA_mysql_query
($full_sql_query);
296 list($usec, $sec) = explode(' ',microtime());
297 $querytime_after = ((float)$usec +
(float)$sec);
299 $GLOBALS['querytime'] = $querytime_after - $querytime_before;
301 // Displays an error message if required and stop parsing the script
302 if (PMA_mysql_error()) {
303 $error = PMA_mysql_error();
304 include('./header.inc.php3');
305 $full_err_url = (ereg('^(db_details|tbl_properties)', $err_url))
306 ?
$err_url . '&show_query=1&sql_query=' . urlencode($sql_query)
308 PMA_mysqlDie($error, $full_sql_query, '', $full_err_url);
311 // Gets the number of rows affected/returned
312 // (This must be done immediately after the query because
313 // mysql_affected_rows() reports about the last query done)
316 $num_rows = ($result) ? @mysql_num_rows
($result) : 0;
317 } else if (!isset($num_rows)) {
318 $num_rows = @mysql_affected_rows
();
321 // Checks if the current database has changed
322 // This could happen if the user sends a query like "USE `database`;"
323 $res = PMA_mysql_query('SELECT DATABASE() AS "db";');
324 $row = PMA_mysql_fetch_array($res);
325 if ($db != $row['db']) {
329 @mysql_free_result
($res);
333 // tmpfile remove after convert encoding appended by Y.Kawada
334 if (function_exists('PMA_kanji_file_conv')
335 && (isset($textfile) && file_exists($textfile))) {
339 // Counts the total number of rows for the same 'SELECT' query without the
340 // 'LIMIT' clause that may have been programatically added
342 if (empty($sql_limit_to_append)) {
343 $unlim_num_rows = $num_rows;
345 else if ($is_select) {
347 // c o u n t q u e r y
349 if (PMA_MYSQL_INT_VERSION
< 40000) {
350 if (eregi('DISTINCT(.*)', $sql_query)) {
351 $count_what = 'DISTINCT ' . $analyzed_sql[0]['select_expr_clause'];
356 $count_query = 'SELECT COUNT(' . $count_what . ') AS count';
359 $count_query = 'SELECT SQL_CALC_FOUND_ROWS ';
362 // add the remaining of select expression if there is
363 // a GROUP BY or HAVING clause
364 if (PMA_MYSQL_INT_VERSION
< 40000
366 && (!empty($analyzed_sql[0]['group_by_clause'])
367 ||
!empty($analyzed_sql[0]['having_clause']))) {
368 $count_query .= ' ,' . $analyzed_sql[0]['select_expr_clause'];
371 // add select expression after the SQL_CALC_FOUND_ROWS
372 if (PMA_MYSQL_INT_VERSION
>= 40000) {
373 $count_query .= $analyzed_sql[0]['select_expr_clause'];
377 if (!empty($analyzed_sql[0]['from_clause'])) {
378 $count_query .= ' FROM ' . $analyzed_sql[0]['from_clause'];
381 if (!empty($analyzed_sql[0]['where_clause'])) {
382 $count_query .= ' WHERE ' . $analyzed_sql[0]['where_clause'];
384 if (!empty($analyzed_sql[0]['group_by_clause'])) {
385 $count_query .= ' GROUP BY ' . $analyzed_sql[0]['group_by_clause'];
388 if (!empty($analyzed_sql[0]['having_clause'])) {
389 $count_query .= ' HAVING ' . $analyzed_sql[0]['having_clause'];
392 // do not put the order_by_clause, it interferes
393 // run the count query
394 if (PMA_MYSQL_INT_VERSION
< 40000) {
395 if ($cnt_all_result = mysql_query($count_query)) {
397 $unlim_num_rows = @mysql_num_rows
($cnt_all_result);
399 $unlim_num_rows = mysql_result($cnt_all_result, 0, 'count');
401 mysql_free_result($cnt_all_result);
404 // there are some cases where the generated
405 // count_query (for MySQL 3) is wrong,
407 //TODO: use a big unlimited query to get
408 // the correct number of rows (depending
409 // on a config variable?)
414 mysql_query($count_query);
416 // void. I tried the case
417 // (SELECT `User`, `Host`, `Db`, `Select_priv` FROM `db`)
418 // UNION (SELECT `User`, `Host`, "%" AS "Db",
420 // FROM `user`) ORDER BY `User`, `Host`, `Db`;
421 // and although the generated count_query is wrong
422 // the SELECT FOUND_ROWS() work!
424 $cnt_all_result = mysql_query('SELECT FOUND_ROWS() as count');
425 $unlim_num_rows = mysql_result($cnt_all_result,0,'count');
428 } else { // not $is_select
430 } // end rows total count
432 // garvin: if a table or database gets dropped, check column comments.
434 include('./libraries/relation.lib.php3');
435 $cfgRelation = PMA_getRelationsParam();
437 if ($cfgRelation['commwork']) {
438 if (isset($table) && isset($db) && !empty($table) && !empty($db)) {
439 $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['column_info'])
440 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
441 . ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\'';
442 $rmv_rs = PMA_query_as_cu($remove_query);
444 } elseif (isset($db) && !empty($db)) {
445 $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['column_info'])
446 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
447 $rmv_rs = PMA_query_as_cu($remove_query);
450 } // end if relation-stuff
452 } // end else "didn't ask to see php code"
455 // No rows returned -> move back to the calling page
456 if ($num_rows < 1 ||
$is_affected) {
458 $message = $strDeletedRows . ' ' . $num_rows;
459 } else if ($is_insert) {
460 $message = $strInsertedRows . ' ' . $num_rows;
461 } else if ($is_affected) {
462 $message = $strAffectedRows . ' ' . $num_rows;
463 } else if (!empty($zero_rows)) {
464 $message = $zero_rows;
465 } else if (!empty($GLOBALS['show_as_php'])) {
467 } else if (!empty($GLOBALS['validatequery'])) {
468 $message = $strValidateSQL;
470 $message = $strEmptyResultSet;
473 $message .= ' ' . (isset($GLOBALS['querytime']) ?
'(' . sprintf($strQueryTime, $GLOBALS['querytime']) . ')' : '');
476 $goto = ereg_replace('\.\.*', '.', $goto);
477 // Checks for a valid target script
478 if (isset($table) && $table == '') {
481 if (isset($db) && $db == '') {
484 $is_db = $is_table = FALSE;
485 if (strpos(' ' . $goto, 'tbl_properties') == 1) {
486 if (!isset($table)) {
487 $goto = 'db_details.php3';
489 $is_table = @PMA_mysql_query
('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
490 if (!($is_table && @mysql_numrows
($is_table))) {
491 $goto = 'db_details.php3';
494 } // end if... else...
496 if (strpos(' ' . $goto, 'db_details') == 1) {
503 $is_db = @PMA_mysql_select_db
($db);
508 } // end if... else...
510 // Loads to target script
511 if (strpos(' ' . $goto, 'db_details') == 1
512 ||
strpos(' ' . $goto, 'tbl_properties') == 1) {
513 $js_to_run = 'functions.js';
515 if ($goto != 'main.php3') {
516 include('./header.inc.php3');
518 include('./' . $goto);
519 } // end if file_exist
521 header('Location: ' . $cfg['PmaAbsoluteUri'] . str_replace('&', '&', $goto) . '&message=' . urlencode($message));
524 } // end no rows returned
526 // At least one row is returned -> displays a table with results
528 // Displays the headers
529 if (isset($show_query)) {
532 if (isset($printview) && $printview == '1') {
533 include('./header_printview.inc.php3');
535 $js_to_run = 'functions.js';
537 if (!empty($table)) {
538 include('./tbl_properties_common.php3');
539 $url_query .= '&goto=tbl_properties.php3&back=tbl_properties.php3';
540 include('./tbl_properties_table_info.php3');
543 include('./db_details_common.php3');
544 include('./db_details_db_info.php3');
546 include('./libraries/relation.lib.php3');
547 $cfgRelation = PMA_getRelationsParam();
550 // Gets the list of fields properties
551 if (isset($result) && $result) {
552 while ($field = PMA_mysql_fetch_field($result)) {
553 $fields_meta[] = $field;
555 $fields_cnt = count($fields_meta);
558 // Display previous update query (from tbl_replace)
559 if (isset($disp_query) && $cfg['ShowSQL'] == TRUE) {
560 $tmp_sql_query = $GLOBALS['sql_query'];
561 $tmp_sql_limit_to_append = (isset($GLOBALS['sql_limit_to_append'])?
$GLOBALS['sql_limit_to_append']:'');
562 $GLOBALS['sql_query'] = $disp_query;
563 $GLOBALS['sql_limit_to_append'] = '';
564 PMA_showMessage($disp_message);
565 $GLOBALS['sql_query'] = $tmp_sql_query;
566 $GLOBALS['sql_limit_to_append'] = $tmp_sql_limit_to_append;
569 // Displays the results in a table
570 include('./libraries/display_tbl.lib.php3');
571 if (empty($disp_mode)) {
572 // see the "PMA_setDisplayMode()" function in
573 // libraries/display_tbl.lib.php3
574 $disp_mode = 'urdr111101';
576 if (!isset($dontlimitchars)) {
580 PMA_displayTable($result, $disp_mode, $analyzed_sql);
581 mysql_free_result($result);
583 if ($disp_mode[6] == '1' ||
$disp_mode[9] == '1') {
587 // Displays "Insert a new row" link if required
588 if ($disp_mode[6] == '1') {
589 $lnk_goto = 'sql.php3?'
590 . PMA_generate_common_url($db, $table)
592 . '&session_max_rows=' . $session_max_rows
593 . '&disp_direction=' . $disp_direction
594 . '&repeat_cells=' . $repeat_cells
595 . '&dontlimitchars=' . $dontlimitchars
596 . '&sql_query=' . urlencode($sql_query);
598 . PMA_generate_common_url($db, $table)
600 . '&session_max_rows=' . $session_max_rows
601 . '&disp_direction=' . $disp_direction
602 . '&repeat_cells=' . $repeat_cells
603 . '&dontlimitchars=' . $dontlimitchars
604 . '&sql_query=' . urlencode($sql_query)
605 . '&goto=' . urlencode($lnk_goto);
607 echo ' <!-- Insert a new row -->' . "\n"
608 . ' <a href="tbl_change.php3' . $url_query . '">' . $strInsertNewRow . '</a>';
609 if ($disp_mode[9] == '1') {
613 } // end insert new row
615 // Displays "printable view" link if required
616 if ($disp_mode[9] == '1') {
618 . PMA_generate_common_url($db, $table)
620 . '&session_max_rows=' . $session_max_rows
621 . '&disp_direction=' . $disp_direction
622 . '&repeat_cells=' . $repeat_cells
624 . ((isset($dontlimitchars) && $dontlimitchars == '1') ?
'&dontlimitchars=1' : '')
625 . '&sql_query=' . urlencode($sql_query);
626 echo ' <!-- Print view -->' . "\n"
627 . ' <a href="sql.php3' . $url_query . '" target="print_view">' . $strPrintView . '</a>' . "\n";
628 } // end displays "printable view"
633 // Export link, if only one table
634 // (the url_query has extra parameters that won't be used to export)
635 if (!isset($printview)
636 && isset($analyzed_sql[0]['table_ref'][0]['table_true_name'])
637 && !isset($analyzed_sql[0]['table_ref'][1]['table_true_name'])) {
638 echo ' <!-- Export -->' . "\n"
639 . ' <a href="tbl_properties_export.php3' . $url_query . '&unlim_num_rows=' . $unlim_num_rows . '">' . $strExport . '</a>' . "\n";
642 // Bookmark Support if required
643 if ($disp_mode[7] == '1'
644 && ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table'] && empty($id_bookmark))
645 && !empty($sql_query)) {
649 . PMA_generate_common_url($db, $table)
651 . '&session_max_rows=' . $session_max_rows
652 . '&disp_direction=' . $disp_direction
653 . '&repeat_cells=' . $repeat_cells
654 . '&dontlimitchars=' . $dontlimitchars
655 . '&sql_query=' . urlencode($sql_query)
656 . '&id_bookmark=1';
658 <!-- Bookmark the query
-->
659 <form action
="sql.php3" method
="post" onsubmit
="return emptyFormElements(this, 'fields[label]');">
662 if ($disp_mode[3] == '1') {
663 echo ' <i>' . $strOr . '</i>' . "\n";
667 <?php
echo $strBookmarkLabel; ?
> 
;:
668 <?php
echo PMA_generate_common_hidden_inputs(); ?
>
669 <input type
="hidden" name
="goto" value
="<?php echo $goto; ?>" />
670 <input type
="hidden" name
="fields[dbase]" value
="<?php echo htmlspecialchars($db); ?>" />
671 <input type
="hidden" name
="fields[user]" value
="<?php echo $cfg['Bookmark']['user']; ?>" />
672 <input type
="hidden" name
="fields[query]" value
="<?php echo urlencode($sql_query); ?>" />
673 <input type
="text" name
="fields[label]" value
="" />
674 <input type
="submit" name
="store_bkm" value
="<?php echo $strBookmarkThis; ?>" />
677 } // end bookmark support
679 // Do print the page if required
680 if (isset($printview) && $printview == '1') {
683 <script type
="text/javascript" language
="javascript1.2">
686 if (typeof(window
.print) != 'undefined') {
693 } // end rows returned
695 } // end executes the query
700 * Displays the footer
702 require('./footer.inc.php3');