*/ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( isset( $_GET['accessible_docs_documents_list_nonce'] ) ) { if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['accessible_docs_documents_list_nonce'] ) ), 'accessible_docs_documents_list' ) ) { $search_query = $start_date = $end_date = $status_filter = ''; } } $search_query = isset($_GET['s']) ? sanitize_text_field( wp_unslash( $_GET['s'] ) ) : ''; $start_date = isset($_GET['start_date']) ? sanitize_text_field( wp_unslash( $_GET['start_date'] ) ) : ''; $end_date = isset($_GET['end_date']) ? sanitize_text_field( wp_unslash( $_GET['end_date'] ) ) : ''; $status_filter = isset($_GET['status']) ? sanitize_text_field( wp_unslash( $_GET['status'] ) ) : ''; $paged = isset($_GET['paged']) ? max( 1, intval( wp_unslash( $_GET['paged'] ) ) ) : 1; $items_per_page = 20; // Number of items per page $total_items = Group107_AccessibleDocs_Db_Handler::accessible_docs_get_documents_count( $search_query, $start_date, $end_date, $status_filter ); $total_pages = ceil( $total_items / $items_per_page ); $documents = Group107_AccessibleDocs_Db_Handler::accessible_docs_get_documents( $search_query, $start_date, $end_date, $status_filter, $paged, $items_per_page ); ?>


file_id ); $attachment_name = $attachment ? urldecode( $attachment->post_name ) : __( '(deleted file)', 'accessible-docs' ); // This will give you the post slug $attachment_title = $attachment ? $attachment->post_title : $attachment_name; ?>
email ); ?> date ) ) ); ?> accessible_docs_status ? esc_html__( 'In process', 'accessible-docs' ) : esc_html__( 'Completed', 'accessible-docs' ) ); ?>
' . esc_html__( '%d items', 'accessible-docs' ) . '', intval( $total_items ) ); ?> 1 ) { $pagination_links = paginate_links( array( 'base' => add_query_arg( 'paged', '%#%' ), 'format' => '', 'current' => $paged, 'total' => $total_pages, 'mid_size' => 1, 'add_args' => array( 's' => $search_query, 'start_date' => $start_date, 'end_date' => $end_date, 'status' => $status_filter, ), 'prev_text' => '‹', 'next_text' => '›', 'type' => 'array', ) ); if ( $pagination_links ) { foreach ( $pagination_links as $link ) { // Add class to each link. $link_class = 'tablenav-pages-navspan button'; // Check if it's the "disabled" link for first/last page. if ( ( str_contains($link, 'prev') && $paged === 1 ) || ( str_contains($link, 'next') && $paged === $total_pages ) ) { $link_class .= ' disabled'; $link = preg_replace( '/(.*?)<\/a>/', '$1', $link ); } else { $link = preg_replace( '/