 <div class="content-wrapper">
   <!-- Content Header (Page header) -->
   <div class="content-header">
     <div class="container-fluid">
       <div class="row mb-2">
         <div class="col-sm-6">
           <h1 class="m-0 text-dark"><?php echo $title ?></h1>
         </div><!-- /.col -->
         <div class="col-sm-6">
           <ol class="breadcrumb float-sm-right">
             <li class="breadcrumb-item"><a href="<?php echo base_url() ?>admin/admin/dashboard">Dashboard</a></li>
             <li class="breadcrumb-item"><a href="#"><?php echo ucwords(str_replace("_", " ", $this->uri->segment(2))); ?></a></li>
             <li class="breadcrumb-item active"><?php echo ucwords(str_replace("_", " ", $title)); ?></li>

           </ol>
         </div><!-- /.col -->
       </div><!-- /.row -->
     </div><!-- /.container-fluid -->
   </div>
   <!-- /.content-header -->

   <!-- Main content -->
   <section class="content">
     <div class="container-fluid">
       <div class="row">
         <div class="col-sm-12">
           <div class="card card-default">
             <div class="card-header">
               <h3 class="card-title">Add <?php echo $title ?></h3>
               <div class="card-tools">
                 <a href="<?php echo base_url(); ?>admin/category/view_all_category" class="btn btn-primary btn-sm"><i class="fa fa-eye" aria-hidden="true"></i> View Category</a>
               </div>
             </div>
             <!-- /.card-header -->
             <?php echo form_open_multipart('admin/category/new_category_add'); ?>
             <div class="card-body">
               <div class="row">

                 <div class="col-md-12">
                   <div class="form-group">
                     <label for="inputEmail" class="col-sm-12 col-form-label">Category Name <span class="required">*</span></label>
                     <div class="col-sm-12">
                       <input class="form-control" name="name" placeholder="Enter Category Name" required="required">
                     </div>
                   </div>
                 </div>

                 <div class="col-md-12">
                   <div class="form-group">
                     <label for="inputEmail" class="col-sm-12 col-form-label">Select Parent Category</label>
                     <div class="col-sm-12">
                       <select id="showing" class="form-control" name="parent_category">
                         <option value="">Select Cateory</option>
                         <?php foreach ($get_all_category_name as $key => $category): ?>
                           <option value="<?php echo $category->id ?>"><?php echo $category->name ?></option>
                         <?php endforeach; ?>
                       </select>
                     </div>
                   </div>
                 </div>

                 <div class="col-md-3 showing">
                   <div class="form-group">
                     <label for="inputEmail" class="col-sm-12 col-form-label">Show in Front Page<span class="required">*</span></label>
                     <div class="col-sm-12">
                       <select class="form-control" name="front_show">
                         <option value="1">Yes</option>
                         <option value="0">No</option>
                       </select>
                     </div>
                   </div>
                 </div>

                 <div class="col-md-3 showing">
                   <div class="form-group">
                     <label for="inputEmail" class="col-sm-12 col-form-label">Price</label>
                     <div class="col-sm-12">
                       <input class="form-control" name="price" type="number" placeholder="Enter Course Price">
                     </div>
                   </div>
                 </div>

                 <div class="col-md-3 showing">
                   <div class="form-group">
                     <label for="inputEmail" class="col-sm-12 col-form-label">Showing in Specialist Category</label>
                     <div class="col-sm-12">
                       <select class="form-control" name="showing_in_specialist_cat" placeholder="Enter Course Price">
                        <option value="0">No</option>
                        <option value="1">Yes</option>
                       </select>
                     </div>
                   </div>
                 </div>

                 <div class="col-md-3">
                   <div class="form-group">
                     <label for="inputEmail" class="col-sm-12 col-form-label">Category Position<span class="required">*</span></label>
                     <div class="col-sm-12">
                       <input type="number" class="form-control" name="menu_position" placeholder="Enter menu Position">
                     </div>
                   </div>
                 </div>


                 <div class="col-md-12">
                   <div class="form-group">
                     <button name="submit" style="float: right" type="submit" class="btn btn-success">Add</button>
                   </div>
                 </div>

                 <?php echo form_close() ?>


                 <!-- /.col -->
               </div>
               <!-- /.row -->
             </div>
             <!-- /.card-body -->
           </div>
         </div>
       </div>
       <!-- /.row -->
     </div><!--/. container-fluid -->
   </section>
   <!-- /.content -->
 </div>
 <!-- /.content-wrapper -->
 <script type="text/javascript">
   $(document).ready(function() {
     $('#showing').on('change', function() {
       if (this.value > 0)
       //.....................^.......
       {
         $(".showing").hide();
         document.getElementById("mobile_image").required = false;
         document.getElementById("comission").required = false;
         document.getElementById("image").required = false;
       } else {
         $(".showing").show();
         document.getElementById("mobile_image").required = true;
         document.getElementById("comission").required = true;
         document.getElementById("image").required = true;
       }
     });
   });
 </script>