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

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

<div id="pagecontent">
<!-- content begin -->
<table id="tableshow" width="100%" border="0" cellspacing="1" cellpadding="2">
	
  <tr>
    <td class="center" rowspan="2" width="{$CLUBWIDTH}">
    <div class="img-shadow">
		<a title="{$competition.longname}" href="{$link}">
		<img alt="{$competition.longname}" src="{$competition.imgurl}" border="0" hspace="5" vspace="5" width="150">
		</a>
	</div>
    </td>    	
  </tr>  
  <tr>
    <td>
      <table cellspacing="1" cellpadding="2" border="0" width="100%">
	  		<tr>
			<td class="td-opt" width="25%">{$lang.creation}:</td><td width="25%" class="td-value">{$competition.creation}{if $competition.complete} ({$lang.cessation} {$competition.complete}){/if}</td>
			<td class="td-opt" width="25%">{$lang.country}:</td><td class="td-value" width="25%">{$competition.country}</td>
			</tr>		
            <tr>
			<td class="td-opt">{$lang.shortname}:</td><td class="td-value">{$competition.shortname}</td>			
			<td class="td-opt">{$lang.aka}:</td><td class="td-value">{$competition.aka}</td>
			</tr>
			<tr>
			<td class="td-opt" rowspan="2">{$lang.type}:</td><td class="td-value">{$compettype[$competition.type]}</td>			
			<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
			<td class="td-value">{$competrange[$competition.range]}</td>
			<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
			<td class="td-opt">{$lang.website}:</td><td class="td-value" colspan="3">{if $competition.website}<a href="{$competition.website}" target="_blank">{$competition.website}</a>{/if}</td>			
			</tr>
			<tr class="lineeven">
			<td class="td-opt">{$lang.admins}:</td>
			<td class="td-value" colspan="3">
				{section name=cal loop=$listadmin}
				<a href="show_members.php?id={$listadmin[cal].id}">{$listadmin[cal].name}</a>,
				{/section}
			</td>			
			</tr>
		</table>	
    </td>	
  </tr>
  
  {if $competition.carac_ads}
		<tr>
		<td class="td-opt" colspan="2"><a href="javascript:" onclick="blocking('bloc0','yes', 'block'); return false;">{$lang.additionalinfo}</a></td>
		</tr>
		<tr>
			<td class="td-value" colspan="2">
			<div id="bloc0" class="show_plot" style="display:none;">
			<table width="100%" style="top:0px" border="0" cellpadding="2" cellspacing="0">
				{foreach from=$competition.carac_ads item=option}
				{if $option.genre != 7}
				{cycle values="lineeven,lineodd" assign=CLASS print=false}
				<tr class="{$CLASS}">
				  <td class="td-opt" width="40%"><b>{$option.name}:</b></td>
				  {if $option.genre == 3}
					<td class="td-value"><a href="{$option.value}" target="_blank">{$option.name}</a></td>			  
				  {elseif $option.genre == 4}
					<td class="td-value"><a href="mailto:{$option.value}" target="_blank">{$option.value}</a></td>			  
				  {else}
					<td class="td-value">{$option.value}</td>
				  {/if}
				</tr>
				{/if}			
				{/foreach}
			</table>
			</div>
		</td>
	</tr>
	{/if}

  {if $competition.plot}
  <tr>
  	<td colspan="2">
		<table>
		  <tr>
			<td class="td-opt">{$lang.comments}: </td>
		  </tr>
		  <tr>
		  <td class="td-value" align="justify">{$competition.plot}</td>
		  </tr>
  		</table>
	</td>
  </tr>
  {/if}

{*
	Prize list by table
*}


{if $prizelist}
<tr>
	<td class="td-opt" colspan="2"><a href="javascript:" onclick="blocking('bloc3','yes', 'block'); return false;"><b>» {$lang.prizelist} :</b></a></td>
</tr>
<tr>
	<td colspan="2">
		<div id="bloc3" style="display: block;">
		<table width="100%" border="0" cellpadding="2" cellspacing="1">
			{foreach item=prizee from=$prizelist}
			{cycle values="lineeven,lineodd" assign=CLASS print=false}
				<tr>
					<td class="td-opt" align="center" nowrap><b>{$prizee.count} {$lang.victorys}</b></td>
					<td class="td-value" align="left">{$prizee.list}</td>
				</tr>
			{/foreach}
		</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">
		<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:15:"..."}
										</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>
				</div>
			{/if}
			</td>
		</tr>
		</table>
	</td>
</tr>
{/if}

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