{*
  Template for the club detailview
  $Id: show_competitions.tpl,v 1.00 2006/10/25 20:14:18
*}
{assign var=IMGWIDTH value="150"}
{assign var=IMGHEIGHT value="150"}
{assign var=CLUBWIDTH value="75"}
{assign var=CLUBHEIGHT value="75"}

<script language="JavaScript" type="text/javascript" src="javascript/look.js"></script>

<div id="pagecontent">
<!-- content begin -->
<table width="90%" border=0 cellspacing="0" cellpadding="5">
  <tr>
    <td class="center" width="{$IMGWIDTH}">
		{html_image file=$competition.imgurl link=$link max_width="$IMGWIDTH" max_height="$IMGHEIGHT"}
    </td>
    <td valign="top">
      <table cellspacing="0" cellpadding="2" border="0" width="100%">
			{if $competition.creation}
	  		<tr>
			<td class="td-opt" width="30%" NOWRAP><b>» {$lang.creation} :</b></td>
			<td class="td-value">{$competition.creation}</td>
			</tr>		
            {/if}
			{if $competition.country}
			<tr>
			<td class="td-opt" width="30%" NOWRAP><b>» {$lang.country} :</b></td>
			<td class="td-value">{$competition.country}</td>
			</tr>		
            {/if}
			{if $competition.shortname}
			<tr>
			<td class="td-opt" width="30%" NOWRAP><b>» {$lang.shortname} :</b></td>
			<td class="td-value">{$competition.shortname}</td>			
			</tr>
			{/if}
			{if $competition.aka}		
            <tr>
			<td class="td-opt" width="30%" NOWRAP><b>» {$lang.aka} :</b></td>
			<td class="td-value">{$competition.aka}</td>
			</tr>
			{/if}
			{if $compettype[$competition.type]}
			<tr>
			<td class="td-opt" rowspan="2" width="30%" NOWRAP><b>» {$lang.type} :</b></td>
			<td class="td-value">{$compettype[$competition.type]}</td>			
			</tr>		
			<tr>
			<td class="td-value">{$competrange[$competition.range]}</td>
			</tr>
			{/if}
			{if $competition.website}
			<tr>
				<td class="td-opt" width="30%" NOWRAP><b>» {$lang.website} :</b></td>
				<td class="td-value">{if $competition.website}<a href="{$competition.website}" target="_blank">{$competition.website}</a>{/if}</td>			
			</tr>
			{/if}
		</table>	
    </td>	
  </tr>
{if $competition.plot}
  <tr>
	<td class="title-classement" colspan="2"><a href="javascript:" onclick="blocking('bloc1','yes', 'block'); return false;">» {$lang.comments} :</a></td>
  </tr>
  <tr>
    <td colspan="2" align="justify">
	<div id="bloc1" style="display: block;">
	{$competition.plot}
	</div>
	</td>
  </tr>
{/if}

{if $list}
<tr>
	<td class="title-classement" colspan="2"><a href="javascript:" onclick="blocking('bloc2','yes', 'block'); return false;">» {$lang.prizelist} :</a></td>
</tr>
<tr>
	<td colspan="2">
		<div id="bloc2" style="display: block;">
		<table width="100%" border="0" cellpadding="0" cellspacing="1">
		  <tr>
			<td> 
			{counter start=0 print=false name=competitioncount}
			{counter start=0 print=false name=countcompet}
			{assign var="countcompet" value="0"}
			{foreach item=season from=$seasons}
			{assign var="nextyear" value="`$season.season+1`"}
				
		{if $list[$season.id].id}
			{if $count == 0}
				<table width="100%" border="0" cellpadding="0" cellspacing="5">
				<tr>
			{/if}

					<td width="{math equation="floor(100/x)" x=$prizelistcolumns}%">
						<table class="table-info" width="100%" border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td class="title-classement" align="center">{if $competition.oneyear}{$season.season}{else}{if $competition.type != 1}{$season.season} / {/if}{$nextyear}{/if}</td>
							</tr>
							<tr>
								<td align="center">
									<a title="{$list[$season.id].longname}" href="show_clubs.php?id={$list[$season.id].id}">
									<span class="img-shadow">{html_image file=$list[$season.id].imgurl max_width="$CLUBWIDTH" max_height="$CLUBHEIGHT"}</span>
									</a>
								</td>
							</tr>
						</table>
					</td>

			{counter assign=countcompet name=countcompet}
			{counter assign=count name=competitioncount}
			{if $count == $prizelistcolumns}
				{counter start=0 print=false name=competitioncount}
					</tr>
				</table>
			{/if}
				{/if}
				{php}flush();{/php}
			{/foreach}
			
			{if $count != 0}
				{section name="columnLoop" start=$count loop=$prizelistcolumns}
					<td>&nbsp;</td>
				{/section}
				</tr>
				</table>
			{/if}
			</td>
		</tr>
		</table>
		</div>
	</td>
</tr>
{/if}

{*
	Sub competition list by table
*}

{if $sublist}
<tr>
	<td colspan="2">
		<table width="100%" border="0" cellpadding="0" cellspacing="1">
		{if $editable}
		<tr>
			<td align="right">
			<form action="manage_competitions.php" name="manageform">
				<span class="onglet-admin">
				<input type="submit" value="{$lang.manage}" />
				</span>
			</form>
			</td>
		</tr>
		{/if}
		<tr>
			<td> 
			{counter start=0 print=false name=competitioncount}
			{counter start=0 print=false name=countcompet}
			{assign var="countcompet" value="0"}
			{foreach item=subcompet from=$sublist}
				
			{if $subcompet.id}
				{if $count == 0}
				{cycle values="lineeven,lineodd" assign=CLASS print=false}
				<div class="{$CLASS}">
					<table width="100%" border="0" cellpadding="0" cellspacing="5">
					<tr>
				{/if}

					<td width="{math equation="floor(100/x)" x=$prizelistcolumns}%">
						<table id="tableshow" width="100%" style="top:0px" border="0" cellpadding="0" cellspacing="1">
							<tr>
								<td class="td-opt" align="center"><a title="{$subcompet.longname}" href="show_competitions.php?id={$subcompet.id}&season={$season}">{$subcompet.shortname}</a></td>
							</tr>
							<tr>
								<td class="td-value">
									{foreach item=table from=$subcompet.table}
									<div style="display:block; width:100%;">
										<div style="display:table-cell; width:200px;">
										<a title="{$table.name}" href="show_clubs.php?id={$table.id}">
										{$table.name|truncate:12:"..."}
										</a>
										</div>
										<div style="display:table-cell; width:25%; text-align:center;">{$table.points}</div>
									</div>
									{/foreach}
								</td>
							</tr>
						</table>
					</td>

			{counter assign=countcompet name=countcompet}
			{counter assign=count name=competitioncount}
			{if $count == $prizelistcolumns}
				{counter start=0 print=false name=competitioncount}
					</tr>
				</table>
				</div>
			{/if}
				{/if}
				{php}flush();{/php}
			{/foreach}
			
			{if $count != 0}
				{section name="columnLoop" start=$count loop=$prizelistcolumns}
					<td>&nbsp;</td>
				{/section}
				</tr>
				</table>
				
			{/if}
			</td>
		</tr>
		</table>
	</td>
</tr>
{/if}

</table> 
</div>
<!-- /content -->
