<!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header mb_10">
      <h1>Item Unit</h1>
    </section>

    <!-- Main content -->
    <section class="content">
		<div class="row">			
			<div class="col-lg-12 mb_20">
			<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#AddItemUnit" id="ItemCreateItemBtn" data-backdrop="static" data-keyboard="false"> 
					Add Unit
			</button>
			</div>
		</div>
		<div class="modal fade" id="AddItemUnit">
          <div class="modal-dialog modal-lg">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close mfwPopUpClose" data-dismiss="modal" aria-label="Close">
                  <i class="fa fa-remove"></i></button>
                <h4 class="modal-title">Item Unit Details</h4>
              </div>
              <div class="modal-body"> 
					  <div class="row">
						<form role="form" id="hdlItemUnitForm" data-target="dashboard/create_unit" method="post">
						  <div class="box-body">
						
							<div class="row">
								<div class="col-md-12"> 							
									<div class="form-group">
									  <label for="UnitName">Unit Name</label>
									 <input type ="hidden" id="farm_action" value="dashboard/create_unit">
									  <input type="text" class="form-control" id="UnitName" name="UnitName" placeholder="Unit Name" required autocomplete="off">
									</div>
								</div>
							</div>
							 
						  </div>
						  <!-- /.box-body -->
 
						  <div class="box-footer text-center">
						    <input type="hidden" id="ItemUnitId" name="ItemUnitId">
							<button type="submit" class="btn btn-primary" id="CreateItemUnit">Submit</button>
						  </div>
						</form>  
						</div> 
                 
              </div> 
              
            </div>
            <!-- /.modal-content -->
          </div>
          <!-- /.modal-dialog -->
        </div>
        <!-- /.modal -->
	
	<div class="row">
	<div class="col-lg-12">
		<div class="box wholeSaleWrapper">
            <div class="box-body">
			<div class="table-responsive">
              <table id="mfw_ItemsTable" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th>Sr No.</th>
                  <th>Unit Name</th>
                  <th>Action</th>
                  
                </tr>
                </thead>
                <tbody>
				<?php if(!empty($unitdetail)){
					$countItem = count($unitdetail);
					 $i = $countItem;
					 $a=1;
					foreach($unitdetail as $item){ 
				?>
                <tr>
                  <td><?php echo $a; ?></td>
					
					<td><?php if($item['unitName']){echo $item['unitName'];} ?></td>
					<td><button class="btn-primary icon_btn unit_edit_btn" data-id="<?php echo $item['unitId']; ?>" title="Edit"><i class="fa fa-pencil-square-o"></i></button>
					</td>
					
                </tr>
				<?php 
				$a++;
				$i--;
				}
				} ?> 
                </tbody>
                <tfoot> 
                <tr>
                  <th>Sr No.</th>
                  <th>Unit Name</th>
                  <th>Action</th>
                </tr>
                </tfoot> 
              </table>
            </div>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
		</div>
		</div>

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

