{*
  Template for the club detailview
  $Id: edit_goals.tpl,v 1.00 2006/10/25 20:14:18
*}

<!-- {$smarty.template} -->
{assign var="namenextyear" value="`$nameseason.season+1`"}
<br>

<table id="tableshow" border="0" cellpadding="2" cellspacing="0" width="100%">
	<tr>
		<td id="toppage">
		<a href="show_competitions.php?id={$competition}&season={$season}">{$namecompet.longname} - {$lang.season} {if $competdata.oneyear}{$nameseason.season}{else}{$nameseason.season} / {$namenextyear}{/if}</a>
		</td>
	</tr>
	<tr>
		<td align="right">
		<b>{$lang.season} : </b>
		  <select name="season" onchange="if(this.options[this.selectedIndex].value) window.location.href='edit_goals.php?competition={$competition}&season='+this.options[this.selectedIndex].value;">
		  {foreach item=myseason from=$seasonselect}
		  {assign var="nextyear" value="`$myseason.season+1`"}
			{if $competdata.oneyear}
				<option value='{$myseason.id_season}'{if $season==$myseason.id_season}selected{/if}>{$myseason.season}</option>
			{else}
				<option value='{$myseason.id_season}'{if $season==$myseason.id_season}selected{/if}>{$myseason.season} / {$nextyear}</option>
			{/if}
		  {/foreach}
		  </select>
		</td>
	</tr>
{if $editable || $administrable}
	<tr>
		<td>
		
		{if $administrable}
			<form action="edit_competitions.php" name="editform">
				<span class="onglet-admin">
				<input type="submit" value="{$lang.newdata}"/>
				</span>
			</form>
			<form action="edit_competitions.php" name="editform">
					<input type="hidden" name="id" value="{$competition}"/>
					<span class="onglet-admin">
					<input type="submit" value="{$lang.edit}" />
					</span>
			</form>
			
			<form action="delete.php" name="deleteform">
					<input type="hidden" name="id" value="{$competition}"/>
					<input type="hidden" name="cat" value="3"/>
					<span class="onglet-admin">
					<input type="submit" value="{$lang.del}" onclick="return(confirm('{$competition.lastname|escape:javascript}: {$lang.really_del}?'))" />
					</span>
			</form>
		{/if}
		{if $editable || $administrable}
			<form action="edit_candidates.php" name="candidateform">
					<input type="hidden" name="competition" value="{$competition}"/>
					<input type="hidden" name="season" value="{$season}"/>				
					<span class="onglet-admin">
					<input type="submit" value="{$lang.editseason}" />
					</span>
			</form>
			<form action="edit_prizelist.php" name="candidateform">
				<input type="hidden" name="competition" value="{$competition}"/>
				<span class="onglet-admin">
				<input type="submit" value="{$lang.prizelist}"/>
				</span>
			</form>
			<form action="edit_candidates.php" name="candidateform">
				<input type="hidden" name="competition" value="{$competition}"/>
				<input type="hidden" name="season" value="{$season}"/>				
				<span class="onglet-admin">
				<input type="submit" value="{$lang.editseason}" />
				</span>
			</form>
			<form action="edit_penalitys.php" name="penalityform">
					<input type="hidden" name="competition" value="{$competition}"/>
					<input type="hidden" name="season" value="{$season}"/>				
					<span class="onglet-admin">
					<input type="submit" value="{$lang.editpenality}" />
					</span>
			</form>
			<form action="edit_days.php" name="dayform">
					<input type="hidden" name="competition" value="{$competition}"/>
					<input type="hidden" name="season" value="{$season}"/>				
					<span class="onglet-admin">
					<input type="submit" value="{$lang.editday}" />
					</span>
			</form>
			<form action="edit_matchs.php" name="matchsform">
					<input type="hidden" name="competition" value="{$competition}"/>
					<input type="hidden" name="season" value="{$season}"/>				
					<span class="onglet-admin">
					<input type="submit" value="{$lang.editmatchs}" />
					</span>
			</form>
			<form action="edit_goals.php" name="matchsform">
					<input type="hidden" name="competition" value="{$competition}"/>
					<input type="hidden" name="season" value="{$season}"/>				
					<span class="onglet-admin">
					<input type="submit" value="{$lang.editgoals}" />
					</span>
			</form>
		{/if}
	</td>
	</tr>
{/if}
	<tr>
		<td>
		<form action="show_competitions.php" name="editform">
				<input type="hidden" name="id" value="{$competition}"/>
				<input type="hidden" name="action" value="card"/>
				<span class="onglet">
				<input type="submit" value="{$lang.card}" />
				</span>	
		</form>
		{if $season}
		<form action="show_matchs.php" name="calendarform">
				<input type="hidden" name="competition" value="{$competition}"/>
				<input type="hidden" name="season" value="{$season}"/>
				<span class="onglet">
				<input type="submit"  value="{$lang.calendar}" {if !$competition}disabled="disabled"{/if} />
				</span>
		</form>
			{if $statsactive}
			<form action="stats_competitions.php" name="statsform">
					<input type="hidden" name="id" value="{$competition}"/>
					<input type="hidden" name="season" value="{$season}"/>
					<span class="onglet">
					<input type="submit" value="{$lang.stats}" {if !$competition} disabled="disabled"{/if} />
					</span>
			</form>
			{/if}
		<form action="show_tables.php" name="tableform">
				<input type="hidden" name="competition" value="{$competition}"/>
				<input type="hidden" name="season" value="{$season}"/>
				<span class="onglet">
				<input type="submit"  value="{$lang.classement}" {if !$competition}disabled="disabled"{/if} />
				</span>
		</form>
		<form action="show_kickers.php" name="tableform">
			<input type="hidden" name="competition" value="{$competition}"/>
			<input type="hidden" name="season" value="{$season}"/>
			<span class="onglet">
			<input type="submit" value="{$lang.kickers}"{if !$competition.id} disabled="disabled"{/if} />
			</span>
		</form>
		<form action="show_cards.php" name="tableform">
			<input type="hidden" name="competition" value="{$competition}"/>
			<input type="hidden" name="season" value="{$season}"/>
			<span class="onglet">
			<input type="submit" value="{$lang.cards}"{if !$competition.id} disabled="disabled"{/if} />
			</span>
		</form>
		{/if}
		{if $seegallery}
			<form action="gallery.php" name="galleryform">
				<input type="hidden" name="subcat" value="{$competition}"/>
				<input type="hidden" name="cat" value="2" />
				<span class="onglet">
				<input type="submit" value="{$lang.gallery}" />
				</span>
			</form>
		{/if}
		{if $commentable}
				<form action="comments.php" name="mkcommentform">
					<input type="hidden" name="subcat" value="{$competition}"/>
					<input type="hidden" name="cat" value="2" />
					<span class="onglet">
					<input type="submit" value="{$lang.comments}" />
					</span>
				</form>
		{/if}
		{if $prev_id || $next_id}
				<form action="show_competitions.php" name="prevform">
					<input type="hidden" name="id" value="{$prev_id}"/>
					<span class="onglet">
					<input type="submit"  value="<" {if !$prev_id}disabled="disabled"{/if} accesskey="," />
					</span>
				</form>
				<form action="show_competitions.php" name="nextform">
					<input type="hidden" name="id" value="{$next_id}"/>
					<span class="onglet">
					<input type="submit"  value=">" {if !next_id}disabled="disabled"{/if} accesskey="." />
					</span>
				</form>			
		{/if}
			
    </td>
	</tr>
	<tr><td id="bottompage">&nbsp;</td></tr>
</table>


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

<form action="edit_goals.php" id="day" name="day" method="post">
<input type="hidden" name="competition" id="compet" value="{$competition}" />
<input type="hidden" name="season" id="season" value="{$season}" />
<div id="pagecontent">
  <table id="tableshow" width="100%" border="0" cellspacing="0" cellpadding="5">
  	<tr>
  	<td id="toppage" colspan="5"><a href="#">{$lang.matchday} {$day}</a></td>
	</tr>
	<tr>
  	<td colspan="5" align="right">
		<select name="day" onchange="submit();">
		{counter start=0 print=false name=daycount}
		{section name="loopday" start=0 loop=$numdays}
		{counter assign=count name=daycount}		
		{if $namecompet.type == 1}
				{if $count == $numdays}		
					<option value="{$count}"{if $count == $day} selected{/if}>{$lang.final_game}</option>
				{else}
					<option value="{$count}"{if $count == $day} selected{/if}>1/{math equation="pow(2, ($numdays-$count+1))/2"} {$lang.final_game}</option>
				{/if}
		{else}
			<option value="{$count}"{if $count == $day} selected{/if}>{$lang.matchday} {$count}</option>
		{/if}
		{/section}		
		</select>
	</td>
  </tr>
  </table>
</form>

<!-- content begin -->

{if $match}
<form action="edit_goals.php" id="edi" name="edi" method="post">
			<input type="hidden" name="competition" id="compet" value="{$competition}" />
			<input type="hidden" name="season" id="season" value="{$season}" />
			<input type="hidden" name="day" id="day" value="{$day}" />
			<input type="hidden" name="match" id="match" value="{$match}" />
			<input type="hidden" name="advlines" id="advlines" value="{$advlines}" />
			<input type="hidden" name="subslines" id="subslines" value="{$subslines}" />
			<input type="hidden" name="save" id="save" value="1" />
			
	<table id="tableshow" width="100%" cellpadding="2" cellspacing="0" border="0">
			<tr>
				<td colspan="4" class="lineeven" align="center">
				{$matchs[0].domclub}
				 - <b>{$matchs[0].buts_dom}</b>
				: 
				<b>{$matchs[0].buts_ext}</b> - 
				{$matchs[0].extclub}
				</td>
			</tr>
			<tr>
				<td class="lineodd" align="center"><b>{$lang.matchdate}</b></td>
				<td class="lineodd" align="center"><b>{$lang.matchhour}</b></td>
				<td class="lineodd" align="center"><b>{$lang.spectators}</b></td>
				<td class="lineodd" align="center"><b>{$lang.temperature}</b></td>
			</tr>	
			<tr>
				<td class="lineeven" align="center"><input type="text" name="datematch" value="{$matchs[0].matchdate}" size="8" maxlength="8"><a title="{$lang.calendar}" href="javascript:void(lookupCalendar(document.edi.datematch.value,'datematch'))"><img alt="{$lang.calendar}" src="templates/portal/images/calendar.png" width="16" height="16" border="0"></a></td>
				<td class="lineeven" align="center"><input type="text" name="hourmatch" value="{$matchs[0].matchhour}" size="5" maxlength="5"></td>
				<td class="lineeven" align="center"><input type="text" name="spect" value="{$matchs[0].spectators}" size="7" maxlength="7"></td>
				<td class="lineeven" align="center"><input type="text" name="temp" value="{$matchs[0].temperature}" size="2" maxlength="2"></td>
            </tr>
			<tr>
				<td class="lineodd" colspan="2">
					<select name="ref" style="width:100%;">
					<option value="0">---{$lang.referee}---</option>
					{foreach item=referee from=$refereeselect}
					<option value="{$referee.id}" {if $referee.id == $matchs[0].id_referee}Selected{/if}>{$referee.lastname} - {$referee.firstname}</option>
					{/foreach}
					</select>
				</td>
				<td class="lineodd">
					<select name="stadium" style="width:100%;">
					<option value="0">---{$lang.stadium}---</option>
					{foreach item=stadium from=$stadiumselect}
					<option value="{$stadium.id}" {if $stadium.id == $matchs[0].id_stadium}Selected{/if}>{$stadium.longname}</option>
					{/foreach}
					</select>
				</td>
				<td class="lineodd">
				<select name="weather" style="width:100%;">
				<option value="0">---{$lang.weather}---</option>
				{foreach item=weather from=$weatherselect}
				<option value="{$weather.id}" {if $weather.id == $matchs[0].id_weather}Selected{/if}>{$weather.val}</option>
				{/foreach}
				</select>
				</td>					
    		</tr>
			{foreach from=$matchs[0].carac_ads item=option}
			<tr>
			  <td class="lineodd" colspan="2"><b>{$option.name}:</b></td>
			  <td class="lineodd" colspan="2">
				{if $option.genre == 1}
					<input type="text" size="20" name="{$option.lib_key}" id="{$option.key_lib}" value="{$option.value}" class="center" />
				{/if}
				{if $option.genre == 2}
					<input type="text" size="8" name="{$option.lib_key}" id="{$option.key_lib}" value="{$option.value}" class="center" />
				{/if}
				{if $option.genre == 3}
					<input type="text" size="8" name="{$option.lib_key}" id="{$option.key_lib}" value="{$option.value}" class="center" />
				{/if}
				{if $option.genre == 4}
					<input type="text" size="15" name="{$option.lib_key}" id="{$option.key_lib}" value="{$option.value}" class="center" />
				{/if}
				{if $option.genre == 5}
					<textarea cols="40" rows="4" name="{$option.lib_key}" id="{$option.key_lib}" wrap="virtual">{$option.value}</textarea>
				{/if}
				{if $option.genre == 6}
					{html_checkbox name=$option.key_lib id=$option.lib_key value=1 checked=$option.set}
				{/if}
				{if $option.genre == 7}	
					<input type="file" name="{$option.lib_key}" id="{$option.lib_key}" size="35" />
				{/if}
			  </td>
			</tr>
			{/foreach}
			<tr>
				<td class="lineeven" colspan="4"><b>{$lang.comments}</b></td>
			</tr>
			<tr>
				<td class="lineodd" colspan="4" align="center">
				<textarea name="plot" style="width:95%; height:150px;">{$matchs[0].plot}</textarea>
				</td>
			</tr>
			<tr>
				<td colspan="4" id="bottompage">&nbsp;</td>
			</tr>
		</table>			
		<br>
		<table id="tableshow" width="100%" border="0" cellspacing="0" cellpadding="2">
			<tr>
				<td id="toppage" colspan="4"><a href="#">{$lang.goals}</a></td>
			</tr>
			<tr>
				<td width="45%">
				<table width="100%" cellspacing="0" cellpadding="2" border="0">
					<tr>
						<td width="70%" align="center"><b>{$lang.player}</b></td>
						<td width="10%" align="center"><b>{$lang.minutes}</b></td>
						<td width="10%" align="center"><b>{$lang.owngoal}</b></td>
						<td width="10%" align="center"><b>{$lang.penalty}</b></td>
					</tr>
					{counter start=0 print=false name=countdom}
					{section name="countdom" start=1 loop=$matchs[0].buts_dom+1}
					{counter assign=count name=countdom}
					{assign var="foo" value="`$count-1`"}
					<tr>
						<td>
								<select id="dom{$count}" name="dom{$count}" style="width:100%;">
								<option value="0"{if !$matchs[0].goalsdom[$foo].id_person} selected{/if}>--------{$lang.dom}---------</option>
								{foreach item=teamdom from=$matchs[0].teamdom}
								<option value="{$teamdom.id}"{if $matchs[0].goalsdom[$foo].id_person == $teamdom.id} selected{/if}>{$teamdom.clubname} - {$teamdom.lastname} {$teamdom.firstname}</option>
								{/foreach}
								<option value="0">--------{$lang.ext}---------</option>
								{foreach item=teamext from=$matchs[0].teamext}
								<option value="{$teamext.id}"{if $matchs[0].goalsdom[$foo].id_person == $teamext.id} selected{/if}>{$teamext.clubname} - {$teamext.lastname} {$teamext.firstname}</option>
								{/foreach}
								</select>
							
						</td>
						<td align="center">
						<input type="text" size="3" value="{$matchs[0].goalsdom[$foo].goal_min}" id="mindom{$count}" name="mindom{$count}">
						</td>
						<td align="center">
						<input name="cscdom{$count}" id="cscdom{$count}" type="checkbox" value="1"{if $matchs[0].goalsdom[$foo].goal_csc} checked{/if}>
						</td>
						<td align="center">
						<input name="pendom{$count}" id="pendom{$count}" type="checkbox" value="1"{if $matchs[0].goalsdom[$foo].goal_pen} checked{/if}>
						</td>
					</tr>
					
					{/section}
				</table>
			</td>
			<td colspan="2">&nbsp;</td>
			<td width="45%">
				<table width="100%" cellspacing="0" cellpadding="2" border="0">
					<tr>
						<td width="70%"><b>{$lang.player}</b></td>
						<td width="10%" align="center"><b>{$lang.minutes}</b></td>
						<td width="10%" align="center"><b>{$lang.owngoal}</b></td>
						<td width="10%" align="center"><b>{$lang.penalty}</b></td>
					</tr>
					{counter start=0 print=false name=countext}
					{section name="countext" start=1 loop=$matchs[0].buts_ext+1}
					{counter assign=count name=countext}
					{assign var="foo" value="`$count-1`"}
					<tr>
						<td align="center">
							<select name="ext{$count}" style="width:100%;">
							<option value="0">--------{$lang.ext}---------</option>
							{foreach item=teamext from=$matchs[0].teamext}
							<option value="{$teamext.id}"{if $matchs[0].goalsext[$foo].id_person == $teamext.id} selected{/if}>{$teamext.clubname} - {$teamext.lastname} {$teamext.firstname}</option>
							{/foreach}
							<option value="0">--------{$lang.dom}---------</option>								
							{foreach item=teamdom from=$matchs[0].teamdom}
							<option value="{$teamdom.id}"{if $matchs[0].goalsext[$foo].id_person == $teamdom.id} selected{/if}>{$teamdom.clubname} - {$teamdom.lastname} {$teamdom.firstname}</option>
							{/foreach}
							</select>						
						</td>
						<td align="center">
						<input id="minext{$count}" name="minext{$count}" type="text" size="3" value="{$matchs[0].goalsext[$foo].goal_min}">
						</td>
						<td align="center">
						<input id="cscext{$count}" name="cscext{$count}" type="checkbox" value="1"{if $matchs[0].goalsext[$foo].goal_csc} checked{/if}>
						</td>
						<td  align="center">
						<input id="penext{$count}" name="penext{$count}" type="checkbox" value="1"{if $matchs[0].goalsext[$foo].goal_pen} checked{/if}>
						</td>
					</tr>
					{/section}
				</table>
			</td>
		</tr>
		<tr>
			<td id="bottompage" colspan="4">&nbsp;</td>
		</tr>
</table>
<br>
<table width="100%" id="tableshow" border="0" cellspacing="0" cellpadding="2">
		<tr>
			<td id="toppage" colspan="4"><a href="#">{$lang.advertissements}</a></td>
		</tr>
		{section name="countadv" start=1 loop=$advlines+1}
		{cycle values="lineeven,lineodd" assign=CLASS print=false}
		{counter assign=count name=countadv}
		{assign var="foo" value="`$count-1`"}
		<tr>
			<td class="{$CLASS}" valign="top">
				<table width"100%" border="0" cellspacing="0" cellpadding="2">
					<tr>
						<td width="70%"><b>{$lang.player}</b></td>
						<td width="10%" align="center"><b>{$lang.minutes}</b></td>
						<td width="10%" align="center"><b>{$lang.yellowcard_abr}</b></td>
						<td width="10%" align="center"><b>{$lang.redcard_abr}</b></td>
					</tr>
					<tr>
					<td  align="center">
					<select name="advertdom{$count}" style="width:100%;">
							<option value="0">--------{$lang.dom}---------</option>								
							{foreach item=teamdom from=$matchs[0].teamdom}
							<option value="{$teamdom.id}"{if $matchs[0].cardsdom[$foo].id_person == $teamdom.id} selected{/if}>{$teamdom.lastname} {$teamdom.firstname}</option>
							{/foreach}
					</select>
					</td>
					<td  align="center">
					<input id="advertdommin{$count}" name="advertdommin{$count}" type="text" size="3" value="{$matchs[0].cardsdom[$foo].card_min}">
					</td>
					<td  align="center">
					<input name="advertdomY{$count}" id="advertdomY{$count}" type="checkbox" value="1"{if $matchs[0].cardsdom[$foo].card_yellow} checked{/if}>
					</td>
					<td  align="center">
					<input name="advertdomR{$count}" id="advertdomR{$count}" type="checkbox" value="1"{if $matchs[0].cardsdom[$foo].card_red} checked{/if}>
					</td>
					</tr>
				</table>
			</td>
			<td class="{$CLASS}" colspan="2">&nbsp;</td>
			<td class="{$CLASS}">
				<table width"100%" border="0" cellspacing="0" cellpadding="2">
					<tr>
						<td width="70%" ><b>{$lang.player}</b></td>
						<td width="10%" align="center"><b>{$lang.minutes}</b></td>
						<td width="10%" align="center"><b>{$lang.yellowcard_abr}</b></td>
						<td width="10%" align="center"><b>{$lang.redcard_abr}</b></td>
					</tr>
					<tr>
					<td align="center">
					<select name="advertext{$count}" style="width:100%;">
							<option value="0">--------{$lang.ext}---------</option>								
							{foreach item=teamext from=$matchs[0].teamext}
							<option value="{$teamext.id}"{if $matchs[0].cardsext[$foo].id_person == $teamext.id} selected{/if}>{$teamext.lastname} {$teamext.firstname}</option>
							{/foreach}
					</select>
					</td>
					<td align="center">
					<input id="advertextmin{$count}" name="advertextmin{$count}" type="text" size="3" value="{$matchs[0].cardsext[$foo].card_min}">
					</td>
					<td align="center">
					<input name="advertextY{$count}" id="advertextY{$count}" type="checkbox" value="1"{if $matchs[0].cardsext[$foo].card_yellow} checked{/if}>
					</td>
					<td align="center">
					<input name="advertextR{$count}" id="advertextR{$count}" type="checkbox" value="1"{if $matchs[0].cardsext[$foo].card_red} checked{/if}>
					</td>
					</tr>
				</table>
			</td>
		</tr>
		{/section}
		<tr>
			<td id="bottompage" colspan="4">&nbsp;</td>
		</tr>			
</table>
<br>
<table width="100%" id="tableshow" border="0" cellspacing="0" cellpadding="2">
		<tr>
			<td id="toppage" colspan="4"><a href="#">{$lang.substitutions}</a></td>
		</tr>
		{section name="countsubs" start=1 loop=$subslines+1}
		{cycle values="lineeven,lineodd" assign=CLASS print=false}
		{counter assign=count name=countsubs}
		{assign var="foo" value="`$count-1`"}
		<tr>
			<td class="{$CLASS}" valign="top" width="48%">
				<table width"100%" border="0" cellspacing="0" cellpadding="2">
					<tr>
						<td width="70%"><b>{$lang.player}</b></td>
						<td width="10%" align="center"><b>{$lang.minutes}</b></td>
					</tr>
					<tr>
						<td  align="center">
						<select name="subsoutdom{$count}" style="width:100%;">
								<option value="0">--------{$lang.dom} {$lang.titular}---------</option>								
								{foreach item=player from=$rooster}
								{if $matchs[0].id_candidate_dom == $player.id_club}
								<option value="{$player.id_person}"{if $matchs[0].subsdom[$foo].id_person_out == $player.id_person} selected{/if}>{$player.lastname} {$player.firstname}</option>
								{/if}
								{/foreach}
						</select>
						</td>
						<td rowspan="2" align="center">
						<input id="subsdommin{$count}" name="subsdommin{$count}" type="text" size="3" value="{$matchs[0].subsdom[$foo].subs_min}">
						</td>
					</tr>
					<tr>
						<td  align="center">
						<select name="subsindom{$count}" style="width:100%;">
								<option value="0">--------{$lang.dom} {$lang.substitute}---------</option>								
								{foreach item=player from=$rooster}
								{if $matchs[0].id_candidate_dom == $player.id_club && $player.type ==3}
								<option value="{$player.id_person}"{if $matchs[0].subsdom[$foo].id_person_in == $player.id_person} selected{/if}>{$player.lastname} {$player.firstname}</option>
								{/if}
								{/foreach}
						</select>
						</td>
					</tr>
				</table>
			</td>
			<td class="{$CLASS}" colspan="2">&nbsp;</td>
			<td class="{$CLASS}" width="48%">
				<table width"100%" border="0" cellspacing="0" cellpadding="2">
					<tr>
						<td width="70%" ><b>{$lang.player}</b></td>
						<td width="10%" align="center"><b>{$lang.minutes}</b></td>
					</tr>
					<tr>
						<td align="center">
						<select name="subsoutext{$count}" style="width:100%;">
								<option value="0">--------{$lang.ext} {$lang.titular}---------</option>								
								{foreach item=player from=$rooster}
								{if $matchs[0].id_candidate_ext == $player.id_club}
								<option value="{$player.id_person}"{if $matchs[0].subsext[$foo].id_person_out == $player.id_person} selected{/if}>{$player.lastname} {$player.firstname}</option>
								{/if}
								{/foreach}
						</select>
						</td>
						<td align="center" rowspan="2">
						<input id="subsextmin{$count}" name="subsextmin{$count}" type="text" size="3" value="{$matchs[0].subsext[$foo].subs_min}">
						</td>
					</tr>
					<tr>
						<td align="center">
						<select name="subsinext{$count}" style="width:100%;">
								<option value="0">--------{$lang.ext} {$lang.substitute}---------</option>								
								{foreach item=player from=$rooster}
								{if $matchs[0].id_candidate_ext == $player.id_club && $player.type == 3}
								<option value="{$player.id_person}"{if $matchs[0].subsext[$foo].id_person_in == $player.id_person} selected{/if}>{$player.lastname} {$player.firstname}</option>
								{/if}
								{/foreach}
						</select>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		{/section}			
		<tr>
   			<td colspan="4">
				<span class="onglet">
				<input type="submit" value="{$lang.save}">
				</span>
			</td>
		</tr>			
</table>
</form>


{else}
<table id="tableshow" width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td colspan="5">
		{counter start=0 print=false name=matchcount}
		{foreach item=match from=$matchs}
		{cycle values="lineeven,lineodd" assign=CLASS print=false}
		<table width="100%" border="0" cellspacing="0" cellpadding="2">
		<tr>
			<td class="{$CLASS}" rowspan="7">
				<table width="100%" border="0" cellspacing="0" cellpadding="2">
				<tr>
					<form action="edit_goals.php" id="edi" name="edi" method="post">
					<input type="hidden" name="competition" id="compet" value="{$competition}" />
					<input type="hidden" name="season" id="season" value="{$season}" />
					<input type="hidden" name="day" id="day" value="{$day}" />
					<input type="hidden" name="match" id="match" value="{$match.id}" />
					<td class="{$CLASS}" width="20%">
						{if $editable || $administrable}
						<span class="onglet">
						<input type="submit" id="submit" value="{$lang.editgoals}" />
						</span>
						{/if}
					</td>
					</form>
				</tr>
				<tr>
					<form action="edit_lineup.php" id="edi" name="lineup" method="post">
					<td class="{$CLASS}" width="20%">
					<input type="hidden" name="match" id="match" value="{$match.id}" />
					<span class="onglet">
					<input type="submit" value="{$lang.lineup}" />
					</span>
					</td>
					</form>
				</tr>
				<tr>
					<form action="show_match.php" id="edi" name="show" method="post">
					<td class="{$CLASS}" width="20%">
					<input type="hidden" name="id" id="match" value="{$match.id}" />
					<span class="onglet">
					<input type="submit" value="{$lang.card} {$lang.match}" />
					</span>
					</td>
					</form>
				</tr>
				</table>
			</td>
		<tr>
		<tr>
			<td class="{$CLASS}" width="30%" align="right"><a href="show_clubs.php?id={$match.id_candidate_dom}"><b>{$match.domclub}</b></a></td>
			<td class="{$CLASS}" width="10%" align="center"><b>{$match.buts_dom}</b></td>
			<td class="{$CLASS}" width="10%" align="center"><b>{$match.buts_ext}</b></td>
			<td class="{$CLASS}" width="30%"><a href="show_clubs.php?id={$match.id_candidate_ext}"><b>{$match.extclub}</b></a></td>
		</tr>
		{if $match.goalsdom or $match.goalsext}
		<tr>
			<td class="compet-match-list"><b><u>{$lang.kickers}</u></b></td>
			<td class="{$CLASS}" colspan="2">&nbsp;</td>
			<td class="compet-match-list"><b><u>{$lang.kickers}</u></b></td>
		</tr>
		<tr>
			<td class="{$CLASS}" width="45%">
			{section name="countext" start=0 loop=$match.goalsdom}
			<a href="show_persons.php?id={$match.goalsdom[countext].id_person}">{$match.goalsdom[countext].lastname} {$match.goalsdom[countext].firstname}</a> {$match.goalsdom[countext].goal_min} '{if $match.goalsdom[countext].goal_csc} ({$lang.owngoal}){/if}{if $match.goalsdom[countext].goal_pen} ({$lang.penalty}){/if}<br>					
			{/section}
			</td>
			<td class="{$CLASS}" colspan="2">&nbsp;</td>
			<td class="{$CLASS}" width="45%">
			{section name="countext" start=0 loop=$match.goalsext}
			<a href="show_persons.php?id={$match.goalsext[countext].id_person}">{$match.goalsext[countext].lastname} {$match.goalsext[countext].firstname}</a> {$match.goalsext[countext].goal_min} '{if $match.goalsext[countext].goal_csc} ({$lang.owngoal}){/if}{if $match.goalsext[countext].goal_pen} ({$lang.penalty}){/if}<br>					
			{/section}
			</td>						
		</tr>
		{/if}
		{if $match.cardsdom or $match.cardsext}
		<tr>
			<td class="compet-match-list"><b><u>{$lang.advertissements}</u></b></td>
			<td class="{$CLASS}" colspan="2">&nbsp;</td>
			<td class="compet-match-list"><b><u>{$lang.advertissements}</u></b></td>
		</tr>
		<tr>
			<td class="{$CLASS}">
			{section name="countext" start=0 loop=$match.cardsdom}
			<a href="show_persons.php?id={$match.cardsdom[countext].id_person}">{$match.cardsdom[countext].lastname} {$match.cardsdom[countext].firstname}</a> {$match.cardsdom[countext].card_min} '{if $match.cardsdom[countext].card_yellow} ({$lang.yellowcard_abr}){/if}{if $match.cardsdom[countext].card_red} ({$lang.redcard_abr}){/if}<br>					
			{/section}
			</td>
			<td class="{$CLASS}" colspan="2">&nbsp;</td>
			<td class="{$CLASS}">
			{section name="countext" start=0 loop=$match.cardsext}
			<a href="show_persons.php?id={$match.cardsext[countext].id_person}">{$match.cardsext[countext].lastname} {$match.cardsext[countext].firstname}</a> {$match.cardsext[countext].card_min} '{if $match.cardsext[countext].card_yellow} ({$lang.yellowcard_abr}){/if}{if $match.cardsext[countext].card_red} ({$lang.redcard_abr}){/if}<br>					
			{/section}
			</td>						
		</tr>
		{/if}
		</table>
		{counter assign=count name=matchcount}		
		{/foreach}
		</td>
	</tr>
  	<tr>
		<td colspan="5">	
		<span class="onglet">
		<input type="submit" value="{$lang.save}" accesskey="s" />
		</span>
		</td>
	</tr>  
</table>
{/if}

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