{*
  Template for the edit interface
  $Id: edit_candidates.tpl,v 1.00 2006/10/26 20:00:00
*}

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

<br>
<div id="actions">
{if $mycompetition}
<table id="tableshow" border="0" width="100%" cellspacing="0" cellpadding="2">
	<tr>
		<td id="toppage">
		{if $mycompetition}<a href="show_competitions.php?id={$mycompetition}{if $myseason}&season={$myseason}{/if}">{$competdata.longname} - {$lang.season} {$nameseason.season} / {$namenextyear}</a>{else} {/if}
		</td>
	</tr>
	<tr>
		<td>
		{if $administrable}
			<form action="edit_competitions.php" name="editform">
					<input type="hidden" name="id" value="{$mycompetition}"/>
					<span class="onglet-admin">
					<input type="submit" value="{$lang.edit}" />
					</span>
			</form>
			<form action="edit_candidates.php" name="candidateform">
					<input type="hidden" name="competition" value="{$mycompetition}"/>
					<input type="hidden" name="season" value="{$myseason}"/>				
					<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="{$mycompetition}"/>
					<input type="hidden" name="season" value="{$myseason}"/>				
					<span class="onglet-admin">
					<input type="submit" value="{$lang.editpenality}" />
					</span>
			</form>
		{/if}
		{if $editable || $administrable}
			<form action="edit_prizelist.php" name="candidateform">
				<input type="hidden" name="competition" value="{$mycompetition}"/>
				<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="{$mycompetition}"/>
				<input type="hidden" name="season" value="{$myseason}"/>				
				<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="{$mycompetition}"/>
					<input type="hidden" name="season" value="{$myseason}"/>				
					<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="{$mycompetition}"/>
					<input type="hidden" name="season" value="{$myseason}"/>				
					<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="{$mycompetition}"/>
					<input type="hidden" name="season" value="{$myseason}"/>				
					<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="{$mycompetition}"/>
					<input type="hidden" name="season" value="{$myseason}"/>				
					<span class="onglet-admin">
					<input type="submit" value="{$lang.editgoals}" />
					</span>
			</form>
			{/if}
		</td>
	</tr>
	<tr>
		<td>
		{if $mycompetition}
			<form action="show_competitions.php" method="get" name="show">
				<input type="hidden" name="id" value="{$mycompetition}" />
				<span class="onglet">
				<input type="submit"  value="{$lang.card}" />
				</span>
			</form>
		{/if}
		{if $myseason}
		<form action="show_matchs.php" name="calendarform">
					<input type="hidden" name="competition" value="{$mycompetition}"/>
					<input type="hidden" name="season" value="{$myseason}"/>
					<span class="onglet">
					<input type="submit"  value="{$lang.calendar}" {if !$mycompetition}disabled="disabled"{/if} />
					</span>
		</form>
			{if $statsactive}
			<form action="stats_competitions.php" name="statsform">
				<input type="hidden" name="id" value="{$mycompetition}"/>
				<input type="hidden" name="season" value="{$myseason}"/>
				<span class="onglet">
				<input type="submit" value="{$lang.stats}" {if !$competition.id} disabled="disabled"{/if} />
				</span>
			</form>
			{/if}
		<form action="show_tables.php" name="tableform">
					<input type="hidden" name="competition" value="{$mycompetition}"/>
					<input type="hidden" name="season" value="{$myseason}"/>
					<span class="onglet">
					<input type="submit"  value="{$lang.classement}" {if !$mycompetition}disabled="disabled"{/if} />
					</span>
		</form>
		{/if}
		{if $seegallery}
			<form action="gallery.php" name="galleryform">
				<input type="hidden" name="subcat" value="{$mycompetition}"/>
				<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="{$mycompetition}"/>
					<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}
		{if $seasons}
		<b>{$lang.season} : </b>
		  <select id="season" name="season" onchange="if(this.options[this.selectedIndex].value) window.location.href='edit_candidates.php?competition={$mycompetition}&season='+this.options[this.selectedIndex].value;">
		  {foreach item=season from=$seasons}
				<option value='{$season.id}' {if $myseason==$season.id}selected{/if}>{$season.season}</option>
		  {/foreach}
		  </select>
		{/if}
		</td>
	</tr><!-- /actions -->

	<tr>
		<td id="bottompage">&nbsp;</td>
	</tr>
</table>
{/if}
</div>

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


{if $http_error}<div class="center">{$http_error}</div>{/if}
<br />
<div id="pagecontent">

<form action="edit_penalitys.php" id="edi" name="edi" method="post">
<input type="hidden" name="mycompet" id="mycompet" value="{$mycompetition}" />
<input type="hidden" name="season" value="{$myseason}"/>
<input type="hidden" name="numcandidate" value="{$numcandidate}"/>
<input type="hidden" name="save" id="save" value="1" />

{if $candidates}  
<table id="tableshow" border="0" width="100%" cellspacing="0" cellpadding="2">
	<tr>
  		<td id="toppage" align="left" colspan="5"><a href="#">{$lang.definepenalitys} :</a></td>
	</tr>
	<tr id="barre-classement">
		<td><h3>{$lang.team}</h3></td>
		<td><h3>{$lang.penality}</h3></td>
		<td>&nbsp;</td>
		<td><h3>{$lang.team}</h3></td>
		<td><h3>{$lang.penality}</h3></td>
	</tr>
	<tr>
	{counter start=0 print=false name=mycount}
  		{foreach item=candidate from=$candidates}
		
    	{if $candidate.id_club}			
				<td class="td-opt"><b>{$candidate.clubname}</b> - ({$candidate.country})</td>
				<td class="td-value"><input type="text" name="pen{$candidate.id_club}" value="{if $candidate.penality}{$candidate.penality}{else}0{/if}" size="5"></td>			
  		{/if}
		{if $count==1}
			{counter start=0 print=false name=mycount}
			</tr><tr>
		{else}
		<td class="td-value">&nbsp;</td>
		{counter assign=count name=mycount}
		{/if}		
  		{/foreach}
	</tr>
	<tr>
   		<td class="td-value" colspan="5">
			<span class="onglet">
			<input type="submit" value="{$lang.save}">
			</span>
		</td>
	</tr> 
</table>
{else}
<br><br>
<table border="0" cellspacing="2" cellpadding="2">
  <tr><td>{$lang.noparticipants}</td></tr>
  <tr><td style="text-align:center;"><input type="button" class="button" value="{$lang.back}" onclick="javascript:history.go(-1)"></td></tr>
</table>
{/if}


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