{*
  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}">{$competdata.longname}  - {$lang.season} {$nameseason.season} / {$namenextyear}</a>{else} {/if}</div>
<div id="actions">
    <div id="barre-onglet">
{if $mycompetition}
	{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>
	{/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}
	<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}
	  {assign var="nextyear" value="`$season.season+1`"}
			<option value='{$season.id}' {if $myseason==$season.id}selected{/if}>{$season.season} / {$nextyear}</option>
	  {/foreach}
	  </select>
	</div>
	<!-- /actions -->
	{if $editable || $administrable}
	<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('{$competdata.longname|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>
			{if !$competdata.type}
			<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>
			{/if}
			<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}
		{if $administrable}
		<form action="edit_candidates.php" id="editparam" name="ediparam" method="post">
		<input type="hidden" name="addseason" id="addseason" value="1" />
		<input type="hidden" name="mycompet" id="mycompet" value="{$mycompetition}" />
		<input type="hidden" name="season" id="season" value="{$myseason}" />
		{$lang.add} {$lang.season}
		<input type="text" size="6" name="newseason" value="" maxlenght="4">
		<input type="submit" value="{$lang.add}">
		</form>
		{/if}
	</div>
	{/if}
{/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">
<br />
<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" />
<div id="editparam" align="center">
<table border="0" cellspacing="0" cellpadding="2" width="100%" style="border:1px solid #000000;">
		 <tr>
  	  		<td class="title-classement" style="border-bottom:1px solid #000000;" colspan="4">{$lang.defineparams}</td>
			<td class="title-classement" style="border-bottom:1px solid #000000;" colspan="2" align="right">{$lang.goreturn}<input type="checkbox" name="ar"{if $params.ar} CHECKED{/if}></td>
  		</tr>
		<tr>  	
			<td class="td-opt">{$lang.accession} :</td>
			<td class="td-value" align="center"><input size="1" type="text" value="{if $params.accession}{$params.accession}{else}0{/if}" name="accession"></td>
			<td class="td-opt">{$lang.stopping} :</td>
			<td class="td-value" align="center"><input size="1" type="text" value="{if $params.barrage}{$params.barrage}{else}0{/if}" name="barrage"></td>
			<td class="td-opt">{$lang.relegation} :</td>
			<td class="td-value" align="center"><input size="1" type="text" value="{if $params.relegation}{$params.relegation}{else}0{/if}" name="relegation"></td>			
		</tr>
		<tr>  	
			<td class="td-opt">{$lang.victory} {$lang.dom} :</td>
			<td class="td-value" align="center"><input size="1" type="text" value="{if $params.dom_vic}{$params.dom_vic}{else}0{/if}" name="dom_vic"></td>
			<td class="td-opt">{$lang.nul} {$lang.dom} :</td>
			<td class="td-value" align="center"><input size="1" type="text" value="{if $params.dom_nul}{$params.dom_nul}{else}0{/if}" name="dom_nul"></td>
			<td class="td-opt">{$lang.defeat} {$lang.dom} :</td>
			<td class="td-value" 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="td-opt">{$lang.victory} {$lang.ext} :</td>
			<td class="td-value" align="center"><input size="1" type="text" value="{if $params.ext_vic}{$params.ext_vic}{else}0{/if}" name="ext_vic"></td>
			<td class="td-opt">{$lang.nul} {$lang.ext} :</td>
			<td class="td-value" align="center"><input size="1" type="text" value="{if $params.ext_nul}{$params.ext_nul}{else}0{/if}" name="ext_nul"></td>
			<td class="td-opt">{$lang.defeat} {$lang.ext} :</td>
			<td class="td-value" 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 class="title-classement" style="border-bottom:1px solid #000000;" colspan="6"><b>{$lang.after} {$lang.extendtime}</b></td>
		</tr>
		<tr>  	
			<td class="td-opt">{$lang.victory} {$lang.dom} :</td>
			<td class="td-value" 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="td-opt">{$lang.nul} {$lang.dom} :</td>
			<td class="td-value" 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="td-opt">{$lang.defeat} {$lang.dom} :</td>
			<td class="td-value" 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="td-opt">{$lang.victory} {$lang.ext} :</td>
			<td class="td-value" 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="td-opt">{$lang.nul} {$lang.ext} :</td>
			<td class="td-value" 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="td-opt">{$lang.defeat} {$lang.ext} :</td>
			<td class="td-value" 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 class="title-classement" style="border-bottom:1px solid #000000;" colspan="6"><b>{$lang.gametime}</b></td>
		</tr>
		<tr>  	
			<td class="td-opt" colspan="2">{$lang.numberofperiod} :</td>
			<td class="td-value" align="center"><input size="1" type="text" value="{if $params.period}{$params.period}{else}0{/if}" name="period"></td>
			<td class="td-opt" colspan="2">{$lang.timeofperiod} :</td>
			<td class="td-value" 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="td-opt" colspan="2">{$lang.numberofextension} :</td>
			<td class="td-value" align="center"><input size="1" type="text" value="{if $params.extension}{$params.extension}{else}0{/if}" name="extension"></td>
			<td class="td-opt" colspan="2">{$lang.timeofextension} :</td>
			<td class="td-value" 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 class="title-classement" style="border-bottom:1px solid #000000;" colspan="6"><b>{$lang.tableorder}</b></td>
		</tr>
		<tr>
			<td colspan="3" class="td-value">{$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="td-value">{$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="td-value">{$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="td-value">{$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"><INPUT TYPE="submit" CLASS="button" STYLE="width:100%" VALUE="{$lang.saveparams}"></td>
	</tr>
	</table>
</div>
</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" />
<div id="edit" align="center">
<br /><br />  
<table style="border:1px solid #000000;" border="0" cellspacing="0" cellpadding="2" width="100%">
  <tr>
  	  <td class="title-classement" style="border-bottom:1px solid #000000;" colspan="3">{$lang.definecandidate}</td>
  </tr>
  <tr id="barre-classement">
  	<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:250px; font-size:12px;" name="club" ondblclick="Ajouter(this.form.club,this.form.candidate); 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 />
	  <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; background-color:transparent;">  
	  <input type="button" class="button" style="width:75px;" onclick="Ajouter(this.form.club,this.form.candidate)" value="{$lang.add} >>"><br><br>
	  <input type="button" class="button" style="width:75px;" onclick="Effacer(this.form.candidate,this.form.club)" value="<< {$lang.del}">
	  </td>
      <td class="td-value" align="left">
		  <select size="25" style="width:250px; font-size:12px;" id="candidate" name="candidate[]" multiple="yes" ondblclick="Effacer(this.form.candidate,this.form.club); 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"><INPUT TYPE="submit" CLASS="button" STYLE="width:100%" VALUE="{$lang.save}"></td>
	</tr> 
</table>
</div>
<!-- /edit -->
</form>
</div>
<!-- /content -->
<script language="JavaScript" type="text/javascript">
	document.ediadm.numcandidates.value = document.ediadm.candidate.options.length + ' {$lang.teams}';
	document.edi.longname.focus();
</script>
