getHeader(); $scripts = $header->getScripts(); $scripts->addFile('db_structure.js'); /** * If we are not in an Ajax request, then do the common work and show the links etc. */ require 'libraries/db_common.inc.php'; $url_query .= '&goto=tbl_tracking.php&back=db_tracking.php'; // Get the database structure $sub_part = '_structure'; require 'libraries/db_info.inc.php'; // Work to do? // (here, do not use $_REQUEST['db] as it can be crafted) if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) { PMA_Tracker::deleteTracking($GLOBALS['db'], $_REQUEST['table']); /** * If in an Ajax request, generate the success message and use * {@link PMA_Response()} to send the output */ if ($GLOBALS['is_ajax_request'] == true) { $response = PMA_Response::getInstance(); $response->addJSON('message', PMA_Message::success()); exit; } } // Get tracked data about the database $data = PMA_Tracker::getTrackedData($_REQUEST['db'], '', '1'); // No tables present and no log exist if ($num_tables == 0 && count($data['ddlog']) == 0) { echo '
' . __('No tables found in database.') . '
' . "\n"; if (empty($db_is_information_schema)) { include 'libraries/display_create_table.lib.php'; } exit; } // --------------------------------------------------------------------------- // Prepare statement to get HEAD version $all_tables_query = ' SELECT table_name, MAX(version) as version FROM ' . PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb']) . '.' . PMA_Util::backquote($GLOBALS['cfg']['Server']['tracking']) . ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($_REQUEST['db']) . '\' ' . ' GROUP BY table_name' . ' ORDER BY table_name ASC'; $all_tables_result = PMA_queryAsControlUser($all_tables_query); // If a HEAD version exists if ($GLOBALS['dbi']->numRows($all_tables_result) > 0) { ?>' . ' | ' . '' . __('Versions') . '' . ' | ' . '' . __('Tracking report') . '' . ' | ' . '' . __('Structure snapshot') . '' . ' | ' . '