// Gets tables informations require_once './libraries/tbl_info.inc.php'; if (!isset($goto)) { $goto = $GLOBALS['cfg']['DefaultTabTable']; } // Defines the url to return to in case of error in the next sql statement $err_url = $goto . PMA_URL_getCommon(array('db' => $db, 'table' => $table)); //Set default datalabel if not selected if (!isset($_POST['zoom_submit']) || $_POST['dataLabel'] == '') { $dataLabel = PMA_getDisplayField($db, $table); } else { $dataLabel = $_POST['dataLabel']; } // Displays the zoom search form $response->addHTML($table_search->getSecondaryTabs()); $response->addHTML($table_search->getSelectionForm($goto, $dataLabel)); /* * Handle the input criteria and generate the query result * Form for displaying query results */ if (isset($_POST['zoom_submit']) && $_POST['criteriaColumnNames'][0] != 'pma_null' && $_POST['criteriaColumnNames'][1] != 'pma_null' && $_POST['criteriaColumnNames'][0] != $_POST['criteriaColumnNames'][1]) { //Query generation part $sql_query = $table_search->buildSqlQuery(); $sql_query .= ' LIMIT ' . $_POST['maxPlotLimit']; //Query execution part $result = $GLOBALS['dbi']->query($sql_query . ";", null, PMA_DatabaseInterface::QUERY_STORE); $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); $data = array(); while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { //Need a row with indexes as 0,1,2 for the getUniqueCondition // hence using a temporary array
*/ require_once 'libraries/common.inc.php'; require_once 'libraries/TableSearch.class.php'; $response = PMA_Response::getInstance(); $table_search = new PMA_TableSearch($db, $table, "replace"); $connectionCharSet = $GLOBALS['dbi']->fetchValue("SHOW VARIABLES LIKE 'character_set_connection'", 0, 1); if (isset($_POST['find'])) { $preview = $table_search->getReplacePreview($_POST['columnIndex'], $_POST['find'], $_POST['replaceWith'], $connectionCharSet); $response->addJSON('preview', $preview); exit; } $header = $response->getHeader(); $scripts = $header->getScripts(); $scripts->addFile('tbl_find_replace.js'); // Show secondary level of tabs $htmlOutput = $table_search->getSecondaryTabs(); if (isset($_POST['replace'])) { $htmlOutput .= $table_search->replace($_POST['columnIndex'], $_POST['findString'], $_POST['replaceWith'], $connectionCharSet); $htmlOutput .= PMA_Util::getMessage(__('Your SQL query has been executed successfully.'), null, 'success'); } if (!isset($goto)) { $goto = $GLOBALS['cfg']['DefaultTabTable']; } // Defines the url to return to in case of error in the next sql statement $err_url = $goto . '?' . PMA_URL_getCommon($db, $table); // Displays the find and replace form $htmlOutput .= $table_search->getSelectionForm($goto); $response->addHTML($htmlOutput); ?> >>>>>>> b875702c9c06ab5012e52ff4337439b03918f453
/** * No selection criteria received -> display the selection form */ if (!isset($_POST['columnsToDisplay']) && !isset($_POST['displayAllColumns'])) { // Gets some core libraries include_once 'libraries/tbl_common.inc.php'; //$err_url = 'tbl_select.php' . $err_url; $url_query .= '&goto=tbl_select.php&back=tbl_select.php'; /** * Gets table's information */ include_once 'libraries/tbl_info.inc.php'; if (!isset($goto)) { $goto = $GLOBALS['cfg']['DefaultTabTable']; } // Defines the url to return to in case of error in the next sql statement $err_url = $goto . PMA_URL_getCommon(array('db' => $db, 'table' => $table)); // Displays the table search form $response->addHTML($table_search->getSecondaryTabs()); $response->addHTML($table_search->getSelectionForm($goto)); } else { /** * Selection criteria have been submitted -> do the work */ $sql_query = $table_search->buildSqlQuery(); /** * Parse and analyze the query */ include_once 'libraries/parse_analyze.inc.php'; PMA_executeQueryAndSendQueryResponse($analyzed_sql_results, false, $db, $table, null, null, null, false, null, null, null, $GLOBALS['goto'], $pmaThemeImage, null, null, null, $sql_query, null, null); }
/** * Test for getSelectionForm * * @return void * @group medium */ public function testGetSelectionForm() { //$this->_searchType == 'zoom' $tableSearch = new PMA_TableSearch("PMA", "PMA_BookMark", "zoom"); $url_goto = "http://phpmyadmin.net"; $form = $tableSearch->getSelectionForm($url_goto); $this->assertContains('<fieldset id="fieldset_zoom_search">', $form); $this->assertContains('Do a "query by example"', $form); //$this->_searchType == 'normal' $tableSearch = new PMA_TableSearch("PMA", "PMA_BookMark", "normal"); $url_goto = "http://phpmyadmin.net"; $form = $tableSearch->getSelectionForm($url_goto); $this->assertContains('<fieldset id="fieldset_table_search">', $form); $this->assertContains('Do a "query by example"', $form); //$this->_searchType == 'replace' $tableSearch = new PMA_TableSearch("PMA", "PMA_BookMark", "replace"); $url_goto = "http://phpmyadmin.net"; $form = $tableSearch->getSelectionForm($url_goto); $this->assertContains('<fieldset id="fieldset_find_replace">', $form); $this->assertContains(__('Find and replace'), $form); }