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

<!-- {$smarty.template} -->
<br>
<table border="0" cellpadding="0" cellspacing="0" width="90%">
	<tr>
		<td><h2>{$person.lastname} {$person.firstname}</h2></td>
	</tr>
	<tr>
		<td class="title-classement" valign="middle">
		<form action="show_persons.php" name="editform">
				<input type="hidden" name="id" value="{$person.id}"/>
				<input type="hidden" name="action" value="card"/>
				<input class="button" type="submit" value="{$lang.card}" />
		</form>
		{if $person.id_club}
		<form action="show_clubs.php" name="editform">
				<input type="hidden" name="id" value="{$person.id_club}"/>
				<input class="button" type="submit" value="{$lang.club}" />
		</form>
		{/if}
		{if $person.prev_id || $person.next_id}
			<form action="show_persons.php" name="prevform">
				<input type="hidden" name="id" value="{$person.prev_id}"/>
				<input class="button" type="submit" value="&laquo;" {if !$person.prev_id}disabled="disabled"{/if} accesskey="," />
			</form>
			<form action="show_persons.php" name="nextform">
				<input type="hidden" name="id" value="{$person.next_id}"/>
				<input class="button" type="submit" value="&raquo;" {if !$person.next_id}disabled="disabled"{/if} accesskey="." />
			</form>
		 {/if}
		</td>
	</tr>

</table>


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

<div id="pagecontent">
<!-- content begin -->
<table width="90%" border=0 cellspacing="0" cellpadding="0">
  <tr>
  	<td>
	<table width="100%" border="0" cellspacing="1" cellpadding="5">
	  <tr>
		<tr>
		<td width="{$IMGWIDTH}" rowspan="3">
		<span class="img-shadow">{html_image file=$person.imgurl link=$link max_width="$IMGWIDTH" max_height="$IMGHEIGHT"}</span>
		</td>    	
	  </tr>  
	  <tr>
		<td valign="top">
		  <table cellspacing="0" cellpadding="2" border="0" width="100%">
				{if $person.clubname}
				<tr>
					<td class="td-opt"><b>» {$lang.actualclub} :</b></td>
					<td class="td-value" nowrap><a href="show_clubs.php?id={$person.id_club}">{$person.clubname}</a></td>
				</tr>
				{/if}
				{if $person.birthday}
				<tr>
					<td class="td-opt"><b>» {$lang.birthday} :</b></td>
					<td class="td-value" nowrap>{$person.birthday}</td>
				</tr>
				{/if}
				{if $person.astrosign}
				<tr>
					<td class="td-opt"><b>» {$lang.astrosign} :</b></td>
					<td class="td-value">{$person.astrosign}</td>			
				</tr>
				{/if}
				{if $person.country}
				<tr>
					<td class="td-opt"><b>» {$lang.country} :</b></td>
					<td class="td-value">{$person.country}</td>
				</tr>
				{/if}
				{if $person.birthcity}
				<tr>
					<td class="td-opt"><b>» {$lang.birthcity} :</b></td>
					<td class="td-value">{$person.birthcity}</td>			
				</tr>		
				{/if}
				{if $person.height}
				<tr>
					<td class="td-opt"><b>» {$lang.height} :</b></td>
					<td class="td-value">{$person.height} cm</td>			
				</tr>
				{/if}
				{if $person.weight}
				<tr>
					<td class="td-opt"><b>» {$lang.weight} :</b></td>
					<td class="td-value">{$person.weight} Kg</td>
				</tr>
				{/if}
				{if $person.position}
				<tr>
					<td class="td-opt"><b>» {$lang.position} :</b></td>
					<td class="td-value">{$postype[$person.position]}</td>
				</tr>
				{/if}
				{if $person.website}
				<tr>
					<td class="td-opt"><b>» {$lang.website} :</b></td>
					<td class="td-value">{if $person.website}<a href="{$person.website}" target="_blank">{$person.website}</a>{/if}</td>			
				</tr>
				{/if}
		  </table>
		</td>	
	  </tr>

	</table> 
 	</td>
  </tr>
{if $person.editable}
  <tr>
	<td class="title-classement"><a href="javascript:" onclick="blocking('addinfo','yes', 'block'); return false;">» {$lang.additionalinfo}</a></td>
  </tr>
  <tr>
	<td valign="top">
		  <div id="addinfo" style="display:none;">
		  <table cellspacing="0" cellpadding="2" border="0" width="100%">
				<tr>
					<td class="td-opt"><b>» {$lang.email} :</b></td>
					<td class="td-value" nowrap><a href="mailto:{$person.email}">{$person.email}</a></td>
					<td class="td-opt"><b>» {$lang.stop_mail} :</b></td>
					<td class="td-value">{if $person.stop_mail}{$lang.yes}{else}{$lang.no}{/if}</td>			
				</tr>
				<tr>
					<td class="td-opt"><b>» {$lang.phone} 1 :</b></td>
					<td class="td-value" nowrap>{$person.tel1}</td>
					<td class="td-opt"><b>» {$lang.phone} 2 :</b></td>
					<td class="td-value" nowrap>{$person.tel2}</td>
				</tr>
				<tr>
					<td class="td-opt"><b>» {$lang.license} :</b></td>
					<td class="td-value" nowrap>{$person.license}</td>
					<td class="td-opt"><b>» {$lang.contribution} :</b></td>
					<td class="td-value">{if $person.contribution}{$lang.yes}{else}{$lang.no}{/if}</td>
				</tr>
				<tr>
					<td class="td-opt"><b>» {$lang.adresse} :</b></td>
					<td class="td-value" nowrap>{$person.address}</td>
					<td colspan="2">&nbsp;</td>
				</tr>
		</table>
		</div>
	</td>
  </tr>
{/if}
{if $person.plot}
  <tr>
  	<td class="title-classement"><a href="javascript:" onclick="blocking('bloc1','yes', 'block'); return false;">» {$lang.comments} :</a></td>
  </tr>
  <tr>
  	<td>
		<div id="bloc1" class="show_plot" style="display: block;">{$person.plot}</div>
 	</td>
  </tr>
{/if}

{if $person.type == 1}


	{if $playerstats}
	<tr>
		<td class="title-classement"><a href="javascript:" onclick="blocking('bloc2','yes', 'block'); return false;">» {$lang.statistics} :</a></td>
	</tr>
	<tr>
		<td>
			<div id="bloc2" class="show_plot" style="display: block;">
			{if $person.competition}
			<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
				<td width="20%" nowrap>
					<table border="0" width="100%" cellpadding="2" cellspacing="1">
						<tr><td class="lineeven">&nbsp;</td></tr>
						<tr><td class="lineodd"><b>{$lang.titular}</b></td></tr>
						<tr><td class="lineeven"><b>{$lang.substitute}</b></td></tr>
						<tr><td class="lineodd"><b>{$lang.playtime}</b></td></tr>
						<tr><td class="lineeven"><b>{$lang.goals}</b></td></tr>
						<tr><td class="lineodd"><b>{$lang.yellowcards}</b></td></tr>
						<tr><td class="lineeven"><b>{$lang.redcards}</b></td></tr>
					</table>
				</td>
				
				{counter start=0 print=false name=competcount}
				{foreach item=compet from=$person.competition}
				<td width="{math equation="floor(100/x)" x=5}%">
					<table border="0" width="100%" cellpadding="2" cellspacing="1">
						<tr><td class="lineeven"><a href="show_competitions.php?id={$compet.id}"><b>{if $compet.subshortname}{$compet.subshortname}{else}{$compet.shortname}{/if}</b></a></td></tr>
						<tr><td class="lineodd">
							{if $person.lineup[$compet.id].titular}{$person.lineup[$compet.id].titular}{else}0{/if}
						</td></tr>
						<tr><td class="lineeven">
							{if $person.lineup[$compet.id].substitute}{$person.lineup[$compet.id].substitute}{else}0{/if}
						</td></tr>
						<tr><td class="lineodd">
							{if $person.lineup[$compet.id].playtime}{$person.lineup[$compet.id].playtime} mn{else}0 mn{/if}
						</td></tr>
						<tr><td class="lineeven">
							{if !$count}{if $person.goals[0].goals}{$person.goals[0].goals}{else}0{/if}
							{else}{if $person.goals[$count].goals}{$person.goals[$count].goals}{else}0{/if}
							{/if}
						</td></tr>
						<tr><td class="lineodd">
							{if !$count}{if $person.cards[0].yellowcards}{$person.cards[0].yellowcards}{else}0{/if}
							{else}{if $person.goals[$count].yellowcards}{$person.goals[$count].yellowcards}{else}0{/if}
							{/if}
						</td></tr>
						<tr><td class="lineeven">
							{if !$count}{if $person.cards[0].redcards}{$person.cards[0].redcards}{else}0{/if}
							{else}{if $person.goals[$count].redcards}{$person.goals[$count].redcards}{else}0{/if}
							{/if}
						</td></tr>
					</table>
				</td>
				{counter assign=count name=competcount}
				{/foreach}
				{if $count < 3}
				{section name="columnLoop" start=$count loop=3}
       			 <td width="{math equation="floor(100/x)" x=3}%">&nbsp;</td>
    			{/section}
				{/if}
			</table>
			{/if}
			{if $carrier}

			<table width="100%" border="0" cellspacing="0" cellpadding="2">
				<tr>
					<td class="title-classement">{$lang.seasons}</td>
					<td class="title-classement">{$lang.club}</td>
					<td class="title-classement">{$lang.played}</td>
					<td class="title-classement">{$lang.minutes}</td>
					<td class="title-classement">{$lang.goals}</td>
					<td class="title-classement">{$lang.yellowcard_abr}</td>
					<td class="title-classement">{$lang.redcard_abr}</td>	
				</tr>
			{foreach item=club from=$carrier}
			{cycle values="lineeven,lineodd" assign=CLASS print=false}
			{assign var="nextyear" value="`$club.season+1`"}
				<tr class="{$CLASS}">
					<td class="td-value">{$club.season} / {$nextyear}</td>
					<td class="td-value"><a title="{$club.shortname}" href="show_clubs.php?id={$club.id}">{$club.shortname}</a></td>
					<td class="td-value">{$club.games}</td>
					<td class="td-value">{$club.minutes}</td>
					<td class="td-value">{$club.goals}</td>
					<td class="td-value">{$club.ycards}</td>
					<td class="td-value">{$club.rcards}</td>
				</tr>
				{/foreach}
			</table>
			{/if}
			</div>
		</td>
	  </tr>

{else}
	  <tr>
		<td><a class="opt-group" href="javascript:" onclick="blocking('bloc3','yes', 'block'); return false;">» {$lang.career} :</a></td>
	  </tr>
	  <tr>
		<td>
			<div id="bloc3" class="show_plot" style="display: block;">
			{counter start=0 print=false name=clubcount}
			<table width="100%" border="0" cellspacing="0" cellpadding="2">
				<tr>
				{foreach item=club from=$carrier}
				{cycle values="lineeven,lineodd" assign=CLASS print=false}
				
				{assign var="nextyear" value="`$club.season+1`"}
					<td class="{$CLASS}" align="center" width="{math equation="floor(100/x)" x=$clubslistcolumns}%">
					<div id="theme">{$club.season} / {$nextyear}</div>
					<a title="{$club.shortname}" href="show_clubs.php?id={$club.id}">
					<img alt="{$club.shortname}" src="{$club.imgurl}" border="0" hspace="5" vspace="5" width="{$CLUBWIDTH}">
					</a>
					</td>
					{counter assign=count name=clubcount}
					{if $count == $clubslistcolumns}
					{counter start=0 print=false name=clubcount}
					</tr><tr>
					{/if}
				{/foreach}
				
				{if $count != 0}
					{section name="columnLoop" start=$count loop=$clubslistcolumns}
					<td>&nbsp;</td>
					{/section}
					</tr>
				{/if}
			</table>
			</div>
		</td>
	  </tr>
	{/if}
	
{/if}
</table>


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