<?php
	include '../../inc/inc.koneksi.php';	
	
	$cari = $_GET[cari];
	$jml = 0;
	$tgllap =date('d-m-Y');
		
	$content = "<b><li>DAFTAR KELOMPOK PERSEDIAAN</li>			
		<li>PER TANGGAL $tgllap</li></b>
		<br>
	
		<table width='390' border='1' style='border-collapse:collapse'>
		<tr>
			<th>No.</th>
			<th>Kode</th>
			<th>Nama Kelompok</th>
			<th>Kategori</th>
		</tr>";
	
		$sql	= "SELECT * FROM st_group ORDER BY kode_gr";		
		$query = mysql_query($sql);
		
		$no=1;
		while($r_data=mysql_fetch_array($query)){
		
		$content .= "<tr>	
				<td>$no</td>				
				<td>$r_data[kode_gr]</td>
				<td>$r_data[nama_gr]</td>
				<td>$r_data[kategori]</td>
			</tr>";
			$no++;
			$jml++;
		}
		$content .= "</table>";
		
		$content .= "<table>
			<tr>
				<td>Jumlah Data : $jml</td>
			</tr>
			</table>";
				
		header("Content-type: application/x-msdownload");
		header("Content-Disposition: attachment; filename=daftar_stgr.xls");
		header("Pragma: no-cache");
		header("Expires: 0");
		echo $content;
?>
