<?php
require_once 'BaseController.php';
require_once __DIR__ . '/../models/AppointmentModel.php';

class AppointmentController extends BaseController
{
    private $model;

    public function __construct()
    {
        parent::__construct(); // call base controller
        $this->model = new AppointmentModel($this->conn);
    }

    public function viewAppointment($id)
    {
        try {
            $appointment = $this->model->fetchAppointment($id);
            $this->render('appointment/view_appointment.php', ['appointment' => $appointment]);
        } catch (Throwable $e) {
            $this->handleException($e);
        }
    }
}
?>
