<?php

	require("ef8fds_sqlconnect.php");
	header("Content-type: application/vnd-ms-excel"); 
	header("Content-Disposition: attachment; filename=zoznam_melodii.xls");
	
	$query = "SELECT * FROM mobile_melody ORDER by ID ASC";
	$result = mysql_query($query);
	echo "<table>";
	while($row = mysql_fetch_assoc($result))
	{
		echo "<tr>\n";
		echo "	<td>".$row['interpret']."</td>\n";
		echo "	<td>".$row['nazov']."</td>\n";
		echo "	<td>ID: ".$row['ID']."</td>\n";
		echo "	<td>".round(filesize('melody/'.$row['file']) / 1024, 2)."kB</td>\n";
		echo "	<td>http://4mobile.sk/melodia/".$row['ID']."/</td>\n";
		echo "</tr>";
	}
	echo "</table>";
	
?>