{*
  Template for the club detailview
  $Id: show_stadiums.tpl,v 1.00 2006/10/25 20:14:18
*}

<!-- {$smarty.template} -->
{assign var="namenextyear" value="`$nameseason.season+1`"}
<div id="title"><a href="show_competitions.php?id={$competition.id}">{$competition.longname}</a></div>

<table id="actions" border="0" cellpadding="0" cellspacing="0" width="100%">
	<tr>
		<td id="barre-onglet">
		<form action="show_competitions.php" name="editform">
				<input type="hidden" name="id" value="{$competition.id}"/>
				<input type="hidden" name="action" value="card"/>
				<input type="submit" class="{if $action=='card'}onglet-on{else}onglet{/if}" value="{$lang.card}" />
		</form>
		<form action="prizelist.php" name="tableform">
				<input type="hidden" name="competition" value="{$competition.id}"/>
				<input class="onglet" type="submit" class="onglet" value="{$lang.prizelist}" {if !$competition.id}disabled="disabled"{/if} />
		</form>
		{if $season}
		<form action="show_matchs.php" name="calendarform">
					<input type="hidden" name="competition" value="{$competition.id}"/>
					<input type="submit" class="onglet" value="{$lang.calendar}" {if !$competition}disabled="disabled"{/if} />
		</form>
			{if $statsactive}
			<form action="stats_competitions.php" name="statsform">
					<input type="hidden" name="id" value="{$competition.id}"/>
					<input type="hidden" name="season" value="{$season}"/>
					<input class="onglet" type="submit" value="{$lang.statistics}" {if !$competition.id} disabled="disabled"{/if} />
			</form>
			{/if}
		<form action="show_tables.php" name="tableform">
					<input type="hidden" name="competition" value="{$competition.id}"/>
					<input type="submit" class="onglet" value="{$lang.classement}" {if !$competition}disabled="disabled"{/if} />
		</form>
		{/if}
		{if $seegallery}
			<form action="gallery.php" name="galleryform">
				<input type="hidden" name="subcat" value="{$competition}"/>
				<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="{$competition}"/>
					<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}
    </td>
	</tr>
	
{if $editable || $administrable}
	<tr>
		<td id="barre-season">
		{if $administrable}
			<form action="edit_competitions.php" name="editform">
					<input class="onglet" type="submit" value="{$lang.newdata}" />
			</form>
			<form action="edit_competitions.php" name="editform">
					<input type="hidden" name="id" value="{$competition.id}"/>
					<input type="submit" value="{$lang.edit}" class="onglet"/>
			</form>
			<form action="delete.php" name="deleteform">
					<input type="hidden" name="id" value="{$competition.id}"/>
					<input type="hidden" name="cat" value="3"/>
					<input class="onglet" type="submit" value="{$lang.del}" onclick="return(confirm('{$competition.lastname|escape:javascript}: {$lang.really_del}?'))" />
			</form>
		{/if}
		{if $editable || $administrable}
			<form action="edit_candidates.php" name="candidateform">
					<input type="hidden" name="competition" value="{$competition.id}"/>
					<input type="hidden" name="season" value="{$season}"/>				
					<input type="submit" value="{$lang.editseason}" class="onglet"/>
			</form>
			<form action="edit_prizelist.php" name="candidateform">
				<input type="hidden" name="competition" value="{$competition.id}"/>
				<input type="submit" value="{$lang.prizelist}" class="onglet"/>
			</form>
			<form action="edit_penalitys.php" name="penalityform">
					<input type="hidden" name="competition" value="{$competition.id}"/>
					<input type="hidden" name="season" value="{$season}"/>				
					<input type="submit" value="{$lang.editpenality}" class="onglet"/>
			</form>
			<form action="edit_days.php" name="dayform">
					<input type="hidden" name="competition" value="{$competition.id}"/>
					<input type="hidden" name="season" value="{$season}"/>				
					<input type="submit" value="{$lang.editday}" class="onglet"/>
			</form>
			<form action="edit_matchs.php" name="matchsform">
					<input type="hidden" name="competition" value="{$competition.id}"/>
					<input type="hidden" name="season" value="{$season}"/>				
					<input type="submit" value="{$lang.editmatchs}" class="onglet"/>
			</form>
			<form action="edit_goals.php" name="matchsform">
					<input type="hidden" name="competition" value="{$competition.id}"/>
					<input type="hidden" name="season" value="{$season}"/>				
					<input type="submit" value="{$lang.editgoals}" class="onglet"/>
			</form>
		{/if}
	</td>
	</tr>
{/if}
</table>


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

<form action="edit_prizelist.php" id="prizelist" name="prizelist" method="get">
<input type="hidden" name="competition" id="compet" value="{$competition.id}" />
<input type="hidden" name="save" id="save" value="1" />
<input type="hidden" name="pageno" id="pageno" value="{$pageno}" />
<div id="pagecontent">
<table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr>
	<td>
		<span class="footer-links">
		{if $pageno && $maxpageno}
			{if $pageno != 1}<a href="?pageno={$pageno-1}&competition={$competition.id}"><img src="templates/classic/images/back.gif" align="absmiddle" hspace="5" width="22" height="18"></a>{/if}Page {$pageno} sur {$maxpageno}
			{if $pageno != $maxpageno}<a href="?pageno={$pageno+1}&competition={$competition.id}"><img src="templates/classic/images/next.gif" align="absmiddle" hspace="5" width="22" height="18"></a>{/if}
			{$totalresults} {$lang.records}.
			{counter start=0 print=false name=maxpagecount}
			{section name="maxpageLoop" start=0 loop=$maxpageno}
			{counter assign=count name=maxpagecount}
			<a class="{if $count == $pageno}page-tab-on{else}page-tab{/if}" href="?pageno={$count}&competition={$competition.id}">{$count}</a> - 
			{/section}
		{/if}
		</span>
	</td>
</tr>
</table>
<table width="100%" style="top:0px" border="0" cellpadding="0" cellspacing="1">
 <tr>
 
	{cycle values="listeven,listodd" assign=CLASS print=false}
 	{counter start=0 print=false name=competitioncount}
	{counter start=0 print=false name=countseason}
	{assign var="countseason" value="0"}
	{foreach item=season from=$seasons}
	{assign var="nextyear" value="`$season.season+1`"}
		<td width="{math equation="floor(100/x)" x=$competitionslistcolumns}%">
			<table width="100%" style="top:0px" border="0" cellpadding="0" cellspacing="1">
				<tr>
					<td class="td-opt">{if $competition.oneyear}{$season.season}{else}{$season.season} / {$nextyear}{/if}</td>
				</tr>
				<tr>
					<td class="td-value" align="center">
						<select name="season{$season.id}" class="playerselect">
						
						<option value="0">---{$lang.team}---</option>
						{foreach item=club from=$clubs}
						<option value="{$club.id}" {if $club.id == $list[$season.id].id}Selected{/if}>{$club.shortname}</option>
						{/foreach}
						</select>
					</td>
				</tr>
			</table>
		</td>
	  	{counter assign=countseason name=countseason}
		{counter assign=count name=competitioncount}
		{if $count == $competitionslistcolumns}
			{counter start=0 print=false name=competitioncount}
			</tr>

		{/if}
		{php}flush();{/php}
	{/foreach}
	
	{if $count != 0}
		{section name="columnLoop" start=$count loop=$competitionslistcolumns}
			<td class="{$CLASS}">&nbsp;</td>
		{/section}
		</tr>

	{/if}
	</td>
</tr>
<tr>
	<td class="td-value" colspan="{$competitionslistcolumns}">	
		<div id="barre-season">
		  <input style="width:100%;" type="submit" class="btn-search" value="{$lang.save}" id="savebutton" accesskey="s" />
		</div>
	</td>
</tr>
</table>  
</form>

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