<div class="content-wrapper">
    <section class="content-header">
        <h1>
            Halaman
            <small>Edit Halaman</small>
        </h1>
    </section>
    
    <section class="content">
        <a href="<?php echo base_url().'dashboard/halaman'; ?>" class="btn btn-sm btn-primary">Kembali</a>
        <br/><br/>
        
        <?php foreach($halaman as $h): ?>
            <form method="post" action="<?php echo base_url('dashboard/halaman_update'); ?>" novalidate>
                <!-- CSRF Protection -->
                <input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
                <input type="hidden" name="id" value="<?php echo $h->halaman_id; ?>">

                <div class="row">
                    <div class="col-lg-12">
                        <div class="box box-primary">
                            <div class="box-body">
                                <!-- Input Judul -->
                                <div class="form-group">
                                    <label>Judul</label>
                                    <input type="text" name="judul" class="form-control" required
                                           placeholder="Masukkan judul halaman.." 
                                           value="<?php echo set_value('judul', $h->halaman_judul); ?>">
                                    <?php echo form_error('judul', '<div class="text-danger">', '</div>'); ?>
                                </div>

                                <!-- Input Konten -->
                                <div class="form-group">
                                    <label>Konten</label>
                                    <textarea class="form-control" id="editor" name="konten" required><?php echo set_value('konten', $h->halaman_konten); ?></textarea>
                                    <?php echo form_error('konten', '<div class="text-danger">', '</div>'); ?>
                                </div>

                                <!-- Tombol Submit -->
                                <input type="submit" value="Simpan Perubahan" class="btn btn-success btn-block">
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        <?php endforeach; ?>
    </section>
</div>
