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

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

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