<?php
  require_once("../../session_check.php");
  require_once("../../../classes/main_classes.php");

  if(!isset($_POST["b_category_id"])){
    die("<p class='alert alert-warning'>Invalid request</p>");
  }

  $b_category_id=addslashes($_POST["b_category_id"]);

  //OBJECTS
  $retrieveObj=new RETRIEVE();

  $get_bc=$retrieveObj->retriever("blog_categories","*","b_category_id",$b_category_id,"fetch");
?>

<h4 class="page-title">
  <span class="fas fa-blog"></span>
  Blog
</h4>
<p><a href="#" class="bold" onclick="blog_view()">Blog</a> <span class="fas fa-angle-right"></span> <a href="#" class="bold" onclick="blog_categories_view()">Blog Categories </a> <span class="fas fa-angle-right"></span> Edit blog category</p>
<div class="content-wrapper ">
    <div class="row">
        <div class="col-md-12">
          <div class="mx-auto card p-2">
            <p class="text-center lead">Edit blog category</p>
            <form id="edit_blog_category_form" class="row">
              <div class="col-12 col-sm-12 col-md-12 col-md-12" id="edit_blog_category_response">
                  
                </div>
              <div class="col-8 col-sm-9 col-md-10 col-md-10">
                <div class="my-2">
                  <input class="form-control" type="text" name="category_name" placeholder="Blog category name" value="<?php echo $get_bc->b_category_name ?>">
                </div>
              </div>

              <div class="col-4 col-sm-3 col-md-2 col-md-2">
                

                <div class="my-2">
                  <input type="hidden" name="edit_blog_category_note" value="<?php echo $get_bc->b_category_id ?>">
                  <button type="submit" class="btn btn-primary btn-block enter-btn" onclick="edit_blog_category()">Update</button>
                </div>
              </div>
            </form>
          </div>
        </div>
    </div>
</div>