<?php

namespace App\Controllers;

use App\Core\Controller;
use App\Core\Database;

class AdminTicketsController extends Controller
{
    public function index()
    {
        $this->checkPermission('sales');
        $db = Database::getInstance()->getConnection();
        // Get today's orders
        $stmt = $db->query("SELECT * FROM orders WHERE DATE(created_at) = CURDATE() ORDER BY created_at DESC");
        $orders = $stmt->fetchAll();
        
        $this->view('admin.tickets', ['orders' => $orders]);
    }
}
