PMA\libraries\controllers\table\TableSearchController::indexAction PHP Method

indexAction() public method

Index action
public indexAction ( ) : void
return void
    public function indexAction()
    {
        switch ($this->_searchType) {
            case 'replace':
                if (isset($_POST['find'])) {
                    $this->findAction();
                    return;
                }
                $this->response->getHeader()->getScripts()->addFile('tbl_find_replace.js');
                if (isset($_POST['replace'])) {
                    $this->replaceAction();
                }
                // Displays the find and replace form
                $this->displaySelectionFormAction();
                break;
            case 'normal':
                $this->response->getHeader()->getScripts()->addFiles(array('makegrid.js', 'sql.js', 'tbl_select.js', 'tbl_change.js', 'jquery/jquery-ui-timepicker-addon.js', 'jquery/jquery.uitablefilter.js', 'gis_data_editor.js'));
                if (isset($_REQUEST['range_search'])) {
                    $this->rangeSearchAction();
                    return;
                }
                /**
                 * No selection criteria received -> display the selection form
                 */
                if (!isset($_POST['columnsToDisplay']) && !isset($_POST['displayAllColumns'])) {
                    $this->displaySelectionFormAction();
                } else {
                    $this->doSelectionAction();
                }
                break;
            case 'zoom':
                $this->response->getHeader()->getScripts()->addFiles(array('makegrid.js', 'sql.js', 'jqplot/jquery.jqplot.js', 'jqplot/plugins/jqplot.canvasTextRenderer.js', 'jqplot/plugins/jqplot.canvasAxisLabelRenderer.js', 'jqplot/plugins/jqplot.dateAxisRenderer.js', 'jqplot/plugins/jqplot.highlighter.js', 'jqplot/plugins/jqplot.cursor.js', 'jquery/jquery-ui-timepicker-addon.js', 'tbl_zoom_plot_jqplot.js', 'tbl_change.js'));
                /**
                 * Handle AJAX request for data row on point select
                 *
                 * @var boolean Object containing parameters for the POST request
                 */
                if (isset($_REQUEST['get_data_row']) && $_REQUEST['get_data_row'] == true) {
                    $this->getDataRowAction();
                    return;
                }
                /**
                 * Handle AJAX request for changing field information
                 * (value,collation,operators,field values) in input form
                 *
                 * @var boolean Object containing parameters for the POST request
                 */
                if (isset($_REQUEST['change_tbl_info']) && $_REQUEST['change_tbl_info'] == true) {
                    $this->changeTableInfoAction();
                    return;
                }
                // Gets tables information
                include_once './libraries/tbl_info.inc.php';
                //Set default datalabel if not selected
                if (!isset($_POST['zoom_submit']) || $_POST['dataLabel'] == '') {
                    $dataLabel = PMA_getDisplayField($this->db, $this->table);
                } else {
                    $dataLabel = $_POST['dataLabel'];
                }
                // Displays the zoom search form
                $this->displaySelectionFormAction($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]) {
                    if (!isset($goto)) {
                        $goto = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table');
                    }
                    $this->zoomSubmitAction($dataLabel, $goto);
                }
                break;
        }
    }