Initial commit

This commit is contained in:
admin
2011-03-29 21:51:22 +04:00
commit b5f9941788
422 changed files with 128744 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
<!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>
+68
View File
@@ -0,0 +1,68 @@
<style>
body, td {font: 14px Verdana;}
input {font: 18px Verdana;}
.header td {background-color: #444; color: white;}
.row td {background-color: #EEE;}
a {text-decoration: none; border-bottom: 1px dashed;}
.searches {position: absolute; left: 820px; top: 10px; line-height: 25px;}
</style>
<script>
function play(url) {
var player = document.getElementById('player');
player.setAttribute('src', url);
player.play();
return(false);
}
function exec_search(q) {
document.getElementById('search_field').setAttribute('value', q);
document.getElementById('search_form').submit();
return(false);
}
</script>
<form method="post" id="search_form">
<table cellspacing="1" cellpadding="10" border="0" style="width:800px;">
<tr class="header">
<td>
<b>Query</b>
</td>
<td style="width:100%;" align="center">
<input id="search_field" name="q" type"text" style="width:98%;" value="<?= (isset($_POST['q']) ? stripslashes($_POST['q']) : '') ?>"/>
</td>
<td>
<input type="submit" value="Search"/>
</td>
</tr>
<tr class="header">
<td colspan="3" align="center">
<audio id="player" controls preload></audio>
</td>
</tr>
</table>
</form>
<table cellspacing="1" cellpadding="10" border="0" style="width:800px;">
<? if (isset($_POST['q']) && count($files) > 0) { ?>
<tr class="header">
<? foreach (array_keys($files[0]) as $field) { ?>
<td align="center"><b><?= $field ?></b></td>
<? } ?>
</tr>
<? foreach ($files as $row) { ?>
<tr class="row">
<? foreach ($row as $field_name => $field) { ?>
<td><?= ( $field_name == 'url' ? '<a href="#" onclick="play(\''. $field .'\')">Play</a>' : $field) ?></td>
<? } ?>
</tr>
<? } ?>
<tr class="row"><td align="center" colspan="7">Query time: <?= number_format($t_end - $t_start, 4, '.', '') ?>s</td></tr>
<? } else { ?>
<tr class="row"><td align="center">No data</td></tr>
<? } ?>
</table>
<div class="searches">
<b>Parsed data:</b><br/>
<? foreach ($completed as $file) { $file = str_replace('.data', '', $file); ?>
<a href="#" onclick="exec_search('<?= $file ?>')"><?=$file?></a><br/>
<? } ?>
</div>