{*
  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>


<!-- content begin -->


<table id="tableshow" width="97%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="center" 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>
    <td valign="top">
      <table cellspacing="0" cellpadding="2" border="0" width="100%">
	  		<tr>
			<td class="lineeven" width="30%" NOWRAP><b>» {$lang.creation} :</b></td>
			<td class="lineeven">{$competition.creation}{if $competition.complete} ({$lang.cessation} {$competition.complete}){/if}</td>
			</tr>		
            <tr>
			<td class="lineodd"><b>» {$lang.country} :</b></td>
			<td class="lineodd">{$competition.country}</td>
			</tr>		
            <tr>
			<td class="lineeven"><b>» {$lang.shortname} :</b></td>
			<td class="lineeven">{$competition.shortname}</td>			
			</tr>		
            <tr>
			<td class="lineodd"><b>» {$lang.aka} :</b></td>
			<td class="lineodd">{$competition.aka}</td>
			</tr>
			<tr>
			<td class="lineeven" rowspan="2"><b>» {$lang.type} :</b></td>
			<td class="lineeven">{$compettype[$competition.type]}</td>			
			</tr>		
			<tr>
			<td class="lineeven">{$competrange[$competition.range]}</td>
			</tr>
			<tr>
				<td class="lineodd"><b>» {$lang.website} :</b></td>
				<td class="lineodd">{if $competition.website}<a href="{$competition.website}" target="_blank">{$competition.website}</a>{/if}</td>			
			</tr>
			<tr>
			<td class="lineeven"><b>» {$lang.admins}:</b></td>
			<td class="lineeven">
				{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="title-cat" colspan="2"><a href="javascript:" onclick="blocking('bloc0','yes', 'block'); return false;"><b>» {$lang.additionalinfo}</b></a></td>
	</tr>
	<tr>
		<td 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 class="title-cat" colspan="2"><a href="javascript:" onclick="blocking('bloc1','yes', 'block'); return false;"><b>» {$lang.comments} :</b></a></td>
  </tr>
  <tr>
    <td colspan="2" align="justify">
	<div id="bloc1" style="display: none;">
	{$competition.plot}
	</div>
	</td>
  </tr>
{/if}

{foreach from=$stadium.carac_ads item=option}
	{if $option.genre == 7 && $option.value}
	<tr>
		<td class="title-cat" colspan="2"><b>» {$option.name}:</b></td>
	</tr>
	<tr>
		<td colspan="2">
		<div class="img-shadow">
		<a title="{$stadium.longname}" href="javascript:void(PopupImage('{$option.value}'))">
			<img alt="{$stadium.longname}" src="{$option.value}" border="0" hspace="5" vspace="5" width="{$IMG2WIDTH}">
		</a>
		</div>
		</td>    	
	  </tr> 
	{/if}			
{/foreach}

{*
	Prize list by table
*}


{if $prizelist}
<tr>
	<td class="title-cat" 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="{$CLASS}" align="center" nowrap><b>{$prizee.count} {$lang.victorys}</b></td>
					<td class="{$CLASS}" 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">
		{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>
				</div>
			{/if}
			</td>
		</tr>
		</table>
	</td>
</tr>
{/if}

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