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

<!-- {$smarty.template} -->

<div>
<br>
<table id="tableshow" border="0" cellpadding="2" cellspacing="0" width="100%">
	<tr>
		<td id="toppage">
		{if $myclub}<a href="show_clubs.php?id={$myclub}">{$club.longname}  - {$lang.season} {$nameseason.season}</a>{else} {/if}
		</td>
	</tr>
{if $seasonselect}
	<tr>
		<td align="right">
			<b>{$lang.seasons} :</b> 
			<form action="edit_teams.php" name="seasonform">
			<input type="hidden" name="id" value="{$myclub}"/>
			<select name="season" onchange="submit();">
				<option value="0">---{$lang.season}---</option>
			{foreach item=season from=$seasonselect}
			{assign var="nextyear" value="`$season.season+1`"}
				<option value="{$season.id}" {if $season.id == $myseason}Selected{/if}>{$season.season} / {$nextyear}</option>
			{/foreach}
			</select>
			</form>
		
		</td>
	</tr>
{/if}
{if $myclub}
	{if $editable || $administrable}
		<tr>
		<td>
		<!-- /actions -->
		{if $administrable}
		<form action="edit_clubs.php" name="editform">
				<span class="onglet-admin">
				<input type="submit" value="{$lang.newdata}" />
				</span>
		</form>
		{/if}
		{if $editable || $administrable}
		<form action="edit_clubs.php" name="editform">
				<input type="hidden" name="id" value="{$myclub}"/>
				<span class="onglet-admin">
				<input type="submit" value="{$lang.edit}" />
				</span>
		</form>
		{/if}
		{if $administrable}
		<form action="delete.php" name="deleteform">
				<input type="hidden" name="id" value="{$myclub}"/>
				<input type="hidden" name="cat" value="1"/>
				<span class="onglet-admin">
				<input type="submit" value="{$lang.del}" onclick="return(confirm('{$nameclub|escape:javascript}: {$lang.mag_really_del}?'))" />
				</span>
		</form>
		{/if}
		{if $editable || $administrable}
		<form action="edit_teams.php" name="matchsform">
				<input type="hidden" name="id" value="{$myclub}"/>
				<input type="hidden" name="season" value="{$myseason}"/>				
				<span class="onglet-admin">
				<input type="submit" value="{$lang.editteams}" />
				</span>
		</form>
		{/if}
		</td>
	</tr>
	{/if}
	<tr>
		<td>
		{if $myclub}
			<form action="show_clubs.php" method="get" name="show">
				<input type="hidden" name="id" value="{$myclub}" />
				<span class="onglet">
				<input type="submit"  value="{$lang.view}" />
				</span>
			</form>
			<form action="show_teams.php" name="editform">
					<input type="hidden" name="id" value="{$myclub}"/>
					<span class="onglet">
					<input type="submit"  value="{$lang.teamplayers}" />
					</span>
			</form>
			<form action="show_calendarteams.php" name="editform">
					<input type="hidden" name="id" value="{$myclub}"/>
					<span class="onglet">
					<input type="submit"  value="{$lang.calendar}" />
					</span>
			</form>
			{if $clubstats}
			<form action="stats_clubs.php" name="editform">
					<input type="hidden" name="id" value="{$myclub}"/>
					<span class="onglet">
					<input type="submit" value="{$lang.statistics}" />
					</span>
			</form>
			{/if}
		{/if}
		{if $seegallery}
			<form action="gallery.php" name="galleryform">
				<input type="hidden" name="subcat" value="{$myclub}"/>
				<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="{$myclub}"/>
					<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_clubs.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_clubs.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>

{/if}
	<tr><td id="bottompage">&nbsp;</td></tr>
</table>
</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_teams.php" id="edi" name="edi" method="post" onSubmit="javascript:return CheckAlbumForm(this,'{$lang.wanttochange}','{$lang.mustbe2}',1);">
<input type="hidden" name="myclub" id="myclub" value="{$myclub}" />
<input type="hidden" name="season" id="season" value="{$myseason}" />
<input type="hidden" name="save" id="save" value="1" />
<table id="tableshow" width="100%" cellspacing="0" cellpadding="0" border="0">
  	<tr>
		<td id="toppage" colspan="3">
		<a href="#">{$lang.teammanagement}</a>
		</td>
	</tr>
	<tr>
      <td class="lineodd" align="right" width="40%">
		  <b>{$lang.players} :</b><br>
		  <select size="25" style="width:100%;" name="players"  multiple="yes" OnDblClick="javascript:affecte(this.form.players,this.form.candidate)">
			{foreach item=player from=$players}
			<option value="{$player.id}">{$player.lastname} - {$player.firstname}</option>
			{/foreach}
		  </select>			  
      </td>
	  
	  <td class="lineodd" style="vertical-align:middle" align="center">
	  <span class="onglet">
			<input type="button" OnClick="javascript:affectetout(this.form.candidate,this.form.players)" value="{$lang.add} &raquo;">
	  </span>
	  <span class="onglet">
			<input type="button" OnClick="javascript:affectetout(this.form.players,this.form.candidate)" value="&laquo; {$lang.del}">
	  </span>
	  </td>
      <td class="lineodd" align="left" width="40%">
		  <b>{$lang.players} :</b><br>
		  <select size="25" style="width:100%;" id="candidate" name="candidate[]" multiple="yes" OnDblClick="javascript:affecte(this.form.candidate,this.form.players)">
			{foreach item=teamplayer from=$teamplayers}
			<option value='{$teamplayer.id}'>{$teamplayer.lastname} {$teamplayer.firstname}</option>
			{/foreach}
		  </select>
      </td>   
   </tr>
   <tr>
		<td class="lineodd" colspan="3">{$lang.helpmirrorteam} :
			<select name="seasoncopy">
				<option value="" selected>---{$lang.season}---</option>
			{foreach item=season from=$seasonselect}
			{assign var="nextyear" value="`$season.season+1`"}
				<option value="{$season.id}">{$season.season} / {$nextyear}</option>
			{/foreach}
			</select>
		</td>
   </tr>
   <tr>
		<td class="lineeven" colspan="3">	
			<span class="onglet">
			  <input type="submit" value="{$lang.save}" id="savebutton" accesskey="s" />
			</span>
		</td>
	</tr> 
</table>
</form>
</div>

<!-- /content -->
