{config_load file=$configfile section="search"}
{literal}
<script language="javascript" type="text/javascript">
function changePage(page){{/literal}
document.searchForm.page.value=page;
document.searchForm.method='post';
document.searchForm.action='modules.php?name={$module_name}&op={$op}';
document.searchForm.submit();
{literal}}
</script>
{/literal}
<div id="tm_module">
<div id="tm_title2">{#Results#}</div>
{if $what=="artists"}
{if $artistList!=""}
<table class="tm_list">
<thead>
<tr><td>{#Name#}</td><td>{#Years#}</td><td> </td></tr>
</thead>
<tbody>
{foreach item="artistO" from=$artistList}
<tr {cycle values="class=\"odd\","}>
<td>
{if !$easyURL}
<a href="modules.php?name={$module_name}&op=artist&idartist={$artistO->getId()}">
{elseif !$easyURLtype}
<a href="{$tm_BaseURL}/music.php/artist/{$artistO->getName()|urlencode}">
{elseif $easyURLtype==2}
<a href="artist{$artistO->getId()}.html">
{else}
<a href="{$tm_BaseURL}/music.php/artist/{$artistO->getId()}">
{/if}
{$artistO->getName()}</td>
<td>{$artistO->getBornyear()}
{if $artistO->getDeadyear()!=""}
- {$artistO->getDeadyear()}
{/if}
</td>
<td>
{if !$easyURL}
<a href="modules.php?name={$module_name}&op=artist&idartist={$artistO->getId()}">
{elseif !$easyURLtype}
<a href="{$tm_BaseURL}/music.php/artist/{$artistO->getName()|urlencode}">
{elseif $easyURLtype==2}
<a href="artist{$artistO->getId()}.html">
{else}
<a href="{$tm_BaseURL}/music.php/artist/{$artistO->getId()}">
{/if}
{#View#}</a></td>
</tr>
{assign var="num" value=$artistO->getCount()}
{/foreach}
</tbody>
<tfoot></tfoot>
</table>
{else}
{#No_results#}.
{/if}
{elseif $what=="albums"}
{if $albumList!=""}
<table class="tm_list">
<thead>
<tr><td>{#Title#}</td><td>{#Artist_Band#}</td><td>{#Year#}</td><td> </td></tr>
</thead>
<tbody>
{foreach item="albumO" from=$albumList}
<tr {cycle values="class=\"odd\","}>
<td>
{if !$easyURL}
<a href="modules.php?name={$module_name}&op=album&idartist={$albumO->getIdartist()}&idalbum={$albumO->getId()}">
{elseif !$easyURLtype}
<a href="{$tm_BaseURL}/music.php/artist/{$albumO->getArtistname()|urlencode}/album/{$albumO->getTitle()|urlencode}">
{elseif $easyURLtype==2}
<a href="album{$albumO->getIdartist()}_{$albumO->getId()}.html">
{else}
<a href="{$tm_BaseURL}/music.php/artist/{$albumO->getIdartist()}/album/{$albumO->getId()}">
{/if}
{$albumO->getTitle()}
</td>
<td>{$albumO->getArtistname()}</td>
<td>{$albumO->getYeardate()}</td>
<td>
{if !$easyURL}
<a href="modules.php?name={$module_name}&op=album&idartist={$albumO->getIdartist()}&idalbum={$albumO->getId()}">
{elseif !$easyURLtype}
<a href="{$tm_BaseURL}/music.php/artist/{$albumO->getArtistname()|urlencode}/album/{$albumO->getTitle()|urlencode}">
{elseif $easyURLtype==2}
<a href="album{$albumO->getIdartist()}_{$albumO->getId()}.html">
{else}
<a href="{$tm_BaseURL}/music.php/artist/{$albumO->getIdartist()}/album/{$albumO->getId()}">
{/if}
{#View#}</a></td>
</tr>
{assign var="num" value=$albumO->getCount()}
{/foreach}
</tbody>
<tfoot></tfoot>
</table>
{else}
{#No_results#}.
{/if}
{else}
{if $songList!=""}
<table class="tm_list">
<thead>
<tr><td>#</td><td>{#Title#}</td><td>{#Album#}</td><td> </td></tr>
</thead>
<tbody>
{foreach item=song from=$songList}
<tr {cycle values="class=\"odd\","}>
<td>{$song->number}</td>
<td>
{if !$tm_easyURL}
<a href="modules.php?name={$module_name}&op=song&idartist={$song->getIdartist()}&idalbum={$song->getIdalbum()}&idsong={$song->getId()}">
{elseif !$tm_easyURLtype}
<a href="{$tm_BaseURL}/music.php/artist/{$song->getArtistname()|urlencode}/album/{$song->getAlbumname()|urlencode}/song/{$song->getTitle()|urlencode}">
{elseif $tm_easyURLtype==2}
<a href="song{$song->getIdartist()}_{$song->getIdalbum()}_{$song->getId()}.html">
{else}
<a href="{$tm_BaseURL}/music.php/artist/{$song->getIdartist()}/album/{$song->getIdalbum()}/song/{$song->getId()}">
{/if}
{$song->getTitle()}</td>
<td>{$song->getAlbumname()} ({$song->artistname})</td>
<td>
{$genericView->printPlayer($song,"button",$module_name,$tm_config)}
</td>
{assign var="num" value=$song->getCount()}
{/foreach}
</tbody>
<tfoot></tfoot>
</table>
{else}
{#No_results#}.
{/if}
{/if}
<br>
{if $op=="search" && $num>0}
{if $searchPage>1}
<a href="javascript:changePage({$searchPage-1})">< {#Previous#}</a>
{/if}
{if $searchPage>0}
{$searchPage}
{else}
1
{/if}
{#of#}
{math equation="ceil(x/10)" x=$num}
{if $searchPage<ceil($num/10) }
<a href="javascript:changePage({$searchPage+1})"> {#Next#} ></a>
{/if}
{/if}
</div>