<?php if($page_name!='data_entry_approval' && $page_name!='work_summary'){ ?>
<div class="m-form m-form--label-align-right m--margin-bottom-10">
  <div class="row align-items-center">
    <div class="col-xl-12 order-2 order-xl-1">
      <div class="form-group m-form__group row ">
        <?php if($page_name!='work_profile'){ ?>
        <div class="col-md-3" style="padding-right:5px">
          <div class="form-group m-form__group">
            <label >
              Date:
            </label>
            <input  id="table_filter_date_range"   type="text" class="form-control m-input m-input--air m-input--pill"  >

          </div>
        </div>
        <?php } ?>
        <div class="col-md-9" style="padding-left:10px">
          <div class="row">
            <div class="col-md-3" style="padding-right:5px;padding-left:5px">
              <?php if($page_name!='work_profile'){ ?>
              <div class="form-group m-form__group">
                <label>
                  Ordered to Location:
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select style="width: 100%" class="form-control m-select2 table_filter" id="table_filter_location"   data-placeholder="Select Work">
                    <option value="all">All Location</option>
                    <?php
                    foreach($stock_locations as $row):
                      $location_name = $row->location_name;
                      if($row->location_type=='work_site'){
                        $location_name .= " [Work Site]";
                      }elseif($row->location_type=='ware_house'){
                        $location_name .= " [Warehouse]";
                      }
                      ?>
                      <option data-work-status="<?php echo $row->work_status?>" value="<?php echo $row->location_id?>"><?php echo $location_name?></option>
                      <?php
                    endforeach;
                    ?>
                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            <?php } ?>
            </div>
            <div class="col-md-3" style="padding-right:5px;padding-left:5px">
              <div class="form-group m-form__group">
                <label>
                  Material Category:
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select style="width: 100%" class="form-control m-select2 table_filter" id="ordered_material_table_filter_material_category"  data-placeholder="Select Category">

                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-md-3" style="padding-right:5px;padding-left:5px">
              <div class="form-group m-form__group">
                <label>
                  Material:
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select style="width: 100%" class="form-control m-select2 table_filter" id="ordered_material_table_filter_material"  name="material" data-placeholder="Select Material">

                </select>
              </div>
              <span class="m-form__help"></span>
            </div>
          </div>
          <div class="col-md-3" style="padding-left:5px">
            <div class="form-group m-form__group">
              <label>
                Supplier:
              </label>
              <?php if(sizeof($supplier_categories)>0){?>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select style="width: 100%" class="form-control m-select2 table_filter" id="ordered_material_table_filter_supplier_category"  name="supplier_category" data-placeholder="Select Supplier Category">
                    <option value="all">All Categries</option>
                    <?php
                    foreach($supplier_categories as $row): ?>
                    <option value="<?php echo $row->sup_category_id?>"><?php echo $row->sup_category_name?></option>
                    <?php
                  endforeach;
                  ?>
                </select>
              </div>
          <?php } ?>
              <div class="m-select2 m-select2--air m-select2--pill">
                <select style="width: 100%" class="form-control m-select2 table_filter" id="ordered_material_table_filter_supplier"  name="supplier" data-placeholder="Select Supplier">
                  <option value="all">All Suppliers</option>
                  <?php
                  foreach($suppliers_list as $row): ?>
                  <option value="<?php echo $row->supplier_id?>"><?php echo $row->supplier_name?><?php if($row->sup_category_name!=''){ echo " (".$row->sup_category_name.")";}?></option>
                  <?php
                endforeach;
                ?>
              </select>
            </div>
            <span class="m-form__help"></span>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</div>
</div>
<?php } ?>
<table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="materials_ordered_view_table">
  <thead>
    <tr class="">
      <th>Sl No</th>
      <th>Order ID</th>
      <th>Order Date</th>
      <th>Supplier</th>
      <th>Material Name</th>
      <th>Item Code</th>
      <th>Ordered<br/>Quantity</th>
      <th>Billed<br/>Quantity</th>
      <th>Balance<br/>Quantity</th>
      <th>Unit</th>
      <th>Unit Price</th>
      <th><?php if($this->config->item('Tax_tax_splitting')==1){ echo "Total ";}?><?php echo $this->config->item('Tax_tax_name')?> %</th>
      <th><?php if($this->config->item('Tax_tax_splitting')==1){ echo "Total ";}?><?php echo $this->config->item('Tax_tax_name')?> Amt</th>
      <th><?php echo $this->config->item('Tax_tax1_name')?> %</th>
      <th><?php echo $this->config->item('Tax_tax1_name')?> Amt</th>
      <th><?php echo $this->config->item('Tax_tax2_name')?> %</th>
      <th><?php echo $this->config->item('Tax_tax2_name')?> Amt</th>
      <th><?php echo $this->config->item('Tax_tax3_name')?> %</th>
      <th><?php echo $this->config->item('Tax_tax3_name')?> Amt</th>
      <th>Total Amount<br/>(Without Tax)</th>
      <th>Total Amount<br/>(With Tax)</th>
      <th>Item Desc</th>
      <th>Order Remarks</th>
      <th>Created By</th>
      <th>Created Date</th>
      <th>Ordered to Location</th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>
