<script src="<?php echo base_url() ?>assets/backend/tinymce/tinymce.min.js"></script>
<script>tinymce.init({selector: 'textarea'});</script>
<!-- **********************************************************************************************************************************************************
    MAIN CONTENT
    *********************************************************************************************************************************************************** -->
<!--main content start-->
<?php
if ($data_page->num_rows() == 0) {
    $id = "";
    $title = "";
    $content = "";
} else {
    foreach ($data_page->result() as $page) {
        $id = $page->id_page;
        $title = $page->title;
        $content = $page->content;
    }
}
?>
<section id="main-content">
    <section class="wrapper">
        <div class="row mt">
            <div class="col-lg-12">
                <div class="form-panel">
                    <h4 class="mb"><i class="fa fa-angle-right"></i> Page Management</h4>
                    <form class="form-horizontal style-form" method="POST" action="<?= base_url() ?>admin/halaman/updateData">
                        <input type="hidden" name="id_page" value="<?= $id ?>">
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">Title</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="title" value="<?= $title ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">Picture</label>
                            <div class="col-sm-10">
                                <input type="file" class="form-control" value="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">Content</label>
                            <div class="col-sm-10">
                                <textarea class="form-control" style="height: 300px" name="content"><?= $content ?></textarea>
                            </div>
                        </div>
                        <hr/>
                        <button type="submit" class="btn btn-lg btn-primary pull-right"><i class="fa fa-save"></i> Update Data</button>
                    </form>
                    <div style="clear: both"></div>
                </div>
            </div>
        </div><!--row -->
    </section>
</section>
