<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head>
		<title>Beat Heaven: <?= $artist['name'] ?></title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<style type="text/css">
			body, input { font-family: Georgia; }
			hr { border: none; border-bottom: #AAA 1px solid; }
			.album { margin: 1em 0 3em 0; width: 50em; }
			.album .album-title { font-size: 1.5em; }
			.duration, .year, .bonus { color: #AAA; }
			input { font-size: 2em; }
		</style>
	</head>
	<body>
		<form>
			<input type="text" name="q" value="<?= $q ?>"/>
		</form>
		<div class="albums">
			<? foreach($artist['albums'] as $album): if (count($album['tracks']) > 0): ?>
			<div class="album">
				<div class="album-title">
					<span class="name"><?= $album['name'] ?></span>
					<span class="year">(<?= $album['year'] ? $album['year'] : '?' ?>)</span>
				</div>
				<ol>
					<? foreach($album['tracks'] as $track): ?>
					<? $m = floor($track['duration'] / 60); $s = ($track['duration'] - ($m * 60)); $d = $m .':'. ($s < 10 ? '0' : ''). $s; ?>
					<li><?= $track['name'] ?> <span class="duration"><?= $d ?></span></li>
					<? endforeach; ?>
				</ol>
				<? if (count($album['bonus']) > 0): ?>
					<span class="bonus">Bonus:</span>
					<ol>
						<? foreach($album['bonus'] as $track): ?>
						<? $m = floor($track['duration'] / 60); $s = ($track['duration'] - ($m * 60)); $d = $m .':'. ($s < 10 ? '0' : ''). $s; ?>
						<li><?= $track['name'] ?> <span class="duration"><?= $d ?></span></li>
						<? endforeach; ?>
					</ol>
				<? endif; ?>
			</div>
			<? endif; endforeach; ?>
		</div>
	</body>
</html>
