PMA\libraries\controllers\table\TableSearchController::zoomSubmitAction PHP Метод

zoomSubmitAction() публичный Метод

Zoom submit action
public zoomSubmitAction ( string $dataLabel, string $goto ) : void
$dataLabel string Data label
$goto string Goto
Результат void
    public function zoomSubmitAction($dataLabel, $goto)
    {
        //Query generation part
        $sql_query = $this->_buildSqlQuery();
        $sql_query .= ' LIMIT ' . $_POST['maxPlotLimit'];
        //Query execution part
        $result = $this->dbi->query($sql_query . ";", null, DatabaseInterface::QUERY_STORE);
        $fields_meta = $this->dbi->getFieldsMeta($result);
        $data = array();
        while ($row = $this->dbi->fetchAssoc($result)) {
            //Need a row with indexes as 0,1,2 for the getUniqueCondition
            // hence using a temporary array
            $tmpRow = array();
            foreach ($row as $val) {
                $tmpRow[] = $val;
            }
            //Get unique condition on each row (will be needed for row update)
            $uniqueCondition = Util::getUniqueCondition($result, count($this->_columnNames), $fields_meta, $tmpRow, true, false, null);
            //Append it to row array as where_clause
            $row['where_clause'] = $uniqueCondition[0];
            $tmpData = array($_POST['criteriaColumnNames'][0] => $row[$_POST['criteriaColumnNames'][0]], $_POST['criteriaColumnNames'][1] => $row[$_POST['criteriaColumnNames'][1]], 'where_clause' => $uniqueCondition[0]);
            $tmpData[$dataLabel] = $dataLabel ? $row[$dataLabel] : '';
            $data[] = $tmpData;
        }
        unset($tmpData);
        //Displays form for point data and scatter plot
        $titles = array('Browse' => Util::getIcon('b_browse.png', __('Browse foreign values')));
        $this->response->addHTML(Template::get('table/search/zoom_result_form')->render(array('_db' => $this->db, '_table' => $this->table, '_columnNames' => $this->_columnNames, '_foreigners' => $this->_foreigners, '_columnNullFlags' => $this->_columnNullFlags, '_columnTypes' => $this->_columnTypes, 'titles' => $titles, 'goto' => $goto, 'data' => $data)));
    }