<?php
require_once __DIR__ . '/../../../Models/Payment.php';

class PaymentController {
    public function index() {
        $paymentModel = new Payment();
        
        $page = isset($_GET['p']) ? (int)$_GET['p'] : 1;
        $perPage = 10;
        
        $result = $paymentModel->paginateWithDetails($page, $perPage);
        $payments = $result['data'];
        
        $total = $result['total'];
        $totalPages = ceil($total / $perPage);

        require __DIR__ . '/../../../../views/admin/payments/index.php';
    }
}
