{*
  Template for the edit interface
  $Id: manage_competitions.tpl,v 1.00 2007/04/22 14:00:00
*}

<!-- {$smarty.template} -->
<div id="toppage">{if $competition.id}<a href="show_competitions.php?id={$competition.id}">{$competition.q_longname}</a>{else}<a href="#">{$lang.newcompetition}</a>{/if}</div>

<div id="actions">
<table id="tableshow" width="100%" cellpadding="2" cellspacing="0" border="0">
	<tr>
		<td>
			<form action="competitions.php" method="get" name="show">
				<input type="hidden" name="id" value="{$competition.id}" />
				<span class="onglet">
				<input type="submit"  value="{$lang.competitions}" />
				</span>
			</form>
		</td>
	</tr>
</table>
		<!-- /actions -->
</div>	 



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

<div id="pagecontent">
{if $http_error}<div class="center">{$http_error}</div>{/if}
<form action="edit_competitions.php" id="edi" name="edi" method="post" enctype="multipart/form-data">
  <input type="hidden" name="id" id="id" value="{$competition.id}" />
  <input type="hidden" name="save" id="save" value="1" />

<table id="tableshow" width="100%" cellpadding="2" cellspacing="0" border="0">
	<tr>
		<td class="title-classement" align="center">{$lang.categorys}</td>
		<td class="title-classement" align="center">{$lang.actions}</td>
		<td class="title-classement" align="center">{$lang.moveto}</td>
		
	</tr>
	{foreach item=competition from=$competitions name=compet}
 	{cycle values="lineeven,lineodd" assign=CLASS print=false}
	<tr>
		<td class="{$CLASS}"><b>» {$competition.shortname} :</b></td>
		<td class="{$CLASS}">
		{assign var="moveup" value="`$competition.subpos-1`"}
		{assign var="movedown" value="`$competition.subpos+1`"}
		{if !$smarty.foreach.compet.first}
		<a title="{$lang.moveup}" href="manage_competitions.php?op=moveup&id={$competition.id}&pos={$moveup}&subcompet={$competition.subcompet}"><img src="{$url_moveup}" alt="{$lang.moveup}" border="0"></a>
		{/if}
		{if !$smarty.foreach.compet.last}
		<a title="{$lang.movedown}" href="manage_competitions.php?op=movedown&id={$competition.id}&pos={$movedown}&subcompet={$competition.subcompet}"><img src="{$url_movedown}" alt="{$lang.movedown}" border="0"></a>
		{/if}
		<a title="{$lang.edit}" href="edit_competitions.php?id={$competition.id}"><img src="{$url_edit}" alt="$lang.edit" border="0"></a>
		<a title="{$lang.del}" href="delete.php?id={$competition.id}&cat=3"><img src="{$url_delete}" alt="{$lang.del}" border="0"></a>
		</td>
		<td class="{$CLASS}" align="right">
		<select name="subcompet" style="width:200px">
			<option value="0">---{$lang.competition}---</option>
			{foreach item=subcompet from=$competitions}
			<option value="{$subcompet.id}" {if $subcompet.id == $competition.subcompet}Selected{/if}>{$subcompet.longname}</option>
			{/foreach}
		</select>
		</td>
	</tr>
	{/foreach}
	<tr>
		<td colspan="3">	
			<div>
				<span class="onglet">
				<input style="width:100%;" type="submit" value="{$lang.save}" id="savebutton" accesskey="s" />
				</span>
				<span class="onglet">
				<input style="width:100%;" type="button" value="{$lang.back}" id="backbutton" onclick="javascript:history.go(-1);" accesskey="b" />
				</span>
			</div>
		</td>
	</tr>
</table>
</form>


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