<script src="<?php echo base_url(); ?>assets/ckeditor/ckeditor.js"></script>
<!-- **********************************************************************************************************************************************************
    MAIN CONTENT
    *********************************************************************************************************************************************************** -->
<!--main content start-->
<?php
if ($id_page == "") {
    $id = "";
    $key_page = "";
    $title = "";
    $content = "";
    $m_desc = "";
    $m_key = "";
} else {
    foreach ($data_page->result() as $page) {
        $id = $page->id;
        $key_page = $page->key_page;
        $title = $page->title;
        $content = $page->content;
        $m_desc = $page->description;
        $m_key = $page->keyword_page;
    }
}
?>
<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/simpanData" enctype="multipart/form-data">
                        <input type="hidden" name="id_page" value="<?= $id ?>">
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">Keyword</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="key_page" value="<?= $key_page ?>">
                            </div>
                        </div>
                        <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">Meta Desc</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="desc" value="<?= $m_desc ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">Meta Key</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="m_key" value="<?= $m_key ?>">
                            </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" name="userfile">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">Content</label>
                            <div class="col-sm-10">
                                <p><textarea class="ckeditor" name="editor" id="ckeditor" rows="10" cols="80"><?= $content ?></textarea></p>
                            </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>
