<?php $pageTitle = 'Create Module'; ?>
<div class="mb-3"><a href="<?= base_url('admin/modules/' . $course['id']) ?>" class="text-secondary"><i class="fas fa-arrow-left me-1"></i> Back to Modules</a></div>
<div class="card-cix">
    <div class="card-cix-header"><h5 class="mb-0">Add Module to: <?= e($course['title']) ?></h5></div>
    <?php if (!empty($error)): ?><div class="alert-cix alert-cix-error"><?= $error ?></div><?php endif; ?>
    <form method="POST" action="<?= base_url('admin/module-create/' . $course['id']) ?>">
        <?= csrf_field() ?>
        <div class="row g-3">
            <div class="col-md-8"><div class="form-group-cix"><label class="form-label-cix">Title *</label><input type="text" name="title" class="form-control-cix" required></div></div>
            <div class="col-md-4"><div class="form-group-cix"><label class="form-label-cix">Sort Order</label><input type="number" name="sort_order" class="form-control-cix" value="0"></div></div>
            <div class="col-12"><div class="form-group-cix"><label class="form-label-cix">Description</label><textarea name="description" class="form-control-cix" rows="3"></textarea></div></div>
            <div class="col-md-4"><div class="form-check"><input class="form-check-input" type="checkbox" name="is_published" value="1"><label class="form-check-label text-secondary">Published</label></div></div>
        </div>
        <button type="submit" class="btn-cix btn-cix-accent mt-3"><i class="fas fa-save"></i> Create Module</button>
    </form>
</div>
