<div class="span9">
<form class="form-horizontal well" action="" method="POST" enctype="multipart/form-data">
        <fieldset>
          <legend>Post New Deal /Ad</legend>
          <!--<div class="control-group">
            <label for="input01" class="control-label">Text input</label>
            <div class="controls">
              <input type="text" id="input01" class="input-xlarge">
              <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
            </div>
          </div>
          <div class="control-group">
            <label for="optionsCheckbox" class="control-label">Checkbox</label>
            <div class="controls">
              <label class="checkbox">
                <input type="checkbox" value="option1" id="optionsCheckbox">
                Option one is this and that&mdash;be sure to include why it's great
              </label>
            </div>
          </div>-->
          <div class="control-group">
            <label for="select01" class="control-label">Category : </label>
            <div class="controls">
              <select id="category" name="category">
		<?php foreach($categories as $category) { ?>
			 <option value="<?php echo $category->id;?>"><?php echo $category->name;?></option>
			<?php if($this->categories_model->hasSubcategory($category->id) > 0 ){ 
				foreach($this->categories_model->getSubCategories($category->id) as $subcategory) { ?>
					<option value="<?php echo $subcategory->id;?>"><?php echo '&nbsp;&nbsp;'.$subcategory->name;?></option>
				<?php }
			 } ?>
		<?php } ?>
               
               
              </select>
            </div>
          </div>
          
	<div class="control-group">
            <label for="input01" class="control-label">Ad Title : </label>
            <div class="controls">
              <input type="text" id="title" name="title" class="input-xlarge">
              <p class="help-block">Ex: Heavy Discount on automobiles </p>
            </div>
          </div>
          <div class="control-group">
            <label for="textarea" class="control-label">Ad Description : </label>
            <div class="controls">
              <textarea rows="3" id="description" name="description" class="input-xlarge"></textarea>
            </div>
          </div>
	<div class="control-group">
            <label for="textarea" class="control-label">Price / Discounted Price : </label>
            <div class="controls">
              <input type="text" id="price" name="price" class="input">
            </div>
          </div>
	<div class="control-group">
            <label for="textarea" class="control-label">Original Price (if there is discount) : </label>
            <div class="controls">
              <input type="text" id="original_price" name="original_price" class="input">
            </div>
          </div>
	<div class="control-group">
            <label for="fileInput" class="control-label">Image : </label>
            <div class="controls">
              <input type="file" id="filename" name="filename" class="input-file">
            </div>
          </div>
         
          <div class="form-actions">
            <button class="btn btn-primary" type="submit">Submit</button>
            <button class="btn" type="reset">Cancel</button>
          </div>
        </fieldset>
      </form>
</div>
