$db, 'sql_query' => $_REQUEST['sql_query'] ); if (preg_match('@^tbl_@', $GLOBALS['goto'])) { $_url_params['table'] = $table; } $err_url = $GLOBALS['goto'] . PMA_generate_common_url($_url_params); unset($_url_params); /** * Sets parameters for links * where is this variable used? * replace by PMA_generate_common_url($url_params); */ $url_query = PMA_generate_common_url($url_params, 'html', ''); /** * get table information * @todo should be done by a Table object */ require_once 'libraries/tbl_info.inc.php'; /** * Get comments for table fileds/columns */ $comments_map = array(); if ($GLOBALS['cfg']['ShowPropertyComments']) { $comments_map = PMA_getComments($db, $table); } /** * START REGULAR OUTPUT */ /** * used in ./libraries/header.inc.php to load JavaScript library file */ $GLOBALS['js_include'][] = 'functions.js'; $GLOBALS['js_include'][] = 'tbl_change.js'; $GLOBALS['js_include'][] = 'jquery/timepicker.js'; $GLOBALS['js_include'][] = 'gis_data_editor.js'; /** * HTTP and HTML headers */ require_once 'libraries/header.inc.php'; /** * Displays the query submitted and its result * * @todo where does $disp_message and $disp_query come from??? */ if (! empty($disp_message)) { if (! isset($disp_query)) { $disp_query = null; } PMA_showMessage($disp_message, $disp_query); } /** * Get the analysis of SHOW CREATE TABLE for this table * @todo should be handled by class Table */ $show_create_table = PMA_DBI_fetch_value( 'SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table), 0, 1 ); $analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table)); unset($show_create_table); /** * Get the list of the fields of the current table */ PMA_DBI_select_db($db); $table_fields = array_values(PMA_DBI_get_columns($db, $table)); $paramTableDbArray = array($table, $db); if (! isset($where_clause)) { $where_clause = null; } //Retrieve values for data edit view list($insert_mode, $where_clauses, $result, $rows, $where_clause_array, $found_unique_key) = PMA_getValuesForEditMode($where_clause, $table, $db); // Copying a row - fetched data will be inserted as a new row, therefore the where clause is needless. if (isset($_REQUEST['default_action']) && $_REQUEST['default_action'] === 'insert') { unset($where_clause, $where_clauses); } // retrieve keys into foreign fields, if any $foreigners = PMA_getForeigners($db, $table); // Retrieve form parameters for insert/edit form $_form_params = PMA_getFormParametersForInsertForm( $db, $table, $where_clauses, $where_clause_array, $err_url); /** * Displays the form */ // autocomplete feature of IE kills the "onchange" event handler and it // must be replaced by the "onpropertychange" one in this case $chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5 && PMA_USR_BROWSER_VER < 7) ? 'onpropertychange' : 'onchange'; // Had to put the URI because when hosted on an https server, // some browsers send wrongly this form to the http server. $html_output = ''; //Set on key handler for moving using by Ctrl+arrows $html_output .= '' . ''; // Set if we passed the first timestamp field $timestamp_seen = 0; $columns_cnt = count($table_fields); $tabindex = 0; $tabindex_for_function = +3000; $tabindex_for_null = +6000; $tabindex_for_value = 0; $o_rows = 0; $biggest_max_file_size = 0; $url_params['db'] = $db; $url_params['table'] = $table; $url_params = PMA_urlParamsInEditMode($url_params); //Insert/Edit form $html_output .= '
'; // end Insert/Edit form if ($insert_mode) { //Continue insertion form $html_output .= PMA_getContinueInsertionForm($table, $db, $where_clause_array, $err_url); } echo $html_output; /** * Displays the footer */ require 'libraries/footer.inc.php'; ?>