console/content/view/drh_participant.auto.sql

SELECT 'dynamic' AS component, sqlpage.run_sql('shell/shell.sql') AS properties;

              SELECT 'breadcrumb' AS component;
              SELECT 'Home' as title,sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/' AS link;
              SELECT 'Console' as title,sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/console' AS link;
              SELECT 'Content' as title,sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/console/content' AS link;
              SELECT 'drh_participant view' as title, '#' AS link;

              SELECT 'title' AS component, 'drh_participant (view) Content' as contents;

              SET total_rows = (SELECT COUNT(*) FROM drh_participant);
              SET limit = COALESCE($limit, 50);
              SET offset = COALESCE($offset, 0);
              SET total_pages = ($total_rows + $limit - 1) / $limit;
              SET current_page = ($offset / $limit) + 1;

              SELECT 'text' AS component, '[drh_participant (view) Schema](console/info-schema/view.sql?name=drh_participant&stats=yes)' AS contents_md
              SELECT 'text' AS component,
                '- Start Row: ' || $offset || '
' ||
                '- Rows per Page: ' || $limit || '
' ||
                '- Total Rows: ' || $total_rows || '
' ||
                '- Current Page: ' || $current_page || '
' ||
                '- Total Pages: ' || $total_pages as contents_md
              WHERE $stats IS NOT NULL;

              -- Display uniform_resource table with pagination
              SELECT 'table' AS component,
                    TRUE AS sort,
                    TRUE AS search,
                    TRUE AS hover,
                    TRUE AS striped_rows,
                    TRUE AS small;
            SELECT * FROM drh_participant
            LIMIT $limit
            OFFSET $offset;

            SELECT 'text' AS component,
                (SELECT CASE WHEN $current_page > 1 THEN '[Previous](?limit=' || $limit || '&offset=' || ($offset - $limit) || ')' ELSE ' END) || ' ' ||
                '(Page ' || $current_page || ' of ' || $total_pages || ') ' ||
                (SELECT CASE WHEN $current_page < $total_pages THEN '[Next](?limit=' || $limit || '&offset=' || ($offset + $limit) || ')' ELSE ' END)
                AS contents_md;