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

Prepare a table of results returned by a SQL query.
public getTable ( &$dt_result, &$displayParts, array $analyzed_sql_results, boolean $is_limited_display = false ) : string
$analyzed_sql_results array analyzed sql results
$is_limited_display boolean With limited operations or not
Результат string $table_html Generated HTML content for resulted table
Пример #1
0
/**
 * Function to get html for the sql query results table
 *
 * @param DisplayResults $displayResultsObject instance of DisplayResult
 * @param string         $pmaThemeImage        theme image uri
 * @param string         $url_query            url query
 * @param array          $displayParts         the parts to display
 * @param bool           $editable             whether the result table is
 *                                             editable or not
 * @param int            $unlim_num_rows       unlimited number of rows
 * @param int            $num_rows             number of rows
 * @param bool           $showtable            whether to show table or not
 * @param object         $result               result of the executed query
 * @param array          $analyzed_sql_results analyzed sql results
 * @param bool           $is_limited_display   Show only limited operations or not
 *
 * @return String
 */
function PMA_getHtmlForSqlQueryResultsTable($displayResultsObject, $pmaThemeImage, $url_query, $displayParts, $editable, $unlim_num_rows, $num_rows, $showtable, $result, $analyzed_sql_results, $is_limited_display = false)
{
    $printview = isset($_REQUEST['printview']) ? $_REQUEST['printview'] : null;
    $table_html = '';
    $browse_dist = !empty($_REQUEST['is_browse_distinct']);
    if ($analyzed_sql_results['is_procedure']) {
        do {
            if (!isset($result)) {
                $result = $GLOBALS['dbi']->storeResult();
            }
            $num_rows = $GLOBALS['dbi']->numRows($result);
            if ($result !== false && $num_rows > 0) {
                $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
                $fields_cnt = count($fields_meta);
                $displayResultsObject->setProperties($num_rows, $fields_meta, $analyzed_sql_results['is_count'], $analyzed_sql_results['is_export'], $analyzed_sql_results['is_func'], $analyzed_sql_results['is_analyse'], $num_rows, $fields_cnt, $GLOBALS['querytime'], $pmaThemeImage, $GLOBALS['text_dir'], $analyzed_sql_results['is_maint'], $analyzed_sql_results['is_explain'], $analyzed_sql_results['is_show'], $showtable, $printview, $url_query, $editable, $browse_dist);
                $displayParts = array('edit_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, 'del_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, 'sort_lnk' => '1', 'nav_bar' => '1', 'bkm_form' => '1', 'text_btn' => '1', 'pview_lnk' => '1');
                $table_html .= $displayResultsObject->getTable($result, $displayParts, $analyzed_sql_results, $is_limited_display);
            }
            $GLOBALS['dbi']->freeResult($result);
            unset($result);
        } while ($GLOBALS['dbi']->moreResults() && $GLOBALS['dbi']->nextResult());
    } else {
        if (isset($result) && $result) {
            $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
            $fields_cnt = count($fields_meta);
        }
        $_SESSION['is_multi_query'] = false;
        $displayResultsObject->setProperties($unlim_num_rows, $fields_meta, $analyzed_sql_results['is_count'], $analyzed_sql_results['is_export'], $analyzed_sql_results['is_func'], $analyzed_sql_results['is_analyse'], $num_rows, $fields_cnt, $GLOBALS['querytime'], $pmaThemeImage, $GLOBALS['text_dir'], $analyzed_sql_results['is_maint'], $analyzed_sql_results['is_explain'], $analyzed_sql_results['is_show'], $showtable, $printview, $url_query, $editable, $browse_dist);
        $table_html .= $displayResultsObject->getTable($result, $displayParts, $analyzed_sql_results, $is_limited_display);
        $GLOBALS['dbi']->freeResult($result);
    }
    return $table_html;
}