



<?php
        // Pagination variables
        $limit = 10;  // Number of records per page
        $page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
        $offset = ($page - 1) * $limit;

        // Query to get the customers with LIMIT and OFFSET
        $result = mysqli_query($con, "SELECT * FROM customer LIMIT $limit OFFSET $offset");
        $seq_no = $offset + 1;  // Starting number for the records

        // Displaying the customer rows
        while ($row = mysqli_fetch_assoc($result)) {
            ?>






Contan




<?php
            $seq_no++;
        }

        // Query to get the total number of customers for pagination calculation
        $total_result = mysqli_query($con, "SELECT COUNT(*) AS total FROM customer");
        $total_row = mysqli_fetch_assoc($total_result);
        $total_records = $total_row['total'];
        $total_pages = ceil($total_records / $limit);
    ?>
thad

<!-- Pagination Links -->
<div class="pagination">
    <?php
    for ($i = 1; $i <= $total_pages; $i++) {
        $active_class = ($page == $i) ? 'active' : '';
        echo "<a href='?page=$i' class='page-link $active_class'>$i</a>";
    }
    ?>
</div>

<script>
    function showForm() {
        document.getElementById('productFormContainer').style.display = 'flex';
    }

    function hideForm() {
        document.getElementById('productFormContainer').style.display = 'none';
    }
</script>
