{*
  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">
<table id="tableshow" border="0" cellspacing="0" cellpadding="2" width="100%">
	<tr>
		<td id="toppage" colspan="2"> 
		{if $mycompetition}<a href="show_competitions.php?id={$mycompetition}">{$competdata.longname}  - {$lang.season} {if $competdata.oneyear}{$nameseason.season}{else}{$nameseason.season} / {$namenextyear}</a>{/if}{/if}
		</td>
	</tr>
		<tr>
		<form action="edit_candidates.php" id="editparam" name="ediparam" method="post">
		<input type="hidden" name="addseason" id="addseason" value="1" />
		<input type="hidden" name="competition" value="{$mycompetition}"/>
		<input type="hidden" name="season" value="{$myseason}"/>
		<td>
		{$lang.add} {$lang.season}
		<input type="text" size="6" name="newseason" value="" maxlenght="4">
		<input type="submit" value="{$lang.add}">
		</td>
		</form>
		<td align="right"><b>{$lang.seasons} :</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}
			  {assign var="nextyear" value="`$season.season+1`"}
				{if $competdata.oneyear}
					<option value='{$season.id}' {if $myseason==$season.id}selected{/if}>{$season.season}</option>
				{else}
					<option value='{$season.id}' {if $myseason==$season.id}selected{/if}>{$season.season} / {$nextyear}</option>
				{/if}
			  {/foreach}
			  </select>
		</td>
	</tr>
	<tr>
		<td colspan="2">
		<!-- /actions -->
		{if $editable || $administrable}
		{if $administrable}
		<form action="edit_competitions.php" name="editform">
				<input type="hidden" name="id" value="{$mycompetition}"/>
				<span class="onglet">
				<input type="submit" value="{$lang.edit}" />
				</span>
		</form>
		<form action="delete.php" name="deleteform">
				<input type="hidden" name="id" value="{$mycompetition}"/>
				<input type="hidden" name="cat" value="3"/>
				<span class="onglet">
				<input type="submit" value="{$lang.del}" onclick="return(confirm('{$competdata.longname|escape:javascript}: {$lang.msg_really_del}?'))" />
				</span>
		</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}"/>				
				<span class="onglet">
				<input type="submit" value="{$lang.editseason}" />
				</span>
		</form>		
		<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}
	{/if}
		</td>
	</tr>
	<tr>
		<td colspan="2">
		{if $mycompetition}
			{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.statistics}" {if !$mycompetition} 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="&laquo;" {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="&raquo;" {if !$next_id}disabled="disabled"{/if} accesskey="." />
				</span>
			</form>
			{/if}

		</td>
	</tr>
	<tr>
		<td id="bottompage" colspan="2">&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}

<div id="pagecontent">

		
<form action="edit_candidates.php" id="editparam" name="ediparam" method="post">
<input type="hidden" name="mycompet" id="mycompet" value="{$mycompetition}" />
<input type="hidden" name="season" id="season" value="{$myseason}" />
<input type="hidden" name="saveparam" id="saveparam" value="1" />
<input type="hidden" name="save" id="save" value="0" />
<br /><br>


<table id="tableshow" border="0" cellspacing="0" cellpadding="2" width="100%">
		 <tr>
			<td colspan="6" id="toppage"><a href="#">{$lang.defineparams}</a></td>
  		</tr>
		<tr>
			<td class="lineodd" colspan="6" align="right">{$lang.goreturn}<input type="checkbox" name="ar"{if $params.ar} CHECKED{/if}></td>
  		</tr>
		<tr>  	
			<td class="lineeven">{$lang.accession} :</td>
			<td class="lineeven" align="center"><input size="1" type="text" value="{if $params.accession}{$params.accession}{else}0{/if}" name="accession"></td>
			<td class="lineeven">{$lang.stopping} :</td>
			<td class="lineeven" align="center"><input size="1" type="text" value="{if $params.barrage}{$params.barrage}{else}0{/if}" name="barrage"></td>
			<td class="lineeven">{$lang.relegation} :</td>
			<td class="lineeven" align="center"><input size="1" type="text" value="{if $params.relegation}{$params.relegation}{else}0{/if}" name="relegation"></td>			
		</tr>
		<tr>  	
			<td class="lineeven">{$lang.victory} {$lang.dom} :</td>
			<td class="lineeven" align="center"><input size="1" type="text" value="{if $params.dom_vic}{$params.dom_vic}{else}0{/if}" name="dom_vic"></td>
			<td class="lineeven">{$lang.nul} {$lang.dom} :</td>
			<td class="lineeven" align="center"><input size="1" type="text" value="{if $params.dom_nul}{$params.dom_nul}{else}0{/if}" name="dom_nul"></td>
			<td class="lineeven">{$lang.defeat} {$lang.dom} :</td>
			<td class="lineeven" align="center"><input size="1" type="text" value="{if $params.dom_def}{$params.dom_def}{else}0{/if}" name="dom_def"></td>			
		</tr>
		<tr>  	
			<td class="lineodd">{$lang.victory} {$lang.ext} :</td>
			<td class="lineodd" align="center"><input size="1" type="text" value="{if $params.ext_vic}{$params.ext_vic}{else}0{/if}" name="ext_vic"></td>
			<td class="lineodd">{$lang.nul} {$lang.ext} :</td>
			<td class="lineodd" align="center"><input size="1" type="text" value="{if $params.ext_nul}{$params.ext_nul}{else}0{/if}" name="ext_nul"></td>
			<td class="lineodd">{$lang.defeat} {$lang.ext} :</td>
			<td class="lineodd" align="center"><input size="1" type="text" value="{if $params.ext_def}{$params.ext_def}{else}0{/if}" name="ext_def"></td>			
		</tr>
		<tr>
			<td colspan="6"><b>{$lang.after} {$lang.extendtime}</b></td>
		</tr>
		<tr>  	
			<td class="lineeven">{$lang.victory} {$lang.dom} :</td>
			<td class="lineeven" align="center"><input size="1" type="text" value="{if $params.dom_vic_ext}{$params.dom_vic_ext}{else}0{/if}" name="dom_vic_ext"></td>
			<td class="lineeven">{$lang.nul} {$lang.dom} :</td>
			<td class="lineeven" align="center"><input size="1" type="text" value="{if $params.dom_nul_ext}{$params.dom_nul_ext}{else}0{/if}" name="dom_nul_ext"></td>
			<td class="lineeven">{$lang.defeat} {$lang.dom} :</td>
			<td class="lineeven" align="center"><input size="1" type="text" value="{if $params.dom_def_ext}{$params.dom_def_ext}{else}0{/if}" name="dom_def_ext"></td>			
		</tr>
		<tr>  	
			<td class="lineodd">{$lang.victory} {$lang.ext} :</td>
			<td class="lineodd" align="center"><input size="1" type="text" value="{if $params.ext_vic_ext}{$params.ext_vic_ext}{else}0{/if}" name="ext_vic_ext"></td>
			<td class="lineodd">{$lang.nul} {$lang.ext} :</td>
			<td class="lineodd" align="center"><input size="1" type="text" value="{if $params.ext_nul_ext}{$params.ext_nul_ext}{else}0{/if}" name="ext_nul_ext"></td>
			<td class="lineodd">{$lang.defeat} {$lang.ext} :</td>
			<td class="lineodd" align="center"><input size="1" type="text" value="{if $params.ext_def_ext}{$params.ext_def_ext}{else}0{/if}" name="ext_def_ext"></td>			
		</tr>

		<tr>
			<td colspan="6"><b>{$lang.gametime}</b></td>
		</tr>
		<tr>  	
			<td class="lineeven" colspan="2">{$lang.numberofperiod} :</td>
			<td class="lineeven" align="center"><input size="1" type="text" value="{if $params.period}{$params.period}{else}0{/if}" name="period"></td>
			<td class="lineeven" colspan="2">{$lang.timeofperiod} :</td>
			<td class="lineeven" align="center"><input size="1" type="text" value="{if $params.period_time}{$params.period_time}{else}0{/if}" name="period_time"></td>
		</tr>
		<tr>  	
			<td class="lineodd" colspan="2">{$lang.numberofextension} :</td>
			<td class="lineodd" align="center"><input size="1" type="text" value="{if $params.extension}{$params.extension}{else}0{/if}" name="extension"></td>
			<td class="lineodd" colspan="2">{$lang.timeofextension} :</td>
			<td class="lineodd" align="center"><input size="1" type="text" value="{if $params.extension_time}{$params.extension_time}{else}0{/if}" name="extension_time"></td>
		</tr>
		<tr>
			<td colspan="6"><b>{$lang.tableorder}</b></td>
		</tr>
		<tr>
			<td colspan="3" class="lineeven">{$lang.order} 1 :
			<select name="taborder1">
			<option value="">--------{$lang.order} 1--------</option>
			{foreach from=$compettaborder key=k item=v}
			<option value="{$k}"{if $params.taborder[0] == $k} selected{/if}>{$v}</option>
			{/foreach}
			</select>
			</td>
			<td colspan="3" class="lineeven">{$lang.order} 2 :
			<select name="taborder2">
			<option value="">--------{$lang.order} 2--------</option>
			{foreach from=$compettaborder key=k item=v}
			<option value="{$k}"{if $params.taborder[1] == $k} selected{/if}>{$v}</option>
			{/foreach}
			</select>
			</td>
		</tr>
		<tr>
			<td colspan="3" class="lineodd">{$lang.order} 3 :
			<select name="taborder3">
			<option value="">--------{$lang.order} 3--------</option>
			{foreach from=$compettaborder key=k item=v}
			<option value="{$k}"{if $params.taborder[2] == $k} selected{/if}>{$v}</option>
			{/foreach}
			</select>
			</td>
			<td colspan="3" class="lineodd">{$lang.order} 4 :
			<select name="taborder4">
			<option value="">--------{$lang.order} 4--------</option>
			{foreach from=$compettaborder key=k item=v}
			<option value="{$k}"{if $params.taborder[3] == $k} selected{/if}>{$v}</option>
			{/foreach}
			</select>
			</td>
		</tr>			
		<tr>
			<td class="td-value" colspan="6">
			<span class="onglet">
			<input type="submit" STYLE="width:100%" VALUE="{$lang.save}">
			</span>
			</td>
		</tr>
		<tr>
			<td id="bottompage" colspan="6">&nbsp;</td>
		</tr>
</table>

</form>

<form action="edit_candidates.php" id="ediadm" name="ediadm" method="post" onSubmit="javascript:return CheckAlbumForm(this,'{$lang.wanttochange}','{$lang.mustbe2}',2);">
<input type="hidden" name="mycompet" id="mycompet" value="{$mycompetition}" />
<input type="hidden" name="season" id="season" value="{$myseason}" />
<input type="hidden" name="saveparam" id="saveparam" value="0" />
<input type="hidden" name="save" id="save" value="1" />

<br />
<table id="tableshow" cellspacing="0" cellpadding="2" width="100%">
  <tr>
	<td colspan="3" id="toppage"><a href="#">{$lang.definecandidate}</a></td>
  <tr>
  	<td width="40%"><h3>{$lang.clubs}:</h3></td>
  	<td>&nbsp;</td>
  	<td width="40%"><h3>{$lang.participants}:</h3></td>
  </tr>
  <tr>
      <td class="td-value" align="right">
		  <select size="25" style="width:150px; font-size:12px;" name="club" ondblclick="affecte(this.form.candidate,this.form.club); this.form.numcandidates.value = this.form.candidate.options.length + ' {$lang.clubs}';">
			{foreach item=club from=$clubs}
			<option value="{$club.id}">{$club.shortname} ({$club.country})</option>
			{/foreach}
		  </select>			  
      </td>	  
	  <td class="td-opt" valign="middle" align="center"><br /><br /><br /><br />  
	  <span id="numcandidates">
	  <input type="text" name="numcandidates" value="0 {$lang.clubs}" size="6" style="border:0px; width:150px; text-align:center; font-size:14px; font-weight:600;">
      </span>
	  <span class="onglet">
		<input type="button" onclick="affectetout(this.form.candidate,this.form.club);  this.form.numcandidates.value = this.form.candidate.options.length + ' {$lang.clubs}';" value="{$lang.add} &raquo;"><br><br>
	  </span>
	  <span class="onglet">
		<input type="button" onclick="affectetout(this.form.club,this.form.candidate);  this.form.numcandidates.value = this.form.candidate.options.length + ' {$lang.clubs}';" value="&laquo; {$lang.del}">
	  </span>
	  
	  </td>
      <td class="td-value" align="left">
		  <select size="25" style="width:150px; font-size:12px;" id="candidate" name="candidate[]" multiple="yes" ondblclick="affecte(this.form.club,this.form.candidate);  this.form.numcandidates.value = this.form.candidate.options.length + ' {$lang.clubs}';">
			{foreach item=candidate from=$candidates}
			<option value='{$candidate.id_club}'>{$candidate.clubname} ({$candidate.country})</option>
			{/foreach}
		  </select>
      </td>   
   </tr>
   <tr>
   	<td class="td-value" colspan="3">
		<span class="onglet">
		<input type="submit" STYLE="width:100%" VALUE="{$lang.save}">
		</span>
	</td>
	</tr> 
</table>

</form>
</div>

<script language="JavaScript" type="text/javascript">
	document.ediadm.numcandidates.value = document.ediadm.candidate.options.length + ' {$lang.teams}';
	document.edi.longname.focus();
</script>
<!-- /content -->
