<?php
session_start();
include('userlistfunctions.php');
//---------PAGINATION LOGOIC FOR USERLIST------------------//

$limit = 10;
$search_page_num = isset($_GET['search_page']) ? (int)$_GET['search_page'] : 1;

$offset = ($search_page_num - 1) * $limit;

// Calculate total users and total pages
$total_search_users = count($search_results);
$total_search_pages = ceil($total_search_users / $limit);

// Slice the user list for the current page
$search_results = array_slice($search_results, $offset, $limit);

?>