get_var( $wpdb->prepare( "SELECT COUNT(*) FROM %i", $doc_table ) ); $total_pages = ceil( $total_items / $items_per_page ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended $current_page = isset( $_GET['paged'] ) ? max( 1, intval( $_GET['paged'] ) ) : 1; $offset = ( $current_page - 1 ) * $items_per_page; $documents = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM %i ORDER BY created_at DESC LIMIT %d OFFSET %d", $doc_table, $items_per_page, $offset ) ); ?>
title ?: $doc->filename ); ?> filename ); ?> mime_type ); ?> status ) ); ?> created_at ) ); ?>
file_path ) && file_exists( $doc->file_path ) ) : ?>
add_query_arg( 'paged', '%#%' ), 'format' => '', 'prev_text' => __( '« Prev', 'ai-support-assistant' ), 'next_text' => __( 'Next »', 'ai-support-assistant' ), 'total' => $total_pages, 'current' => $current_page, ) ); if ( $page_links ) { echo '
' . wp_kses_post( $page_links ) . '
'; } ?>