
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1>Update Blog</h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="#">Home</a></li>
              <li class="breadcrumb-item active">Update Blog</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <!-- SELECT2 EXAMPLE -->
        <div class="card card-default">
          <div class="card-header">
            <div class="card-tools">
              <a href="<?php echo base_url() ?>/admin/blog/view_all_blog"><button type="button" class="btn btn-success btn-sm">View All Blog</button></a>
             
            </div>
          </div>
          <!-- /.card-header -->
          <?php echo form_open_multipart(base_url().'/admin/blog/update_blog_new/'.$blog->id); ?>
          <div class="card-body">
            <div class="row">
              <div class="col-md-12">
                <div class="form-group">
                  <label>Blog Title <span class="required">*</span></label>
                  <input type="text" name="title" class="form-control" placeholder="Enter Blog Title" required="" value="<?php echo $blog->title; ?>">
                </div>
              </div>
              <div class="col-md-12 d-none">
                <div class="form-group">
                  <label>Blog Slug <small>(If you leave it blank, it will be generated automatically.)</small></label>
                  <input type="text" name="title_slug" class="form-control" placeholder="Enter Blog Slug" value="<?php echo $blog->title_slug; ?>">
                </div>
              </div>
              <div class="col-md-12">
                <div class="form-group">
                  <label>Blog Short Description <span class="required">*</span></label>
                  <textarea type="text" name="short_description" class="form-control" placeholder="Enter Blog Short Description" required=""><?php echo $blog->short_description; ?></textarea>
                </div>
              </div>
              <div class="col-md-12">
                <div class="form-group">
                  <label>Blog Keywords</label>
                  <textarea type="text" name="keywords" class="form-control" placeholder="Enter Blog Keywords"><?php echo $blog->keywords; ?></textarea>
                </div>
              </div>
              <div class="col-md-12 d-none">
                <div class="row">
                  <div class="col-sm-4">
                    <div class="">
                      <label for="radioDanger3">
                        Add to Featured
                      </label>
                    </div>
                  </div>
                  <div class="col-sm-4">
                    <div class="form-group clearfix">
                      <div class="icheck-danger d-inline">
                        <input type="radio" <?php if($blog->breaking == 0){echo 'checked';}?> name="breaking" checked="" id="breaking-off" value="0">
                        <label for="breaking-off">
                        </label>
                      </div>
                      <div class="icheck-success d-inline">
                        <input <?php if($blog->breaking == 1){echo 'checked';}?> type="radio" name="breaking" id="breaking-on" value="1">
                        <label for="breaking-on">
                        </label>
                      </div>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-12 d-none">
                <div class="row">
                  <div class="col-sm-4">
                    <div class="">
                      <label for="radioDanger3">
                        Send Post to All Subscribers <small>(Newsletter)</small>
                      </label>
                    </div>
                  </div>
                  <div class="col-sm-4">
                    <div class="form-group clearfix">
                      <div class="icheck-danger d-inline">
                        <input type="radio" name="send_post_to_subscribes" checked="" id="send_post_to_subscribes-off" value="0">
                        <label for="send_post_to_subscribes-off">
                        </label>
                      </div>
                      <div class="icheck-success d-inline">
                        <input type="radio" name="send_post_to_subscribes" id="send_post_to_subscribes-on" value="1">
                        <label for="send_post_to_subscribes-on">
                        </label>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="col-md-12 d-none">
                <div class="form-group">
                  <label>Tags</label>
                  <textarea type="text" name="tag" class="form-control" placeholder="Enter Blog Tag" ><?php echo $blog->tag; ?></textarea>
                </div>
              </div>
              <div class="col-md-12">
                <div class="form-group">
                  <label>Blog Content</label>
                  <textarea type="text" name="content" class="form-control text-editor" placeholder="Enter Blog content"><?php echo $blog->content; ?></textarea>
                </div>
              </div>

              <div class="col-md-12 ">
               <div class="row">
                  <div class="col-md-12">
                     <div class="form-group">
                        <label for="inputEmail" class="col-sm-12 col-form-label">Blog Image</label>
                        <input type="file" name="image" class="form-control name_list image" />
                     </div>
                  </div>
               </div>
            </div>  
            <div class="col-md-12 ">
               <div class="row">
                  <div class="col-md-12">
                     <div class="form-group">
                        <label for="inputEmail" class="col-sm-12 col-form-label">Preview Blog Image</label>
                       <img src="<?php echo base_url()?><?php echo $blog->image; ?>" width="150px">
                     </div>
                  </div>
               </div>
            </div>  
            <div class="col-md-12">
                <div class="form-group">
                  <label>Blog Category</label>
                  <select  name="category" class="form-control">
                    <option value="">Select Category</option>
                    <?php foreach ($all_category as $key => $category):?>
                      <option <?php if($category->category_id == $blog->category){echo 'selected';}?> value="<?php echo $category->category_id ?>"><?php echo $category->category_name ?></option>
                    <?php endforeach; ?>
                  </select>
                </div>
              </div>

              
              <div class="col-md-12">
                <div class="form-group">
                  <button class="btn btn-info" type="submit" style="float: right">Save</button>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
    <!-- /.content -->
  </div>
  