<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >

<!-- update product form start -->
<div class="row">
    <div class="col-md-6 margin-bottom-30">
        <div class="hs_heading medium">
            <h3>Update Products</h3>
        </div>
	  <form id="updateproduct" enctype="multipart/form-data">
	  <input type="hidden" name="old_prod_id" id="old_prod_id" value="<?php if(isset($productdeatils)){ echo $productdeatils[0]->prod_id; } ?>" >
		<div class="hs_input">
		<div class="hs_input">
            <label>Product Name</label>
            <input type="text" value="<?php if(isset($productdeatils)){ echo $productdeatils[0]->prod_name; } ?>"  class="form-control" placeholder="Name" name="p_name" id="p_name">
        </div>
        
        <div class="hs_input">
            <label>Products Category</label>
            <select class="form-control" name="p_category" id="p_category">
		       <option value="0">Select Category</option>
			   <?php if(!empty($category)){  foreach($category as $cate){ ?>
				<option value="<?php echo $cate->category_id; ?>"  <?php if( $productdeatils[0]->prod_cateid == $cate->category_id ){ echo "selected"; } ?>   ><?php echo $cate->category_name;?></option>
			<?php 
			   }
			  }
			?>
                
            </select>
        </div>
		<div class="hs_input">
            <label>Quantity</label>
             <input type="text" value="<?php if(isset($productdeatils)){ echo $productdeatils[0]->prod_quantity; }?>" class="form-control" placeholder="Quantity" name="p_quantity" id="p_quantity" min="1"> 
			 <span>If remaining blank,product quantity will be unlimited</span>
        </div>
        <div class="hs_input">
            <label>Description</label>
            <textarea rows="4" class="form-control" placeholder="Description" id="p_description" name="p_description"><?php if(isset($productdeatils)){ echo $productdeatils[0]->prod_description; }?></textarea>
        </div>
		<div class="hs_input">
            <label>Long Description</label>
            <textarea rows="10" class="form-control" placeholder="Description" id="p_longdescription" name="p_longdescription"><?php if(isset($productdeatils)){ echo $productdeatils[0]->prod_longdescription; }?></textarea>
        </div>
		<div class="hs_input">
            <label for="exampleInputFile">Add Image</label>
            <input type="file" id="exampleInputFile" class="form-control" name="prod_image">
        </div>
		<div class="hs_input">
            <label>Price</label>
            <input type="text" value="<?php if(isset($productdeatils)){ echo $productdeatils[0]->prod_price; }?>" class="form-control" placeholder="Price" id="p_price" name="p_price">
        </div>
	    <button type="submit"  class="btn">Update</button>
	 </form>
    </div>
</div>
<!-- update product form end -->
 