<script src="<?php echo base_url(); ?>assets/ckeditor/ckeditor.js"></script>
<!-- **********************************************************************************************************************************************************
    MAIN CONTENT
    *********************************************************************************************************************************************************** -->
<!--main content start-->
<?php
if ($data_page->num_rows() == 0) {
    $id = "";
    $meta_key = "";
    $meta_desc = "";
    $title = "";
    $content = "";
} else {
    foreach ($data_page->result() as $page) {
        $id = $page->id;
        $meta_key = $page->meta_keyword;
        $meta_desc = $page->meta_description;
        $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/article/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">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 Keyword</label>
                            <div class="col-sm-10">
                                <textarea name="meta_keyword" class="form-control"><?= $meta_key?></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">Meta Description</label>
                            <div class="col-sm-10">
                                <textarea name="meta_description" class="form-control"><?= $meta_desc?></textarea>
                            </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">
                                <textarea class="ckeditor" name="editor" id="ckeditor" rows="10" cols="80"><?= $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>
