<!-- Main Content -->

<div class="page-wrapper">

<div class="container-fluid pt-25">

   <div class="row">

      <div class="alert alert-success alert-dismissible" role="alert" <?php if($this->session->flashdata('message')==''){ ?> style="display:none" <?php } ?> >

         <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>

         <?php echo $this->session->flashdata('message'); ?>

      </div>

      <div class="alert alert-warning alert-dismissible" role="alert" <?php if($this->session->flashdata('emessage')==''){ ?> style="display:none" <?php } ?> >

         <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>

         <?php echo $this->session->flashdata('emessage'); ?>

      </div>

   </div>

   <!-- Row -->

   <div class="row">

      <div class="col-sm-8 col-md-offset-2">

         <div class="panel panel-default card-view">

            <div class="panel-heading">

               <div class="pull-left">

                  <h6 class="panel-title txt-dark">Add Service Images</h6>

               </div>

               <div class="clearfix"></div>

            </div>

            <div class="panel-wrapper collapse in">

               <div class="panel-body">

                  <div class="form-wrap">

                     <form id="addTestimonialFrom" class="form-horizontal" action="<?php echo base_url(A."/addServiceGallery"); ?>" enctype="multipart/form-data" method='post'>

                        <div class="row">

                           <div class="col-md-12">

                              <div class="form-group col-sm-12">

                                 <label class="">Gallery Images (Image Size - 500x450 px)</label>

                                 <input type="file" name="image[]" class="form-control" multiple required>

                                 <p>Select multiple images.</p>

                              </div>

                              <div class="form-group col-sm-12">
                                 <label class="">Service</label>
                                 <select class="form-control" name="category" id="category" required>
                                    <option value="">Select</option>
                                    <?php if(isset($category) && !empty($category)){ foreach($category as $key=>$value) : ?>
                                       <option value="<?php echo $value['id']; ?>"><?php echo $value['category']; ?></option>
                                    <?php endforeach; } ?>
                                 </select>
                              </div>
                              <!-- <div class="form-group col-sm-12">
                                 <label class="">SubCategory</label>
                                 <select class="form-control" name="subcategory" id="subcategory" required>
                                    <option value="">Select</option>
                                 </select>
                              </div> -->

                              <div class="form-group mb-0">

                                 <div class="col-sm-12">

                                    <button type="submit" name="addcategory" class="btn btn-success btn-anim pull-right"><i class="icon-rocket"></i><span class="btn-text">Submit</span></button>

                                 </div>

                              </div>

                           </div>

                        </div>

                     </form>

                  </div>

               </div>

            </div>

         </div>

      </div>

   </div>

   <!-- /Row -->

</div>
<script>
   var path = "<?php echo base_url(A); ?>";
   $("#category").on("change",function(){

        var cid = $(this).val();

        $.ajax({

            url: path+"/getSubCatByCategory",

            type:"POST",

            data:"cid="+cid,

            success: function(result){

                $('#subcategory').html(result.html);

            }

        });

    });
</script>