<?= $this->extend('layout/default') ?>
<?= $this->section('content') ?>
<div class="container-fluid px-4">
    <h1 class="mt-4">Edit Halaman LSP P1</h1>
    <div class="card mb-4 col-lg-10 shadow border-0">
        <div class="card-body">
            <form action="<?= base_url('admin/lsp/update') ?>" method="post" enctype="multipart/form-data">
                <?= csrf_field() ?>
                <input type="hidden" name="id_lsp" value="<?= $lsp['id_lsp'] ?>">
                <input type="hidden" name="gambarLama" value="<?= $lsp['gambar_konstruksi'] ?>">

                <div class="mb-3">
                    <label class="form-label fw-bold">Judul Halaman</label>
                    <input type="text" name="judul" class="form-control" value="<?= $lsp['judul'] ?>">
                </div>

                <div class="mb-3">
                    <label class="form-label fw-bold">Konten / Isi Halaman</label>
                    <textarea name="konten" id="editor" class="form-control"><?= $lsp['konten'] ?></textarea>
                </div>

                <div class="mb-4">
                    <label class="form-label fw-bold">Gambar Konstruksi / Banner</label>
                    <div class="mb-2">
                        <img src="<?= base_url('assets/img/lsp/' . $lsp['gambar_konstruksi']) ?>" width="300" class="img-thumbnail">
                    </div>
                    <input type="file" name="gambar_konstruksi" class="form-control">
                </div>

                <button type="submit" class="btn btn-primary">Simpan Perubahan</button>
            </form>
        </div>
    </div>
</div>

<script src="https://cdn.ckeditor.com/4.22.1/standard/ckeditor.js"></script>
<script>CKEDITOR.replace('editor');</script>
<?= $this->endSection() ?>