{*
  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="100"}
{assign var=CLUBWIDTH value="75"}
{assign var=CLUBHEIGHT value="75"}

<!-- {$smarty.template} -->
<div id="title"><a href="show_persons.php?id={$person.id}">{$person.lastname} {$person.firstname}</a></div>

<table id="actions" border="0" cellpadding="0" cellspacing="0" width="100%">
	<tr>
		<td id="barre-onglet">
		<form action="show_persons.php" name="editform">
				<input type="hidden" name="id" value="{$person.id}"/>
				<input type="hidden" name="action" value="card"/>
				<input type="submit" class="{if $action=='card'}onglet-on{else}onglet{/if}" value="{$lang.card}" />
		</form>
		{if $person.seegallery}
			<form action="gallery.php" name="galleryform">
				<input type="hidden" name="subcat" value="{$person.id}"/>
				<input type="hidden" name="cat" value="4" />
				<input type="submit" value="{$lang.gallery}" class="onglet"/>
			</form>
		{/if}
		{if $person.commentable}
				<form action="comments.php" name="mkcommentform">
					<input type="hidden" name="subcat" value="{$person.id}"/>
					<input type="hidden" name="cat" value="4" />
					<input type="submit" value="{$lang.comments}" class="onglet"/>
				</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 type="submit" class="onglet" value="<" {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 type="submit" class="onglet" value=">" {if !$person.next_id}disabled="disabled"{/if} accesskey="." />
			</form>
			 {/if}
		</td>
	</tr>
{if $person.editable}
	<tr>
		<td id="barre-season">
		<form action="edit_persons.php" name="editform">
				<input type="submit" value="{$lang.newdata}" class="onglet"/>
		</form>
		<form action="edit_persons.php" name="editform">
				<input type="hidden" name="id" value="{$person.id}"/>
				<input type="submit" value="{$lang.edit}" class="onglet"/>
		</form>
		<form action="delete.php" name="deleteform">
				<input type="hidden" name="id" value="{$person.id}"/>
				<input type="hidden" name="cat" value="8"/>
				<input type="submit" value="{$lang.del}" onclick="return(confirm('{$person.lastname|escape:javascript}: {$lang.msg_really_del}?'))" class="onglet"/>
		</form>
		{if $person.type ==1 && $playerstats}
		<form action="edit_statspersons.php" name="editstatsform">
				<input type="hidden" name="id" value="{$person.id}"/>
				<input type="submit" value="{$lang.stats}" class="onglet"/>
		</form>
		{/if}
	</td>
	</tr>
{/if}
</table>


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

<div id="pagecontent">
<!-- content begin -->
<table width="100%" border=0 cellspacing="0" cellpadding="0">
  <tr>
  	<td>
	<table id="tableshow" width="100%" border=0 cellspacing="1" cellpadding="5">
	  <tr>
		<tr>
		<td width="{$IMGWIDTH}" rowspan="3">
		<div class="img-shadow">
		<a title="{$person.lastname} {$person.firstname}" href="{$link}">
			<img alt="{$person.lastname} {$person.firstname}" src="{$person.imgurl}" border="0" hspace="5" vspace="5" width="{$IMGWIDTH}">
		</a>
		</div>
		</td>    	
	  </tr>  
	  <tr>
		<td>
		  <table cellspacing="1" cellpadding="2" border="0" width="100%">
		  		
				<tr>
				{if $person.type == 1 && $person.clubname}
				<td class="td-opt">{$lang.actualclub}:</td><td class="td-value"><a href="show_clubs.php?id={$person.id_club}">{$person.clubname}</a></td>
				{else}
				<td class="td-opt">&nbsp;</td><td class="td-value">&nbsp;</td>
				{/if}
				{if $person.aka}
				<td class="td-opt">{$lang.aka}:</td><td class="td-value">{$person.aka}</td>
				{else}
				<td class="td-opt">&nbsp;</td><td class="td-value">&nbsp;</td>
				{/if}			
				</tr>
				<tr>
				<td class="td-opt">{$lang.birthday}:</td><td class="td-value">{$person.birthday}</td>
				<td class="td-opt">{$lang.astrosign}:</td><td class="td-value">{$person.astrosign}</td>			
				</tr>
				{if $person.deathday > 0}
				<tr>
				<td class="td-opt">{$lang.deathday}:</td><td class="td-value">{$person.deathday}</td>
				<td class="td-opt">&nbsp;</td><td class="td-value">&nbsp;</td>		
				</tr>
				{/if}
				<tr>
				<td class="td-opt">{$lang.country}:</td><td class="td-value">{$person.country}</td>
				<td class="td-opt">{$lang.birthcity}:</td><td class="td-value">{$person.birthcity}</td>			
				</tr>		
				<tr>
				<td class="td-opt">{$lang.height}:</td><td class="td-value">{if $person.height}{$person.height} cm{/if}</td>			
				<td class="td-opt">{$lang.weight}:</td><td class="td-value">{if $person.weight}{$person.weight} Kg{/if}</td>
				</tr>
				<tr>
				{if $person.type == 1}
				<td class="td-opt">{$lang.position}:</td><td class="td-value">{$postype[$person.position]}</td>
				<td class="td-opt">{$lang.international}:</td><td class="td-value">{$person.international}</td>
				{/if}		
				</tr>
				
				{counter start=0 print=false name=optcount}
				{foreach from=$person.carac_ads item=option}
				{if $option.genre != 7}
				<tr>
				  <td class="td-opt"><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>
		</td>	
	  </tr>
   
	</table> 
 	</td>
  </tr>
{if $person.editable}
	  <tr>
		<td class="td-opt"><a class="opt-group" href="javascript:" onclick="blocking('addinfo','yes', 'block'); return false;">» {$lang.additionalinfo}</a></td>
	  </tr>
	  <tr>
			<td>
			  <div id="addinfo" style="display:none;">
			  <table cellspacing="1" cellpadding="2" border="0" width="100%">
					<tr>
					<td class="td-opt">{$lang.email}:</td><td class="td-value"><a href="mailto:{$person.email}">{$person.email}</a></td>
					<td class="td-opt">{$lang.stop_mail}:</td><td class="td-value">{if $person.stop_mail}{$lang.yes}{else}{$lang.no}{/if}</td>			
					</tr>
					<tr>
					<td class="td-opt">{$lang.phone} 1:</td><td class="td-value">{$person.tel1}</td>
					<td class="td-opt">{$lang.phone} 2:</td><td class="td-value">{$person.tel2}</td>			
					</tr>		
					<tr>
					<td class="td-opt">{$lang.license}:</td><td class="td-value">{$person.license}</td>			
					<td class="td-opt">{$lang.contribution}:</td><td class="td-value">{if $person.contribution}{$lang.yes}{else}{$lang.no}{/if}</td>
					</tr>
					<tr>
					<td class="td-opt">{$lang.adresse}:</td><td class="td-value">{$person.address}</td>
					<td colspan="2">&nbsp;</td>			
					</tr>
			  </table>
			</div>
			</td>	
		  </tr>
	{/if}
{if $person.plot}
  <tr>
  	<td class="td-opt"><a class="opt-group" 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}

{foreach from=$stadium.carac_ads item=option}
	{if $option.genre == 7 && $option.value}
	<tr>
		<td class="td-opt" 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}


{if $playerstats}

	{if $person.type == 1 ||  $person.type == 3}


	  <tr>
		<td class="td-opt"><a class="opt-group" 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="0" cellspacing="1">
						<tr><td class="td-opt">&nbsp;</td></tr>
						<tr><td class="td-opt">{$lang.titular}</td></tr>
						{if $person.type == 1}
						<tr><td class="td-opt">{$lang.substitute}</td></tr>
						{/if}
						<tr><td class="td-opt">{$lang.playtime}</td></tr>
						<tr><td class="td-opt">{$lang.goals}</td></tr>
						<tr><td class="td-opt">{$lang.yellowcards}</td></tr>
						<tr><td class="td-opt">{$lang.redcards}</td></tr>
					</table>
				</td>
				
				{counter start=0 print=false name=competcount}
				{foreach item=compet from=$person.competition}
				<td>
					<table border="0" width="100%" cellpadding="0" cellspacing="1">
						<tr><td class="td-opt"><b><a href="show_competitions.php?id={$compet.id}">{if $compet.subshortname}{$compet.subshortname}{else}{$compet.shortname}{/if}</a></b></td></tr>
						<tr><td class="td-value">
							{if $person.lineup[$compet.id].titular}{$person.lineup[$compet.id].titular}{else}0{/if}
						</td></tr>
						{if $person.type == 1}
						<tr><td class="td-value">
							{if $person.lineup[$compet.id].substitute}{$person.lineup[$compet.id].substitute}{else}0{/if}
						</td></tr>
						{/if}
						<tr><td class="td-value">
							{if $person.lineup[$compet.id].playtime}{$person.lineup[$compet.id].playtime} mn{else}0 mn{/if}
						</td></tr>
						<tr><td class="td-value">
							{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="td-value">
							{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="td-value">
							{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}
			</table>
		  {/if}
		  {if $person.type == 1}
			<table width="100%" border="0" cellspacing="0" cellpadding="2">
				<tr>
					<td class="td-opt"><b>{$lang.seasons}</b></td>
					<td class="td-opt"><b>{$lang.club}</b></td>
					<td class="td-opt"><b>{$lang.played}</b></td>
					<td class="td-opt"><b>{$lang.minutes}</b></td>
					<td class="td-opt"><b>{$lang.goals}</b></td>
					<td class="td-opt"><b>{$lang.yellowcard_abr}</b></td>
					<td class="td-opt"><b>{$lang.redcard_abr}</b></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 class="td-opt"><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:none;">
			{counter start=0 print=false name=clubcount}
			<table width="100%" border="0" cellspacing="5" cellpadding="0">
				<tr>
				{foreach item=club from=$carrier}
				{cycle values="listeven,listodd" assign=CLASS print=false}
				
				{assign var="nextyear" value="`$club.season+1`"}
					<td id="vignette" align="center" width="{math equation="floor(100/x)" x=$clubslistcolumns}%">
					<div id="theme">{$club.season} / {$nextyear}</div>
					<div class="img-shadow">
					<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>
					</div>
					</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 class="{$CLASS}">&nbsp;</td>
					{/section}
					</tr>
				{/if}
			</table>
			</div>
		</td>
	  </tr>
	{/if}
{/if}
</table>


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