<?php
	$filename = 'Refill Sale Data'. date('Y_m_d_h_i_s') .".xls";
	header("Content-type: application/octet-stream");
	header("Content-Disposition: attachment; filename=\"$filename\"");
	header("Content-Type: application/xls");
?>
<!-- <div class="">
                                    <div><b>Searched Results</b></div>
                                    
                                    <?php if($customer_name_hidden!=""){?>
                                    <div class="form-group">  
                                        <label class="col-sm-5 control-label" for="form-field-2" ><?php echo 'Customer name:';?> <?php echo $customer_name_hidden;?></label>
                                    </div>
                                    <?php }
                                     if($dispenser_name_hidden!=""){?>
                                    <div class="form-group">  
                                        <label class="col-sm-5 control-label" for="form-field-2" ><?php echo 'Dispenser Name:';?> <?php echo $dispenser_name_hidden;?></label>
                                    </div>
                                  <?php } ?>
                                  
                                     
                                     
</div>  --><!-- 
                                <br>
                                <br>  -->
 <div class="col-xs-12">

      <section class="panel panel-default">
        <header class="panel-heading bg-info lt font-bold">List of Refill Sale Data
     
    </header>
        <div class="panel-body bs-example form-horizontal">
          <div class="table-responsive">
            <table id="example" class="table table-bordered" cellspacing="0" width="100%">
              <thead>
        <tr>
          <th>Sr No</th>
          <th>Customer Name</th>
          <th>Sales Person Name</th>
          <th>Dispenser Name</th>
          <th>Refill Name</th>
          <th>Dispenser Quantity</th>
          <th>Location</th>
          <th>Sales Type</th>
          <th>Installation Date</th>
          <th>Refill Date</th>
          <th>Refill Due Date</th>
          <th>Refill Duration</th>
          <th>Comments</th>
                         
        </tr> 
      </thead>
      <tbody>  
      
       <?php 
       $srno=1;
       $count=count($excel_data);  
       foreach ($excel_data as  $value) {
         $customer_name=$value['customer_name'];
         $sale_person_name=$value['first_name']." ".$value['last_name'];
         $dispenser=$value['dispenser'];
         $dispenser_name=$value['dispenser_name'];
         $product_name=$value['product_name'];
         $dispenser_quantity=$value['dispenser_quantity'];
         $refill_location=$value['refill_location'];
         $sales_type=$value['sales_type'];
         $installation_date=$value['installation_date'];
         $refill_date=$value['refill_date'];
         $next_refill_date=$value['next_refill_date'];
         $duration_days=$value['duration_days'];
         $comments=$value['comments'];
       ?>     
        <tr>
          <td style="text-align: center;"><?php echo $srno; ?></td>
          <td style="text-align: center;"><?php echo $customer_name;?></td>
          <td style="text-align: center;"><?php echo $sale_person_name;?></td>  
          <td style="text-align: center;"><?php echo $dispenser;?></td>
          <td style="text-align: center;"><?php echo $product_name;?></td>
          <td style="text-align: center;"><?php echo $dispenser_quantity;?></td>
          <td style="text-align: center;"><?php echo $refill_location;?></td>  
          <td style="text-align: center;"><?php echo $sales_type;?></td>
          <td style="text-align: center;"><?php echo $installation_date;?></td>
          <td style="text-align: center;"><?php echo $refill_date;?></td>
          <td style="text-align: center;"><?php echo $next_refill_date;?></td>  
          <td style="text-align: center;"><?php echo $duration_days;?></td>
          <td style="text-align: center;"><?php echo $comments;?></td>
        </tr> 
        <?php 
         $srno=$srno+1;
       }
        ?>
        </tbody>
            </table>
          </div>
        </div>
      </section>
	</div>
