<?php

declare(strict_types=1);

require_once __DIR__ . '/helpers.php';

staff_module_boot();

$staffRecord = find_staff_or_abort((int) ($_GET['id'] ?? 0));
$pageTitle = 'Delete Staff Member';

require dirname(__DIR__, 2) . '/includes/header.php';
require dirname(__DIR__, 2) . '/includes/sidebar.php';
require dirname(__DIR__, 2) . '/includes/topbar.php';
require dirname(__DIR__, 2) . '/includes/flash.php';
?>
<section class="panel-card">
    <div class="panel-card-header mb-3">
        <div>
            <p class="eyebrow mb-1">Club staff</p>
            <h2 class="h4 mb-0">Delete staff member</h2>
        </div>
    </div>
    <p>You are about to delete <strong><?php echo e($staffRecord['full_name']); ?></strong>.</p>
    <form method="post" action="<?php echo e(base_url('app/modules/staff/actions.php')); ?>">
        <?php echo csrf_input(); ?>
        <input type="hidden" name="action" value="delete">
        <input type="hidden" name="id" value="<?php echo e((string) $staffRecord['id']); ?>">
        <button class="btn btn-danger" type="submit">Delete staff member</button>
        <a class="btn btn-light" href="<?php echo e(base_url('app/modules/staff/view.php?id=' . (int) $staffRecord['id'])); ?>">Cancel</a>
    </form>
</section>
<?php require dirname(__DIR__, 2) . '/includes/footer.php'; ?>