<!-- 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-12">

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

            <div class="panel-heading">

               <div class="pull-left">

                  <h6 class="panel-title txt-dark">Edit Project & 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."/editGallery"); ?>" enctype="multipart/form-data" method='post'>
                        <input type="hidden" name="projectid" value="<?php echo $post['projectid']; ?>" />
                        <div class="row">

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

                              <div class="form-group col-sm-12">
                                 <label class="">Title</label>
                                 <input type="text" name="title" class="form-control" value="<?php echo $post['title']; ?>" required>
                              </div>

                              <div class="form-group col-sm-12">
                                 <label class="">Year Completed</label>
                                 <input type="text" name="completed_date" value="<?php echo $post['completed_date']; ?>" class="form-control">
                              </div>

                              <div class="form-group col-sm-12">
                                 <label class="">Designer</label>
                                 <input type="text" name="designer" value="<?php echo $post['designer']; ?>" class="form-control">
                              </div>
                              
                              <?php if($post['feat_image']!=''){ ?>
                              <div class="form-group col-sm-12">
                                 <img src="<?php echo base_url($post['feat_image']); ?>" alt="feat_image" style="width:100px;">
                              </div>
                              <?php } ?>  
                              <div class="form-group col-sm-12">
                                 <label class="">Image (Image Size - 542x638 px)</label>
                                 <input type="file" name="feat_image" class="form-control">
                              </div>

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

                                 <label class="">Gallery Images (Image Size - 800x720 px)</label>

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

                                 <p>Select multiple images.</p>

                              </div>

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

                                 <label class="">Category</label>

                                 <select class="form-control" name="category" required>
                                    <option value="">Select</option>
                                    <?php if(isset($category) && !empty($category)){ foreach($category as $key=>$value) : ?>
                                       <option <?php echo($post['category']==$value['id'])?'selected':''; ?> value="<?php echo $value['id']; ?>"><?php echo $value['category']; ?></option>
                                    <?php endforeach; } ?>
                                 </select>

                              </div>
                           </div>
                           <div class="col-md-6">
                              <?php if($post['logo_image']!=''){ ?>
                              <div class="form-group col-sm-12">
                                 <img src="<?php echo base_url($post['logo_image']); ?>" alt="logo_image" style="width:100px;">
                              </div>
                              <?php } ?> 
                              <div class="form-group col-sm-12">
                                 <label class="">Logo (Image Size - 50x50 px)</label>
                                 <input type="file" name="logo_image" class="form-control">
                              </div>
                              <div class="form-group col-sm-12">
                                 <label class="">Logo Title</label>
                                 <input type="text" name="logo_title" class="form-control" value="<?php echo $post['logo_title']; ?>">
                              </div>
                              <?php if($post['cover_image']!=''){ ?>
                              <div class="form-group col-sm-12">
                                 <img src="<?php echo base_url($post['cover_image']); ?>" alt="cover_image" style="width:100px;">
                              </div>
                              <?php } ?>
                              <div class="form-group col-sm-12">
                                 <label class="">Cover Image (Size - 1351x456 px)</label>
                                 <input type="file" name="cover_image" class="form-control">
                              </div>

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

                                 <label class="">Description</label>

                                 <textarea class="form-control tinymce" name="description"><?php echo $post['description']; ?></textarea>

                              </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>