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

<!-- {$smarty.template} -->
<div id="title">{if $club.id}<a href="show_clubs.php?id=$club.id">{$club.q_longname}</a>{else}{$lang.newclub}{/if}</div>
{if $club.id}
<div id="actions">
   <div id="barre-onglet">
		<form action="show_clubs.php" method="get" name="show">
			<input type="hidden" name="id" value="{$club.id}" />
			<input type="submit" class="onglet" value="{$lang.view}" />
		</form>
		<form action="show_teams.php" name="editform">
				<input type="hidden" name="id" value="{$club.id}"/>
				<input type="submit" class="onglet" value="{$lang.teamplayers}" />
		</form>
		<form action="show_calendarteams.php" name="editform">
				<input type="hidden" name="id" value="{$club.id}"/>
				<input type="submit" class="onglet" value="{$lang.calendar}" />
		</form>
	{if $clubstats}
		<form action="stats_clubs.php" name="editform">
			<input type="hidden" name="id" value="{$club.id}"/>
			<input class="onglet" type="submit" value="{$lang.statistics}" />
		</form>
	{/if}
	{if $club.seegallery}
        <form action="gallery.php" name="galleryform">
            <input type="hidden" name="subcat" value="{$club.id}"/>
            <input type="hidden" name="cat" value="1" />
            <input type="submit" value="{$lang.gallery}" class="onglet"/>
        </form>
	{/if}
	{if $club.commentable}
			<form action="comments.php" name="mkcommentform">
				<input type="hidden" name="subcat" value="{$club.id}"/>
				<input type="hidden" name="cat" value="1" />
				<input type="submit" value="{$lang.comment}" class="onglet"/>
			</form>
	{/if}
	{if $club.prev_id || $club.next_id}
			<form action="show_clubs.php" name="prevform">
				<input type="hidden" name="id" value="{$club.prev_id}"/>
				<input type="submit" class="onglet" value="<" {if !$club.prev_id}disabled="disabled"{/if} accesskey="," />
			</form>
			<form action="show_clubs.php" name="nextform">
				<input type="hidden" name="id" value="{$club.next_id}"/>
				<input type="submit" class="onglet" value=">" {if !$club.next_id}disabled="disabled"{/if} accesskey="." />
			</form>
	{/if}
	</div>
	<!-- /actions -->
	{if $editable || $administrable}
	<div id="barre-season">
		{if $administrable}
		<form action="edit_clubs.php" name="editform">
				<input type="submit" value="{$lang.newdata}" class="onglet"/>
		</form>
		{/if}
		{if $editable || $administrable}
		<form action="edit_clubs.php" name="editform">
				<input type="hidden" name="id" value="{$club.id}"/>
				<input type="submit" value="{$lang.edit}" class="onglet"/>
		</form>
		{/if}
		{if $administrable}
		<form action="delete.php" name="deleteform">
				<input type="hidden" name="id" value="{$club.id}"/>
				<input type="hidden" name="cat" value="1"/>
				<input type="submit" value="{$lang.del}" onclick="return(confirm('{$club.shorttname|escape:javascript}: {$lang.msg_really_del}?'))" class="onglet"/>
		</form>
		{/if}
		{if $editable || $administrable}
		<form action="edit_teams.php" name="matchsform">
				<input type="hidden" name="id" value="{$club.id}"/>
				<input type="hidden" name="season" value="{$season}"/>				
				<input type="submit" value="{$lang.editteams}" class="onglet"/>
		</form>
		{/if}
	</div>
	{/if}
</div>
{/if}
<script language="JavaScript" type="text/javascript" src="javascript/edit.js"></script>


{if $http_error}<div class="center">{$http_error}</div>{/if}


<form action="edit_clubs.php" id="edi" name="edi" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" id="id" value="{$club.id}" />
<input type="hidden" name="save" id="save" value="1" />
<div id="pagecontent">

<div id="edit">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
  <tr>
      <td class="td-value">

      <table width="100%" cellspacing="0" cellpadding="0" border="0">
        <tr>
          <td class="td-opt"><h4>{$lang.name}:</h4></td>
          <td class="td-value">
            <input type="text" name="shortname" id="shortname" value="{$club.q_shortname}"  size="40" maxlength="255" />
          </td>
        </tr>

        <tr>
          <td class="td-opt"><h4>{$lang.longname}:</h4></td>
          <td class="td-value">
            <input type="text" name="longname" id="longname" value="{$club.q_longname}"  size="40" maxlength="255" />
          </td>
        </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.city}:</h4></td>
          <td class="td-value">
            <input type="text" name="city" id="city" value="{$club.q_city}"  size="40" maxlength="255" />
          </td>
        </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.aka}:</h4></td>
          <td class="td-value">
            <input type="text" name="aka" id="longname" value="{$club.q_aka}"  size="40" maxlength="255" />
          </td>
        </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.nationalteam}:</h4></td>
          <td class="td-value">
            <input type="checkbox" name="nationalteam" id="nationalteam" value="1"{if $club.q_nationalteam}checked{/if} />
          </td>
        </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.country}:</h4></td>
          <td class="td-value">
		  	<select name="country">
			<option value="0">---{$lang.country}---</option>
			{foreach item=country from=$countryselect}
			<option value="{$country.id}" {if $country.id == $club.q_country}Selected{/if}>{$country.val}</option>
			{/foreach}
			</select>
          </td>
        </tr>
        <tr>
          <td class="td-opt"><h4>{$lang.creation}:</h4></td>
          <td class="td-value"><input type="text" name="creation" id="creation" value="{$club.q_creation}" size="8" maxlength="4" />  (YYYY)</td>
        </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.cessation}:</h4></td>
          <td class="td-value"><input type="text" name="complete" id="complete" value="{$club.q_complete}" size="8" maxlength="4" />  (YYYY)</td>
        </tr>
		<tr>
		<td class="td-opt"><b>» {$lang.president} :</b></td>
        <td class="td-value">	
		<select name="id_president">
		<option value="0">---{$lang.president}---</option>
		{foreach item=president from=$presidentselect}
		<option value="{$president.id}" {if $president.id == $club.q_id_president}Selected{/if}>{$president.lastname} {$president.firstname}</option>
		{/foreach}
		</select>
		</td>
	   </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.officialwebsite}:</h4></td>
          <td class="td-value"><input type="text" name="website" id="website" value="{$club.q_website}" size="25" maxlength="255" /></td>
        </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.email}:</h4></td>
          <td class="td-value"><input type="text" name="email" id="email" value="{$club.q_email}" size="25" maxlength="255" /></td>
        </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.tel}:</h4></td>
          <td class="td-value"><input type="text" name="tel" id="tel" value="{$club.q_tel}" size="25" maxlength="255" /></td>
        </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.fax}:</h4></td>
          <td class="td-value"><input type="fax" name="fax" id="fax" value="{$club.q_fax}" size="25" maxlength="255" /></td>
        </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.adresse}:</h4></td>
          <td class="td-value"><textarea cols="30" rows="8" name="adresse" id="adresse" wrap="virtual">{$club.q_adresse}</textarea></td>
        </tr>		
      </table>
      </td>
      <td class="td-value">
      <table width="100%" cellspacing="0" cellpadding="0" border="0">
	  	<tr>
          <td class="td-opt"><h4>{$lang.stadium}:</h4></td>
          <td class="td-value">	
				<select name="id_stadium">
					<option value="0">---{$lang.stadium}---</option>
					{foreach item=stadium from=$stadiumselect}
					<option value="{$stadium.id}" {if $stadium.id == $club.q_id_stadium}Selected{/if}>{$stadium.longname}</option>
					{/foreach}
					</select>
					</td>
        </tr>		
        <tr>
          <td class="td-opt"><h4>{$lang.logourl}:</h4></td>
          <td class="td-value">
          	<input type="text" name="imgurl" id="imgurl" value="{$club.q_imgurl}"  size="40" maxlength="255" />
          </td>
        </tr>		
        <tr>
          <td class="td-opt"><h4>{$lang.logoupload}:</h4></td>
          <td class="td-value"><input type="file" name="coverupload" id="coverupload" size="35" /></td>
        </tr>
		
		{counter start=0 print=false name=optcount}
		{foreach from=$club.carac_ads item=option}
		{counter assign=count name=optcount}
		<tr>
		  <td class="td-opt"><h4>» {$option.name}:</h4></td>
		  <td class="td-value">
			{if $option.genre == 1}
				<input type="text" size="20" name="{$option.lib_key}" id="{$option.key_lib}" value="{$option.value}" class="center" />
			{/if}
			{if $option.genre == 2}
				<input type="text" size="8" name="{$option.lib_key}" id="{$option.key_lib}" value="{$option.value}" class="center" />
			{/if}
			{if $option.genre == 3}
				<input type="text" size="45" name="{$option.lib_key}" id="{$option.key_lib}" value="{$option.value}" class="center" />
			{/if}
			{if $option.genre == 4}
				<input type="text" size="15" name="{$option.lib_key}" id="{$option.key_lib}" value="{$option.value}" class="center" />
			{/if}
			{if $option.genre == 5}
				<textarea cols="40" rows="4" name="{$option.lib_key}" id="{$option.key_lib}" wrap="virtual">{$option.value}</textarea>
			{/if}
			{if $option.genre == 6}
				{html_checkbox name=$option.key_lib id=$option.lib_key value=1 checked=$option.set}
			{/if}
			{if $option.genre == 7}	
				<input type="file" name="{$option.lib_key}" id="{$option.lib_key}" size="35" />
			{/if}
		  </td>
		</tr>
		{/foreach}
		
        <tr>
          <td class="td-opt"><h4>{$lang.comments}:</h4></td>
          <td class="td-value"><textarea cols="30" rows="8" name="plot" id="plot" wrap="virtual">{$club.q_plot}</textarea></td>
        </tr>
      </table>
      </td>
    </tr>
	<tr>
	<td class="td-value" colspan="2">	
		<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>

<br />
	{if $administrable}
	<form action="edit_clubs.php" id="ediadm" name="ediadm" method="post" onSubmit="javascript:return CheckAlbumForm(this,'{$lang.wanttochange}','{$lang.mustbe2}',1);">
    <input type="hidden" name="id" id="id" value="{$club.id}" />
    <input type="hidden" name="ownersave" id="ownersave" value="1" />
	<table id="tableshow" width="100%" cellpadding="2" cellspacing="0" border="0">
	  <tr>
		<td colspan="3" id="toppage"><a href="#">{$lang.defineadmins}</a></td>
	  <tr>
		<td width="40%" align="right"><h3>{$lang.members}:</h3></td>
		<td>&nbsp;</td>
		<td width="40%"><h3>{$lang.admins}:</h3></td>
	  </tr>
	  <tr>
		  <td class="td-value" align="right">
			  <select size="10" style="width:150px; font-size:12px;" name="members" id="members" ondblclick="affecte(this.form.candidate,this.form.members); this.form.numowners.value = this.form.candidate.options.length + ' {$lang.admins}';">
				{foreach item=member from=$members}
				<option value="{$member.id}">{$member.name}</option>
				{/foreach}
			  </select>			  
		  </td>	  
		  <td class="td-opt" valign="middle" align="center"><br /><br /><br /><br />  
		  <span id="numcandidates">
		  <input type="text" name="numowners" value="0 {$lang.admins}" size="6" style="border:0px; width:150px; text-align:center; font-size:14px; font-weight:600;">
		  </span>
		  <input class="btn-search" type="button" style="width:150px;" onclick="affectetout(this.form.candidate,this.form.members);  this.form.numowners.value = this.form.candidate.options.length + ' {$lang.admins}';" value="{$lang.add} &raquo;"><br />
		  <input class="btn-search" type="button" style="width:150px;" onclick="affectetout(this.form.members,this.form.candidate);  this.form.numowners.value = this.form.candidate.options.length + ' {$lang.admins}';" value="&laquo; {$lang.del}">
		  </td>
		  <td class="td-value" align="left">
			  <select size="10" style="width:150px; font-size:12px;" id="candidate" name="candidate[]" multiple="yes" ondblclick="affecte(this.form.members,this.form.candidate);  this.form.numowners.value = this.form.candidate.options.length + ' {$lang.admins}';">
				{foreach item=candidate from=$owners}
				<option value='{$candidate.id}'>{$candidate.name}</option>
				{/foreach}
			  </select>
		  </td>   
	   </tr>
	   <tr>
			<td width="40%"><input class="btn-search" style="width:100%;" type="submit" value="{$lang.save}" id="savebutton" accesskey="s" /></td>
			<td>&nbsp;</td>
			<td width="40%"><input class="btn-search" style="width:100%;" type="button" value="{$lang.back}" id="backbutton" onclick="javascript:history.go(-1);" accesskey="b" /></td>
		</tr>
	</table>
	</form>
   {/if}




<script language="JavaScript" type="text/javascript">
	document.ediadm.numowners.value = document.ediadm.candidate.options.length + ' {$lang.admins}';
	document.edi.shortname.focus();
</script>

</div>
<!-- /edit -->

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