<?php

declare(strict_types=1);

require_once __DIR__ . '/helpers.php';

player_module_boot();

$pageTitle = 'Add Player';
$formErrors = flash('errors') ?? [];

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>
            <h2 class="h4 mb-0">Register player</h2>
        </div>
        <a class="btn btn-outline-jlfc" href="<?php echo e(base_url('app/modules/players/bulk.php' . (isset($_GET['club_id']) ? '?club_id=' . (int) $_GET['club_id'] : ''))); ?>">
            <i class="bi bi-file-earmark-arrow-up"></i>
            Bulk register
        </a>
    </div>
    <form method="post" action="<?php echo e(base_url('app/modules/players/actions.php')); ?>" enctype="multipart/form-data" novalidate>
        <?php echo csrf_input(); ?>
        <input type="hidden" name="action" value="create">
        <?php require __DIR__ . '/_form.php'; ?>
        <div class="d-flex gap-2 mt-4">
            <button class="btn btn-jlfc" type="submit">Create player</button>
            <a class="btn btn-outline-jlfc" href="<?php echo e(base_url('app/modules/players/index.php')); ?>">Cancel</a>
        </div>
    </form>
</section>
<?php require dirname(__DIR__, 2) . '/includes/footer.php'; ?>