<script>
		$(document).ready(function(){			
		var next = 0;
    	$("#add-more").click(function(e){
        e.preventDefault();
        var addto = "#field" + next;
        var addRemove = "#field" + (next);
        next = next + 1;
        var newIn = '<br/><div id="field'+ next +'" name="field'+ next +'"><!-- Text input--><!-- Text input--><div class="form-group"> <label class="col-md-4 control-label" for="action_name">Color Name</label> <div class="col-md-5"> <input id="action_name" name="colors[]" type="text" placeholder="" class="form-control input-md"> </div></div><br><br><!-- File Button --> <div class="form-group"> <label class="col-md-4 control-label" for="action_json">Image</label> <div class="col-md-4"> <input id="action_json" name="test1[]" class="input-file" type="file"> </div></div></div>';
        var newInput = $(newIn);
        var removeBtn = '<button id="remove' + (next - 1) + '" class="btn btn-danger remove-me" >Remove</button></div></div><div id="field">';
        var removeButton = $(removeBtn);
        $(addto).after(newInput);
        $(addRemove).after(removeButton);
        $("#field" + next).attr('data-source',$(addto).attr('data-source'));
        $("#count").val(next);  
        
            $('.remove-me').click(function(e){
                e.preventDefault();
                var fieldNum = this.id.charAt(this.id.length-1);
                var fieldID = "#field" + fieldNum;
                $(this).remove();
                $(fieldID).remove();
            });
    });
			
			$(".editzip").click(function(){
			var id=$(this).attr("id");
			$.ajax({
							 type: "POST",
							 dataType:"json",
							 url: '<?php echo base_url();?>admin/ajax_editzip',
							 data: {id:id},
							 success: function(response){
								 //alert(response);
								$("#width").val(response.width);
								$("#height").val(response.height);
								$("#stitch").val(response.stitch);
								$("#price").val(response.price);
							 	$("#oldzip").val(response.zip);
								$("#zid").val(response.zid);
								$("#exts").val(response.unzip);
							 }
							 });
			});
			
			$("form#updateform").submit(function(e){
								var sid=$("#sid").val();
								//alert(sid);
								e.preventDefault();
								$.ajax({
								url: "<?php echo base_url();?>admin/update_prozip", // Url to which the request is send
								type: "POST",             // Type of request to be send, called as method
								data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values)
								contentType: false,       // The content type used when sending data to the server.
								cache: false,             // To unable request pages to be cached
								processData:false,        // To send DOMDocument or non processed data file it is set to false
								success: function(data)   // A function to be called if request succeeds
								{
									alert(data);
									//window.location.href = '<?php echo base_url();?>admin/subcategory';
								//$("#tr"+sid+":first-child").text(data.subcat_name);
								//$("#respond").html(data);
								//$("#myModal").modal('toggle'); 
								//$("#cancelmodal").trigger("click");
								}
								});
		});
			
			
			
			
			
			
			$("#noprice").click(function(){
				$("#price").slideToggle();
				$("#pr").val(0);$("#offerpr").val(0);
			});
			$("#fileUpload").on('change', function() {

  if (typeof(FileReader) == "undefined") {
    alert("Your browser doesn't support HTML5, Please upgrade your browser");
  } else {

    var container = $("#image-container");

    //remove all previous selected files
    container.empty();

    //create instance of FileReader
    var reader = new FileReader();
    reader.onload = function(e) {
      $("<img />", {
        "src": e.target.result,"style": 'width:200px;'
      }).appendTo(container);
    }
    
    reader.readAsDataURL($(this)[0].files[0]);
  }});
			$(".cat").change(function(){
				var cid=$(this).val();
				$.ajax({
				 type: "POST",
				 url: '<?php echo base_url();?>home/ajax_showsubcat',
				 data: {cid:cid},
				 success: function(res){
				//alert(res);
				$(".subcat").html(res);
				}
				 }); 
			});
		});
	</script>
<div class="vd_content-wrapper">
      <div class="vd_container">
        <div class="vd_content clearfix">
          <div class="vd_head-section clearfix">
            <div class="vd_panel-header">
              <ul class="breadcrumb">
                <li><a href="<?php echo base_url();?>admin">Home</a> </li>
                <li class="active">Add/Edit Product</li>
              </ul>
              
 
            </div>
          </div>
          <!-- vd_head-section -->
          <div class="modal fade" id="myModal" role="dialog">
            <div class="modal-dialog modal-sm">
              <!-- Modal content-->
              <div class="modal-content">
                <div class="modal-header vd_bg-blue vd_white">
                  <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
                  <h4 class="modal-title" id="myModalLabel">Update Variants</h4>
                </div>
                <div class="modal-body">
                  <form action="" method="post" enctype="multipart/form-data" id="updateform">
                  <input type="hidden" id="zid" name="zid" value="" />
                  <div class="row">
                      <div class="form-group col-md-6">
                        <label for="email">Width</label>
                        <input type="text"  class="form-control" name="width" id="width">
                      </div>
                      <div class="form-group col-md-6">
                        <label for="email">Height</label>
                        <input type="text"  class="form-control" name="height" id="height">
                      </div>
                  </div>
                  <div class="form-group">
                    <label for="email">Stitch Count</label>
                    <input type="text"  class="form-control" name="stitch" id="stitch">
                  </div>
                  <div class="form-group">
                    <label for="email">Price</label>
                    <input type="text"  class="form-control" name="price" id="price">
                  </div>
                  <div class="form-group">
                    <label for="email">Zip</label>
                    <input type="file"  class="form-control" name="img" id="zip">
                    <input type="hidden" name="oldzip" id="oldzip" /> 
                    <input type="hidden" name="exts" id="exts" /> 
                  </div>
                  <br/>
                  <button type="submit" class="btn btn-primary" name="submit">Update</button>
                  <button type="button" class="btn btn-default" data-dismiss="modal" id="cancelmodal">Cancel</button>
                </form>
                
                </div>
                
              </div>
              
            </div>
  		</div>
          <div class="vd_title-section clearfix">
            <div class="vd_panel-header">
              <h1>Add/Edit Product</h1>
              
<!-- vd_panel-menu --> 
            </div>
            <!-- vd_panel-header --> 
          </div>
          <!-- vd_title-section -->
          
          <div class="vd_content-section clearfix">
           <?php if($this->uri->segment(3)){$colors=explode(",",$pro->sizes);?>
           <form action="<?php echo base_url();?>admin/edit_product_submit" method="post" enctype="multipart/form-data">
           <input type="hidden" name="proid" value="<?php echo $this->uri->segment(3);?>"/>
                    <div class="col-md-10 col-md-offset-1" style="background:#FFF; padding:5px;">
                    <?php if($this->session->flashdata("msg")!==""){echo $this->session->flashdata("msg"); }?>
                    <ul class="nav nav-tabs">
                      <li class="active"><a href="#tab21" data-toggle="tab"><strong>Product Info</strong></a></li>
                      <li><a href="#tab22" data-toggle="tab"><strong>Seo Details</strong></a></li>
                      <li class="pull-right">
                      <button class="btn btn-success" type="submit">Update Product</button></li>                      
                    </ul>
                    <div class="tab-content  mgbt-xs-20">
                      <div class="tab-pane active col-md-10" id="tab21"><br/>
                      	<div class="row">
                          <div class="col-md-8">
                          <div class="row">
                          	<div class="form-group col-md-6">
                                <label for="email">Select Category</label>
                                <select class="cat form-control" name="cat" id="cat">
                                                <option value="">Select Category</option>
                                                <?php foreach($cats as $cat){?>
                        <option <?php if($pro->cid==$cat->cid){echo 'selected';}?> value="<?php echo $cat->cid;?>"><?php echo $cat->cat_name;?></option>
                                                <?php }?>
                                            </select>
                            
                            </div>
                            <div class="form-group col-md-6">
                                <label for="pwd">Select Subcategory</label>
                               <select class="subcat form-control" id="subcat" name="subcat">
                                                 <?php $subc=$this->db->get_where("subcategory",array("cid"=>$pro->cid))->result();
												 		foreach($subc as $sub){?>
                        <option value="<?php echo $sub->sid;?>" <?php if($pro->sid==$sub->sid){echo 'selected';}?>><?php echo $sub->subcat_name;?></option><?php }?>
                                            </select>
                            </div> 
                            </div>
							<div class="row">
                                <div class="form-group col-md-7">
                                    <label for="pwd">Title</label>
                                    <input type="text" name="title" value="<?php echo $pro->title;?>" class="form-control" required>
                                </div>
                                <div class="col-md-5">
                                 <label for="pwd">For Gender</label>
                                    <div class="vd_radio radio-success">
                                <input type="radio" name="gender" id="optionsRadios3" value="Male" <?php if($pro->gender=="Male"){echo "checked";}?>>
                                <label  for="optionsRadios3"> Male </label>
                                <input type="radio" name="gender" id="optionsRadios4" <?php if($pro->gender=="Female"){echo "checked";}?> value="Female">
                                <label  for="optionsRadios4"> Female </label>
                                <input type="radio" name="gender" id="optionsRadios5" <?php if($pro->gender=="Both"){echo "checked";}?> value="Both">
                                <label  for="optionsRadios5"> Both </label>
                                    </div>
                                 </div>
                                </div>
                                <div class="row">
                                	<div class="col-md-4">
                                    	<label for="price">Price</label>
                                        <input type="number" class="form-control" required name="price" value="<?php echo $pro->price;?>"  />
                                    </div>
                                    <div class="col-md-4">
                                    	<label for="price">Offer Price</label>
                                        <input type="number" class="form-control" name="oprice" value="<?php echo $pro->oprice;?>" />
                                    </div>
                                    <div class="col-md-4">
                                    	<label for="price">Quantity</label>
                                        <input type="number" class="form-control" name="qty" value="<?php echo $pro->qty;?>"/>
                                    </div>
                                </div>	
                                
                          
                          <div class="vd_checkbox checkbox-danger">
                          <h4>Choose Sizes</h4>
        <input type="checkbox" value="S" name="sizes[]" id="checkbox-s" <?php if(in_array("S",$colors)){echo "checked";}?> >
        <label for="checkbox-s"> S </label>
        <input type="checkbox" value="M" name="sizes[]" id="checkbox-m" <?php if(in_array("M",$colors)){echo "checked";}?> >
        <label for="checkbox-m"> M  </label>
        <input type="checkbox" value="L" name="sizes[]" id="checkbox-l" <?php if(in_array("L",$colors)){echo "checked";}?>>
        <label for="checkbox-l"> L  </label>
        <input type="checkbox" value="XL" name="sizes[]" id="checkbox-xl" <?php if(in_array("XL",$colors)){echo "checked";}?>>
        <label for="checkbox-xl"> XL  </label>
         <input type="checkbox" value="XXL" name="sizes[]" id="checkbox-xxl" <?php if(in_array("XXL",$colors)){echo "checked";}?>>
        <label for="checkbox-xxl"> XXL  </label>
        <br/>
        <?php for($i=20;$i<=50;$i++){?>
         <input type="checkbox" value="10" name="sizes[]" id="checkbox-<?php echo $i;?>" <?php if(in_array($i,$colors)){echo "checked";}?> >
        <label for="checkbox-<?php echo $i;?>"> <?php echo $i;?> </label>
        <?php }?>
                          </div>
                          <div class="row">
                          <input type="hidden" name="oldcols" value="<?php echo $pro->gallery;?>" id="oldcols" />
                          <input type="hidden" name="oldcolor" value="<?php echo $pro->colors;?>" id="oldcolor" />
            				<div class="col-md-12"><h5 class="text-center text-warning">Add Colors</h5>
                <table class="table table-condense">
                <tr><th>ColorName</th><th>Image</th><th>Remove</th></tr>
                <?php $i=0;$cols=explode(",",$pro->gallery);$color=explode(",",$pro->colors);
											foreach($cols as $col){?>
   <tr><td><input id="action_name" value="<?php echo $color[$i];?>" name="colors[]" type="text" placeholder="" class="form-control input-md"></td><td width="100px"><img src="<?php echo base_url();?>assets/images/products/<?php echo $col;?>" alt=""></td>
   <td><a class="btn btn-xs btn-danger removecols" id="<?php echo $pro->pid;?>" href="<?php echo $col.'|'.$color[$i];?>">remove</a></td></tr>
                                            <?php $i++;}?>
                </table>
                
                <div id="field">
                <div id="field0">
<div class="form-group">
  <label class="col-md-4 control-label" for="action_name">Color Name</label>  
  <div class="col-md-5">
  <input id="action_name" name="colors[]" type="text" placeholder="" class="form-control input-md">
    
  </div>
</div>
<br><br>
       <!-- File Button --> 
<div class="form-group">
  <label class="col-md-4 control-label" for="action_json">Image</label>
  <div class="col-md-4">
              <input type="file" id="action_json" name="test1[]" class="input-file">
     <div id="action_jsondisplay"></div>
  </div>
</div>

</div>
</div>
<!-- Button -->
<div class="form-group">
  <div class="col-md-4">
    <button id="add-more" name="add-more" class="btn btn-primary">Add More</button>
  </div>
</div>
<br><br>
              
            </div>
                          </div>
                          
                          <div class="row">
                                	<div class="col-md-12">
                                    
                                    	<label for="price">Extra Images (Upload Size Chart, BackSide Image and Other)</label>
                            <input type="file" class="form-control" id="tg-photogallery"  onchange="preview_images();" name="test11[]"  multiple />
                            <input type="hidden" name="oldimgs" value="<?php echo $pro->extimgs;?>" id="oldimgs" />
                            			<div class="row">
                                            <?php $imgs=explode(",",$pro->extimgs);
											foreach($imgs as $img){?>
                                            <div class="col-md-3 text-center">
                                            <img src="<?php echo base_url();?>assets/images/products/<?php echo $img;?>" alt="">
                           <a class="btn btn-xs btn-danger removeimg" id="<?php echo $pro->pid;?>" href="<?php echo $img;?>">remove</a></div>
                                            <?php }?>
                                            </div>
                                        <div class="row" id="image_preview"></div>
                                    </div>
                                </div>
                          <!--<table class="table table-condensed">
                          	<thead><tr><th>Color Name</th><th></th>
                          </table>-->
                          
                          <!--<div class="row">
            						<div class="col-md-12"><h5 class="text-center text-warning">Add Colors</h5>
                
                <div id="field">
                <div id="field0">
<div class="form-group">
  <label class="col-md-4 control-label" for="action_name">Color Name</label>  
  <div class="col-md-5">
  <input id="action_name" name="colors[]" type="text" placeholder="" class="form-control input-md">
    
  </div>
</div>
<br><br>
      
<div class="form-group">
  <label class="col-md-4 control-label" for="action_json">Image</label>
  <div class="col-md-4">
              <input type="file" id="action_json" name="test1[]" class="input-file">
     <div id="action_jsondisplay"></div>
  </div>
</div>

</div>
</div>
<div class="form-group">
  <div class="col-md-4">
    <button id="add-more" name="add-more" class="btn btn-primary">Add More</button>
  </div>
</div>
<br><br>
              
            </div>
                                </div>-->
                          		
                          </div>
                          <div class="form-group col-md-4">
                            <div class="form-group">
                                <label for="image">Upload Preview Image</label>
                                <input type="file" class="form-control" id="fileUpload" name="profile_img"  />
                                <input type="hidden" name="oldimg" value="<?php echo $pro->img;?>" />
                                <div class="form-group" id="image-container">
                               <img class="img img-responsive" src="<?php echo base_url();?>assets/images/products/<?php echo $pro->img;?>" /> 
                                        </div>
                              
                               </div>
                                <label for="image">Product Tags</label>
                               <input id="input-autocomplete"  type="text" class="tags" value="<?php echo $pro->tags;?>" name="tags" placeholder="Add tags and hit Enter" /> 
                                <label for="image">Short Description</label>
                               <textarea rows="5" class="form-control" name="sdesc"><?php echo $pro->sdesc;?></textarea>
                          </div>
                         </div>
                          
                      </div>
                      <div class="tab-pane col-md-10" id="tab22"><br/>
                            <div class="form-group">
                                <label class="control-label">Meta Title</label>
                                <input type="text" required name="meta_title" value="<?php echo $pro->meta_title;?>" class="form-control">
                            </div>   
                            <div class="form-group">
                                <label class="control-label">Meta Keywords</label>
                                <textarea class="form-control" rows="2" value="<?php echo $pro->meta_key;?>" name="meta_key"></textarea>
                            </div>
                            <div class="form-group">
                                <label class="control-label">Meta Description</label>
                                <textarea class="form-control" rows="5" name="meta_desc"><?php echo $pro->meta_desc;?></textarea>
                            </div>
                            <div class="form-group">
                                <label class="control-label">Og:Title</label>
                                <input type="text" name="og_title" value="<?php echo $pro->og_title;?>" class="form-control">
                            </div>
                            <div class="form-group">
                                <label class="control-label">Og:Description</label>
                                <textarea class="form-control" rows="4" value="<?php echo $pro->og_desc;?>" name="og_desc"></textarea>
                            </div>
                      </div>
                      <div class="tab-pane" id="tab23"> Tab 3 </div>
                    </div>
                    </div></form>
           
           <?php }else{?>
          <form action="<?php echo base_url();?>admin/add_product_submit" method="post" enctype="multipart/form-data">
                    <div class="col-md-10 col-md-offset-1" style="background:#FFF; padding:5px;">
                    <?php if($this->session->flashdata("msg")!==""){echo $this->session->flashdata("msg"); }?>
                    <ul class="nav nav-tabs">
                      <li class="active"><a href="#tab21" data-toggle="tab"><strong>Product Info</strong></a></li>
                      <li><a href="#tab22" data-toggle="tab"><strong>Seo Details</strong></a></li>
                      <li class="pull-right">
                      <button class="btn btn-success" type="submit">Add Product</button></li>
                      
                    </ul>
                    <div class="tab-content  mgbt-xs-20">
                      <div class="tab-pane active col-md-10" id="tab21"><br/>
                      	<div class="row">
                          <div class="col-md-8">
                          <div class="row">
                          	<div class="form-group col-md-6">
                                <label for="email">Select Category</label>
                                <select class="cat form-control" name="cat" id="cat" required>
                                    <option value="">Select Category</option>
                                    <?php foreach($cats as $cat){?>
                                    <option value="<?php echo $cat->cid;?>"><?php echo $cat->cat_name;?></option>
                                    <?php }?>
                                </select>
                            </div>
                            <div class="form-group col-md-6">
                                <label for="pwd">Select Subcategory</label>
                                <select class="subcat form-control" id="subcat" name="subcat" required>
                                    <option value="">Select Subcategory</option>
                                </select>
                            </div> 
                            </div>
							<div class="row">
                                <div class="form-group col-md-7">
                                    <label for="pwd">Title</label>
                                    <input type="text" name="title" class="form-control" required>
                                </div>
                                <div class="col-md-5">
                                 <label for="pwd">For Gender</label>
                                    <div class="vd_radio radio-success">
                                    <input type="radio" name="gender" id="optionsRadios3" value="Male" checked>
                                    <label  for="optionsRadios3"> Male </label>
                                    <input type="radio" name="gender" id="optionsRadios4" value="Female">
                                    <label  for="optionsRadios4"> Female </label>
                                    <input type="radio" name="gender" id="optionsRadios5" value="Both">
                                	<label  for="optionsRadios5"> Both </label>
                                    
                                    </div>
                                 </div>
                                </div>
                                <div class="row">
                                	<div class="col-md-4">
                                    	<label for="price">Price</label>
                                        <input type="number" class="form-control" required name="price"  />
                                    </div>
                                    <div class="col-md-4">
                                    	<label for="price">Offer Price</label>
                                        <input type="number" class="form-control" name="oprice" />
                                    </div>
                                     <div class="col-md-4">
                                    	<label for="price">Quantity</label>
                                        <input type="number" class="form-control" name="qty" />
                                    </div>
                                </div>                                                                	
      	                  <div class="vd_checkbox checkbox-danger">
                          <h4>Choose Sizes</h4>
                                <input type="checkbox" value="S" name="sizes[]" id="checkbox-s">
                                <label for="checkbox-s"> S </label>
                                <input type="checkbox" value="M" name="sizes[]" id="checkbox-m">
                                <label for="checkbox-m"> M  </label>
                                <input type="checkbox" value="L" name="sizes[]" id="checkbox-l">
                                <label for="checkbox-l"> L  </label>
                                <input type="checkbox" value="XL" name="sizes[]" id="checkbox-xl">
                                <label for="checkbox-xl"> XL  </label>
                                <input type="checkbox" value="XXL" name="sizes[]" id="checkbox-xxl">
                                <label for="checkbox-xxl"> XXL  </label>
                                
                                <br/>
        <?php for($i=20;$i<=50;$i++){?>
         <input type="checkbox" value="10" name="sizes[]" id="checkbox-<?php echo $i;?>">
        <label for="checkbox-<?php echo $i;?>"> <?php echo $i;?> </label>
        <?php }?>
                          </div>
                          
                          
                          
                          
                          <div class="row">
                                <div class="col-md-12">
                                 
                            <div class="row" style="border:2px solid #CCC;">
            				<div class="col-md-12"><h5 class="text-center text-warning">Add Colors</h5>
                
                <div id="field">
                <div id="field0">
<div class="form-group">
  <label class="col-md-4 control-label" for="action_name">Color Name</label>  
  <div class="col-md-5">
  <input id="action_name" name="colors[]" type="text" placeholder="" class="form-control input-md">
    
  </div>
</div>
<br><br>
       <!-- File Button --> 
<div class="form-group">
  <label class="col-md-4 control-label" for="action_json">Image</label>
  <div class="col-md-4">
              <input type="file" id="action_json" name="test1[]" class="input-file">
     <div id="action_jsondisplay"></div>
  </div>
</div>

</div>
</div>
<!-- Button -->
<div class="form-group">
  <div class="col-md-4">
    <button id="add-more" name="add-more" class="btn btn-primary">Add More</button>
  </div>
</div>
<br><br>
              
            </div>
                          </div>      
                           <label for="price">Extra Images (Upload Size Chart, BackSide Image and Other)</label>
                                  <input type="file" class="form-control" id="tg-photogallery"  onchange="preview_images();" name="test11[]"  multiple />
                                  
                          <div class="row" id="image_preview"></div>
                                </div>
                            </div>
                        <!--<div class="row">
                            <div class="col-md-12">
                                <label for="price">Gallery Images</label>
                              <input type="file" class="form-control" id="tg-photogallery"  onchange="preview_images();" name="test1[]"  multiple />
                                <div class="row" id="image_preview"></div>
                            </div>
                        </div>-->
                          </div>
                          <div class="form-group col-md-4">
                            <div class="form-group">
                                <label for="image">Upload Preview Image</label>
                                <input type="file" class="form-control" id="fileUpload" name="profile_img"  />
                                <div class="form-group" id="image-container">
                               <img class="img img-responsive" src="<?php echo base_url();?>assets/images/products/default.jpg" /> 
                                        </div>
                              
                               </div>
                               <label for="image">Product Tags</label>
                               <input id="input-autocomplete"  type="text" class="tags" name="tags" placeholder="Add tags and hit Enter" /> 
                                <label for="image">Short Description</label>
                               <textarea rows="5" class="form-control" name="sdesc"></textarea>
                          </div>
                         </div>
                          
                      </div>
                      <div class="tab-pane col-md-10" id="tab22"><br/>
                            <div class="form-group">
                                <label class="control-label">Meta Title</label>
                                <input type="text" required name="meta_title" class="form-control">
                            </div>   
                            <div class="form-group">
                                <label class="control-label">Meta Keywords</label>
                                <textarea class="form-control" rows="2" name="meta_key"></textarea>
                            </div>
                            <div class="form-group">
                                <label class="control-label">Meta Description</label>
                                <textarea class="form-control" rows="5" name="meta_desc"></textarea>
                            </div>
                            <div class="form-group">
                                <label class="control-label">Og:Title</label>
                                <input type="text" name="og_title" class="form-control">
                            </div>
                            <div class="form-group">
                                <label class="control-label">Og:Description</label>
                                <textarea class="form-control" rows="4" name="og_desc"></textarea>
                            </div>
                      </div>
                      <div class="tab-pane" id="tab23"> Tab 3 </div>
                    </div>
                    </div></form>
           <?php }?>
          </div>
          <!-- .vd_content-section --> 
          
        </div>
        <!-- .vd_content --> 
      </div>
      <!-- .vd_container --> 
    </div>
    <!-- .vd_content-wrapper --> 
    
    <!-- Middle Content End --> 
    
  </div>
  <!-- .container --> 
</div>
<!-- .content -->

<!-- Footer Start -->
  <footer class="footer-1"  id="footer">      
    <div class="vd_bottom ">
        <div class="container">
            <div class="row">
              <div class=" col-xs-12">
                <div class="copyright">
                  	Copyright &copy;2018 YaaraIndia. All Rights Reserved 
                </div>
              </div>
            </div><!-- row -->
        </div><!-- container -->
    </div>
  </footer>
<!-- Footer END -->
  

</div>

<!-- .vd_body END  -->
<a id="back-top" href="#" data-action="backtop" class="vd_back-top visible"> <i class="fa  fa-angle-up"> </i> </a>

<!--
<a class="back-top" href="#" id="back-top"> <i class="icon-chevron-up icon-white"> </i> </a> -->

<!-- Javascript =============================================== --> 
<!-- Placed at the end of the document so the pages load faster --> 

<script type="text/javascript" src='<?php echo base_url();?>adminassets/plugins/jquery-ui/jquery-ui.custom.min.js'></script>
<script>
$(".removeimg").click(function(e){e.preventDefault();
				var img=$(this).attr("href");
				var aid=$(this).attr("id");
				var oldimgs=$("#oldimgs").val();
				$(this).closest("div.text-center").remove();
				$.ajax({
				 type: "POST",
				 url: '<?php echo base_url();?>admin/ajax_remove_imgs',
				 data: {aid:aid,img:img,oldimgs:oldimgs},
				 success: function(res){
				 $("#oldimgs").val(res);
				}
				 }); 
			});
			$(".removecols").click(function(e){e.preventDefault();
				var aid=$(this).attr("id");
				var oldcols=$("#oldcols").val();
				var oldcolor=$("#oldcolor").val();
				var old=$(this).attr("href");
				//alert(oldcols);alert(oldcolor);return false;
				$(this).closest("tr").remove();
				$.ajax({
				 type: "POST",
				 url: '<?php echo base_url();?>admin/ajax_remove_colors',
				 data: {aid:aid,oldcols:oldcols,oldcolor:oldcolor,old:old},
				 success: function(res){
					 alert(res);
					var r=res.split('|');
					var r1=r[0];//alert(r[0]);alert(r[1]); 
					alert(r1);
				    $("#oldcols").val(r1);
				// $("#oldcolor").val(r[1]);
				}
				 }); 
			});
</script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/jquery-ui-touch-punch/jquery.ui.touch-punch.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/js/caroufredsel.js"></script> 
<script type="text/javascript" src="<?php echo base_url();?>adminassets/js/plugins.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/breakpoints/breakpoints.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/dataTables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/prettyPhoto-plugin/js/jquery.prettyPhoto.js"></script> 
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/tagsInput/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/mCustomScrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/tagsInput/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/bootstrap-switch/bootstrap-switch.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/blockUI/jquery.blockUI.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/pnotify/js/jquery.pnotify.min.js"></script>
<script type="text/javascript">
function preview_images() 
{
	$('#image_preview').html('');
 var total_file=document.getElementById("tg-photogallery").files.length;
 for(var i=0;i<total_file;i++)
 {
  $('#image_preview').append("<div class='col-md-4'><img class='img-responsive' src='"+URL.createObjectURL(event.target.files[i])+"'></div>");
 }
}

$(window).load(function() 
{$('#input-autocomplete').tagsInput({
		width: 'auto',

	});
})
</script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/js/theme.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/custom/custom.js"></script>


</body>
</html>