<?php if($page_name!='data_entry_approval'){ ?>
<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 ">
        <div class="col-md-4">
          <?php if(!isset($list_type) || $list_type!="payable"){?>
            <div class="m-form__label">
              <label class="m-label m-label--single">
                Date:
              </label>
            </div>
            <div class="row">
              <div class="col-md-6">
                <div class="m-form__control">
                  <input value="<?php if($page_name=='delivery_challan_view'){ echo date('d-m-Y');}?>" data-date-format="dd-mm-yyyy" id="table_filter_delivery_challan_start_date" type="text"  class="form-control m-input table_filter  m-input--pill m-input--air" placeholder="Start Date" >
                </div>
              </div>
              <div class="col-md-6">
                <div class="m-form__control">
                  <input value="<?php if($page_name=='delivery_challan_view'){ echo date('d-m-Y');}?>" data-date-format="dd-mm-yyyy" id="table_filter_delivery_challan_end_date" type="text"  class="form-control m-input table_filter  m-input--pill m-input--air" placeholder="End Date" >
                </div>
              </div>
            </div>
          <?php } ?>
        </div>
        <?php if($page_name!='work_profile'){ ?>
        <div class="col-md-4">
          <div class="form-group m-form__group">
            <label>
              Order 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_delivery_challan_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>
        </div>
      <?php } ?>
      <?php if($page_name!='supplier_profile'){ ?>
        <div class="col-md-4">
          <div class="form-group m-form__group">
            <label>
              Supplier:
            </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_delivery_challan_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?></option>
                <?php
              endforeach;
              ?>
            </select>
          </div>
          <span class="m-form__help"></span>
        </div>
      </div>
    <?php } ?>
    </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="delivery_challan_view_table">
  <thead>
    <tr class="">
      <th>Sl No</th>
      <th>Challan ID</th>
      <th>Challan Date</th>
      <th>Challan No</th>
      <th>Delivery Date</th>
      <th>Supplier Name</th>
      <th>Order to Location</th>
      <th>Challan Details</th>
      <th>Order Details</th>
      <th>Bill Creation Status</th>
      <th>Creation</th>
      <th>Actions</th>
      <th>ID</th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>
