
<!DOCTYPE html>

<?php 
	session_start();
	@ob_start();
	include "../../config/database.php";


	


?>
<html>

  <body class="hold-transition skin-blue sidebar-mini layout-boxed">
                  <h3 class="box-title"><center>Data Customer</center></h3><br>
				  <?php					
					header("Content-type: application/vnd-ms-excel");
					header("Content-Disposition: attachment; filename=Laporan-Customer.xls");
					?>
                  <table id="example1" class="table table-bordered table-striped" border="1">
                    <thead>
                      <tr>
						<th>First Name</th>						
						<th>Last Name</th>	
						<th>Email Address</th>		
						<th>Mobile Phone</th>								
						<th>Company</th>	
                      </tr>
                    </thead>
                    <tbody>
					<?php
						$query = mysqli_query($mysqli, "SELECT * FROM customer where status='Y' ORDER BY name asc")
                                            or die('Ada kesalahan pada query tampil: '.mysqli_error($mysqli));

						// tampilkan data
						while ($data = mysqli_fetch_assoc($query)) 
						{	
							echo "<tr>";
							echo "<td>".$data['name']."</td>";
							echo "<td></td>";	
							echo "<td></td>";
							echo "<td>".$data['hp']."</td>";
							echo "<td></td>";
							echo "</tr>";
						}
					?>
                        
                     
                    </table>
                </div><!-- /.row -->
  </body>
</html>
<?php 

	echo "<script>window.close();</script>";

?>