<ol class="breadcrumb pull-right">
    <li><a href="<?php echo site_url('admin/dashboard') ?>">Home</a></li>
    <li><a href="<?php echo site_url('admin/posts') ?>">Posts</a></li>
    <li class="active">Manage Post</li>
</ol>
<h1 class="page-header">Manage Post</h1>
<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">Post</h3>
    </div>
    <div class="panel-body">
       <?php if (validation_errors()) : ?>
            <div class="form-group">
                <div class="alert alert-danger">
                    <?php echo validation_errors() ?>
                </div>
            </div>
        <?php endif ?>
        <form role="form" class="form-horizontal" role="form" method="post" enctype="multipart/form-data">
            <div class="form-group">
                <label class="col-sm-2 control-label">Post Category <span class="required">*</span></label>
                <div class="col-sm-10">
                    <?php echo form_dropdown('blog_category_id', dd2menu('blog_categories', array('blog_category_id' => 'title')), set_value('blog_category_id', $item->blog_category_id), 'class="form-control"') ?>
                </div>
            </div>
            <div class="form-group-separator"></div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="field-1"> Title <span class="required">*</span></label>

                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="Title" name="title"
                           value="<?php echo set_value('title', $item->title) ?>">
                </div>
            </div>
            <div class="form-group-separator"></div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="field-1"> Permalink <span class="required">*</span></label>

                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="Permalink" name="permalink"
                           value="<?php echo set_value('permalink', $item->permalink) ?>">
                </div>
            </div>
            <div class="form-group-separator"></div>

            <div class="form-group">
                <label class="col-sm-2 control-label">Content</label>
                <div class="compose-message-editor col-sm-10">
                    <textarea class="form-control" name="content" placeholder="Content" style="height: 300px;"><?php echo set_value('content', $item->content) ?></textarea>
                </div>
            </div>
            <div class="form-group-separator"></div>

            <div class="form-group">
                <label class="col-sm-2 control-label">Meta Keywords </label>

                <div class="compose-message-editor col-sm-10">
                    <textarea class="form-control" name="meta_keywords" placeholder="Meta Keywords" style="height: 120px;"><?php echo set_value('meta_keywords', $item->meta_keywords) ?></textarea>
                </div>
            </div>
            <div class="form-group-separator"></div>

            <div class="form-group">
                <label class="col-sm-2 control-label">Meta Description </label>

                <div class="compose-message-editor col-sm-10">
                    <textarea class="form-control" name="meta_description" placeholder="Meta Description" style="height: 150px;"><?php echo set_value('meta_description', $item->meta_description) ?></textarea>
                </div>
            </div>
            <div class="form-group-separator"></div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="field-1"> Main Image Post <span class="required">*</span></label>

                <div class="col-sm-8">
                    <input class="form-control" type="file" name="image" >
                </div>
                <div class="col-sm-2">
                    <?php if ($item->image): ?>
                        <img src="<?php echo base_url() ?>/cdn/blog/<?php echo $item->image ?>" class="img-inline userpic-32" height="32"/>
                    <?php endif ?>
                </div>
            </div>
            <div class="form-group-separator"></div>

            <div class="form-group">
                <label class="col-sm-2 control-label"></label>

                <div class="col-sm-10">
                    <button type="submit" class="btn btn-lime" name="submit"><i class="fa fa-check-circle"></i> Submit</button>
                    <a href="<?php echo site_url('admin/posts/index'); ?>" class="btn btn-danger"><i class="fa fa-ban"></i> Cancel</a>
                </div>
            </div>
        </form>
    </div>
</div>

