<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>Add New Category</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">Add New Product Category</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>
    <!-- Form Examples area start-->
    
                    <?php
              $success = $this->session->flashdata('success');
               if(isset($success)){  ?>
            <div class="alert alert-success">
              <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
              <?php echo $this->session->flashdata('success');?>
          </div>
          <?php } ?>

          <?php
              $same = $this->session->flashdata('same');
               if(isset($same)){  ?>
            <div class="alert alert-warning">
              <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
              <?php echo $this->session->flashdata('same');?>
          </div>
          <?php } ?>
          <section class="content">
      <div class="container-fluid">
        <div class="row">
          <!-- /.col -->
          <div class="col-md-9">
            <div class="card card-primary card-outline">
              <div class="card-header">
                <h3 class="card-title">Add Your Category</h3>
              </div>
              <!-- /.card-header -->
              <div class="card-body">
                    <form action="<?php if(!isset($data)){ echo base_url('admin/Add_category/insert'); }else{ echo base_url('admin/Add_category/update');}?>" method="POST" enctype="multipart/form-data">
                    <div class="form-example-wrap">
                        <div class="cmp-tb-hd">
                            <h2>Add New Category</h2>
                            <p></p>
                        </div>
                        <div class="form-example-int">
                            <div class="form-group">
                                <label>Category Name <small>(Your Category Name Convert into your URL/SLUG)</small></label>
                                <div class="nk-int-st">
                                    <input type="text" value="<?php if(isset($data)){echo $data[0]->category_name;}else{ echo "";} ?>" name="name" required="" class="form-control input-sm" placeholder="Enter Name">
                                </div>
                            </div>
                        </div>
                        <div class="form-example-int">
                            <div class="form-group">
                                <label>Category Title</label>
                                <div class="nk-int-st">
                                    <input type="text" name="title" value="<?php if(isset($data)){echo $data[0]->cat_title;}else{ echo "";} ?>" required="" class="form-control input-sm" placeholder="Enter Meta Title">
                                    <input type="hidden" name="id" value="<?php if(isset($data)){echo $data[0]->id;}else{ echo "";} ?>">
                                </div>
                            </div>
                        </div>

                        <div class="form-example-int">
                            <div class="form-group">
                                <label>Category Description</label>
                                <div class="nk-int-st">
                                    <input type="text" name="des" required="" value="<?php if(isset($data)){echo $data[0]->cat_dis;}else{ echo "";} ?>" class="form-control input-sm" placeholder="Enter Meta Description">
                                </div>
                            </div>
                        </div>
                        
                        
                        <div class="form-example-int mg-t-15">
                            <button class="btn btn-success notika-btn-success" type="submit"><?php if(isset($data)){ ?> UPDATE CATEGORY <?php }else{ ?>ADD CATEGORY <?php } ?></button>
                        </div>
                    </div>
                    </form>
                 
              </div>
              <!-- /.card-body -->
              <!-- /.card-footer -->
            </div>
            <!-- /.card -->
          </div>
          <!-- /.col -->
        </div>
        <!-- /.row -->
      </div><!-- /.container-fluid -->
    </section>
    <!-- /.content -->
  </div>