{*
  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`"}
<div id="title">{if $mycompetition}<a href="show_competitions.php?id={$mycompetition}{if $myseason}&season={$myseason}{/if}">{$competdata.longname} - {$lang.season} {if $competdata.oneyear}{$nameseason.season}{else}{$nameseason.season} / {$namenextyear}</a>{/if} {/if}</div>

{if $mycompetition}
<div id="actions">
    <div id="barre-onglet">

	{if $mycompetition}
		<form action="show_competitions.php" method="get" name="show">
			<input type="hidden" name="id" value="{$mycompetition}" />
			<input type="submit" class="onglet" value="{$lang.card}" />
		</form>
		<form action="prizelist.php" name="tableform">
			<input type="hidden" name="competition" value="{$mycompetition}"/>
			<input type="submit" class="onglet" value="{$lang.prizelist}" {if !$mycompetition}disabled="disabled"{/if} />
		</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}"/>
				<input type="submit" class="onglet" value="{$lang.calendar}" {if !$mycompetition}disabled="disabled"{/if} />
	</form>
		{if $statsactive}
			<form action="stats_competitions.php" name="statsform">
				<input type="hidden" name="id" value="{$mycompetition}"/>
				<input type="hidden" name="season" value="{$myseason}"/>
				<input class="onglet" type="submit" value="{$lang.statistics}" {if !$mycompetition} disabled="disabled"{/if} />
			</form>
		{/if}
	<form action="show_tables.php" name="tableform">
				<input type="hidden" name="competition" value="{$mycompetition}"/>
				<input type="hidden" name="season" value="{$myseason}"/>
				<input type="submit" class="onglet" value="{$lang.classement}" {if !$mycompetition}disabled="disabled"{/if} />
	</form>
	{/if}
	{if $seegallery}
        <form action="gallery.php" name="galleryform">
            <input type="hidden" name="subcat" value="{$mycompetition}"/>
            <input type="hidden" name="cat" value="2" />
            <input type="submit" value="{$lang.gallery}" class="onglet"/>
        </form>
	{/if}
	{if $commentable}
			<form action="comments.php" name="mkcommentform">
				<input type="hidden" name="subcat" value="{$mycompetition}"/>
				<input type="hidden" name="cat" value="2" />
				<input type="submit" value="{$lang.comments}" class="onglet"/>
			</form>
	{/if}
	{if $prev_id || $next_id}
			<form action="show_competitions.php" name="prevform">
				<input type="hidden" name="id" value="{$prev_id}"/>
				<input type="submit" class="onglet" value="<" {if !$prev_id}disabled="disabled"{/if} accesskey="," />
			</form>
			<form action="show_competitions.php" name="nextform">
				<input type="hidden" name="id" value="{$next_id}"/>
				<input type="submit" class="onglet" value=">" {if !$next_id}disabled="disabled"{/if} accesskey="." />
			</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}
	</div>
	<!-- /actions -->
	{if $administrable || $editable}
	<div id="barre-season">
		{if $administrable}
		<form action="edit_competitions.php" name="editform">
				<input type="submit" value="{$lang.newdata}" class="onglet"/>
		</form>
		<form action="edit_competitions.php" name="editform">
				<input type="hidden" name="id" value="{$mycompetition}"/>
				<input type="submit" value="{$lang.edit}" class="onglet"/>
		</form>
		<form action="delete.php" name="deleteform">
				<input type="hidden" name="id" value="{$mycompetition}"/>
				<input type="hidden" name="cat" value="3"/>
				<input type="submit" value="{$lang.del}" onclick="return(confirm('{$actiontitle|escape:javascript}: {$lang.msg_really_del}?'))" class="onglet"/>
		</form>
		{/if}
		{if $editable || $administrable}
		<form action="edit_candidates.php" name="candidateform">
				<input type="hidden" name="competition" value="{$mycompetition}"/>
				<input type="hidden" name="season" value="{$myseason}"/>				
				<input type="submit" value="{$lang.editseason}" class="onglet"/>
		</form>
		<form action="edit_penalitys.php" name="penalityform">
				<input type="hidden" name="competition" value="{$mycompetition}"/>
				<input type="hidden" name="season" value="{$myseason}"/>				
				<input type="submit" value="{$lang.editpenality}" class="onglet"/>
		</form>
		<form action="edit_days.php" name="dayform">
				<input type="hidden" name="competition" value="{$mycompetition}"/>
				<input type="hidden" name="season" value="{$myseason}"/>				
				<input type="submit" value="{$lang.editday}" class="onglet"/>
		</form>
		<form action="edit_matchs.php" name="matchsform">
				<input type="hidden" name="competition" value="{$mycompetition}"/>
				<input type="hidden" name="season" value="{$myseason}"/>				
				<input type="submit" value="{$lang.editmatchs}" class="onglet"/>
		</form>
		<form action="edit_goals.php" name="matchsform">
				<input type="hidden" name="competition" value="{$mycompetition}"/>
				<input type="hidden" name="season" value="{$myseason}"/>				
				<input type="submit" value="{$lang.editgoals}" class="onglet"/>
		</form>
		{/if}
	</div>
	{/if}
</div>
{/if}

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


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

<div id="pagecontent">
<br />
<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" />
<div id="edit" align="center">
{if $candidates}  
<table border="0" width="100%" style="border:1px solid #000000;" cellspacing="0" cellpadding="2">
	<tr>
  		<td class="title-classement" style="border-bottom:1px solid #000000;" align="left" colspan="5"><h3>{$lang.definepenalitys} :</h3></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"><INPUT TYPE="submit" CLASS="button" STYLE="width:100%" VALUE="{$lang.save}"></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}
</div>
<!-- /edit -->
</form>
</div>
<!-- /content -->
