<?php
	error_reporting(1);
	ini_set('display_errors',true);
	ini_set('memory_limit', '256M');
	$filename = 'Customer Report'. 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");

    $cutomer_sale_person=$this->input->post('cutomer_sale_person');
    $customer_name=$this->input->post('customer_name');
    $cutomer_mobile=$this->input->post('cutomer_mobile');
    $cutomer_email=$this->input->post('cutomer_email');
    $cutomer_city=$this->input->post('cutomer_city');
    $branch_name=$this->input->post('branch_name');
    $cutomer_address=$this->input->post('cutomer_address');
	
?>
 <div class="col-xs-12">

      <section class="panel panel-default">
        <header class="panel-heading bg-info lt font-bold">List of Customers
     
    </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>Date of Enrollment</th>
          <th>Customer  Name</th>
          <th>Branch Company Name</th>
          <th>Customer PAN Number</th>
          <th>Customer GST Number</th>
          <th>Contact Contact Name</th>
          <th>Sales Person Name</th>
          <th>Address</th>
          <th>Country</th>
          <th>State</th>
          <th>City</th>
          <th>Postal Code</th>
          <th>Contact Mobile Number</th>
          <th>Contact Email Id</th> 
          <th>Designation</th>        
         
          
        </tr> 
      </thead>
      <tbody>  
       <?php 
       $srno=1;
       foreach ($customers as  $value) {
		  
         $customer_id=$value['customer_id'];
         $date_of_enrollment=$value['date_of_enrollment'];
         $customer_name=$value['customer_name'];
         $company_branch_name=$value['company_branch_name'];
         $customer_pan_no=$value['customer_pan_no'];
         $customer_gst_no=$value['customer_gst_no'];
         $contact_person_name=$value['contact_person_name'];
         $sale_person_name=$value['first_name']." ".$value['last_name'];
         $address=$value['address_line1'].$value['address_line2'];
         $country_name=$value['country_name'];
         $state_name=$value['state_name'];
         $city_name=$value['city_name'];
         $postal_code=$value['postal_code'];
         $mobile_no=$value['std_code'].$value['mobile_no'];
         $email_id=$value['email_id'];
         $designation=$value['designation'];
		  
       ?>     
        <tr>
          <td style="text-align: center;"><?php echo $srno; ?></td>
          <td style="text-align: center;"><?php echo $date_of_enrollment;?></td>
          <td style="text-align: center;"><?php echo $customer_name;?></td>  
          <td style="text-align: center;"><?php echo $company_branch_name;?></td>
          <td style="text-align: center;"><?php echo $customer_pan_no;?></td>
          <td style="text-align: center;"><?php echo $customer_gst_no;?></td> 
          <td style="text-align: center;"><?php echo $contact_person_name;?></td>
          <td style="text-align: center;"><?php echo $sale_person_name;?></td>
          <td style="text-align: center;"><?php echo $address;?></td>
          <td style="text-align: center;"><?php echo $country_name;?></td>
          <td style="text-align: center;"><?php echo $state_name;?></td>
          <td style="text-align: center;"><?php echo $city_name;?></td>
          <td style="text-align: center;"><?php echo $postal_code;?></td>
          <td style="text-align: center;"><?php echo $mobile_no;?></td>
          <td style="text-align: center;"><?php echo $email_id;?></td>
          <td style="text-align: center;"><?php echo $designation;?></td>
          
        
        </tr> 
        <?php
         $srno=$srno+1;
       }
         ?>
        </tbody>
            </table>
          </div>
        </div>
      </section>
	</div>
</div>
<div>
	<!-- /.page-row -->
    <!-- /.page-content --> 
</div>
<!-- /.main-content --> 
</div>
<!-- /#ace-settings-container --> 
</div>