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

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

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