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

<!-- {$smarty.template} -->
<div id="title">{if $person.id}<a href="show_persons.php?id=$person.id">{$person.q_lastname} {$person.q_firstname}</a>{else}{$lang.newperson}{/if}</div>
<div id="actions">
    <div id="barre-onglet">
{if $person.id || $xmlimport}
	{if $person.id}
		<form action="show_persons.php" method="get" name="show">
			<input type="hidden" name="id" value="{$person.id}" />
			<input type="submit" class="onglet" value="{$lang.view}" />
		</form>
	{else}
		<form action="edit_persons.php" method="get" name="import">
			<input type="hidden" name="import" value="xml" />
			<input type="submit" class="onglet" value="Import" />
		</form>
	{/if}
	{if $person.seegallery}
        <form action="gallery.php" name="galleryform">
            <input type="hidden" name="subcat" value="{$person.id}"/>
            <input type="hidden" name="cat" value="2" />
            <input type="submit" value="{$lang.gallery}" class="onglet"/>
        </form>
	{/if}
	{if $person.commentable}
			<form action="comments.php" name="mkcommentform">
				<input type="hidden" name="subcat" value="{$person.id}"/>
				<input type="hidden" name="cat" value="2" />
				<input type="submit" value="{$lang.comment}" class="onglet"/>
			</form>
	{/if}
	{if $person.prev_id || $person.next_id}
			<form action="show_persons.php" name="prevform">
				<input type="hidden" name="id" value="{$person.prev_id}"/>
				<input type="submit" class="onglet" value="<" {if !$person.prev_id}disabled="disabled"{/if} accesskey="," />
			</form>
			<form action="show_persons.php" name="nextform">
				<input type="hidden" name="id" value="{$person.next_id}"/>
				<input type="submit" class="onglet" value=">" {if !$person.next_id}disabled="disabled"{/if} accesskey="." />
			</form>
	{/if}
	</div>
	<!-- /actions -->
	<div id="barre-season">
		<form action="edit_persons.php" name="editform">
				<input type="submit" value="{$lang.newdata}" class="onglet"/>
		</form>
		<form action="edit_persons.php" name="editform">
				<input type="hidden" name="id" value="{$person.id}"/>
				<input type="submit" value="{$lang.edit}" class="onglet"/>
		</form>
		<form action="delete.php" name="deleteform">
				<input type="hidden" name="id" value="{$person.id}"/>
				<input type="hidden" name="cat" value="8"/>
				<input type="submit" value="{$lang.del}" onclick="return(confirm('{$person.lastname|escape:javascript}: {$lang.msg_really_del}?'))" class="onglet"/>
		</form>
		{if $person.q_type == 1 && $playerstats}
		<form action="edit_statspersons.php" name="editstatsform">
				<input type="hidden" name="id" value="{$person.id}"/>
				<input type="submit" value="{$lang.stats}" class="onglet"/>
		</form>
		{/if}
	</div>
{/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">

<div id="edit">
<form action="edit_persons.php" id="edi" name="edi" method="post" enctype="multipart/form-data">
<table id="tableshow" width="100%" cellpadding="2" cellspacing="1" border="0">

<input type="hidden" name="id" id="id" value="{$person.id}" />
<input type="hidden" name="save" id="save" value="1" />
  <tr>
      <td>
      <table width="100%" cellpadding="2" cellspacing="1" border="0">
        <tr>
          <td><h4>{$lang.lastname}:</h4></td>
          <td>
            <input type="text" name="lastname" id="longname" value="{$person.q_lastname}"  size="40" maxlength="255" />
          </td>
        </tr>		
		<tr>
          <td><h4>{$lang.firstname}:</h4></td>
          <td>
            <input type="text" name="firstname" id="firstname" value="{$person.q_firstname}"  size="40" maxlength="255" />
          </td>
        </tr>
		<tr>
          <td><h4>{$lang.aka}:</h4></td>
          <td>
            <input type="text" name="aka" id="aka" value="{$person.q_aka}"  size="40" maxlength="255" />
          </td>
        </tr>
		<tr>
          <td><h4>{$lang.country}:</h4></td>
          <td>
		  	<select name="country">
			<option value="0">---{$lang.country}---</option>
			{foreach item=country from=$countryselect}
			<option value="{$country.id}" {if $country.id == $person.q_country}Selected{/if}>{$country.val}</option>
			{/foreach}
			</select>
          </td>
        </tr>
		</table>

		<table width="100%" cellpadding="2" cellspacing="1" border="0">
        <tr>
          <td><h4>{$lang.birthday}:</h4></td>
          <td><input type="text" name="birthday" id="birthday" value="{$person.q_birthday}" size="10" maxlength="10" />  (DDMMYYYY)</td>
        </tr>
		<tr>
          <td><h4>{$lang.birthcity}:</h4></td>
          <td><input type="text" name="birthcity" id="birthcity" value="{$person.q_birthcity}" size="40" maxlength="255" /></td>
        </tr>
		<tr>
          <td><h4>{$lang.deathday}:</h4></td>
          <td><input type="text" name="deathday" id="deathday" value="{$person.q_deathday}" size="10" maxlength="10" />  (DDMMYYYY)</td>
        </tr>
		<tr>
          <td><h4>{$lang.position}:</h4></td>
          <td>
		  	<select name="position">
			<option value="0">---{$lang.position}---</option>
			{foreach item=pos from=$positions}
			<option value="{$pos.id}" {if $pos.id == $person.q_position}Selected{/if}>{$pos.val}</option>
			{/foreach}
			</select>
		  </td>
        </tr>
		<tr>
          <td><h4>{$lang.height}:</h4></td>
          <td><input type="text" name="height" id="height" value="{$person.q_height}" size="5" maxlength="3" /> cm</td>
        </tr>
		<tr>
          <td><h4>{$lang.weight}:</h4></td>
          <td><input type="text" name="weight" id="weight" value="{$person.q_weight}" size="5" maxlength="3" /> Kg</td>
        </tr>
      </table>
      </td>
      <td>
      <table width="100%" cellpadding="2" cellspacing="1" border="0">
        <tr>
          <td><h4>{$lang.logourl}:</h4></td>
          <td>
          	<input type="text" name="imgurl" id="imgurl" value="{$person.q_imgurl}"  size="40" maxlength="255" />
          </td>
        </tr>		
        <tr>
          <td><h4>{$lang.logoupload}:</h4></td>
          <td><input type="file" name="coverupload" id="coverupload" size="35" /></td>
        </tr>
        <tr>
          <td><h4>{$lang.international}:</h4></td>
          <td>
			<input name="international" id="international" value="{$person.q_international}" type="checkbox">(0 - {$lang.no} / 1 - {$lang.yes})
		  </td>
        </tr>
		<tr>
          <td><h4>{$lang.type}:</h4></td>
          <td>
		  <select name="type">
			<option value="0">---{$lang.type}---</option>
			{foreach item=types from=$personstype}
			<option value="{$types.id}" {if $types.id == $person.q_type}Selected{/if}>{$types.val}</option>
			{/foreach}
		  </select>
		  </td>
        </tr>
		
		{foreach from=$person.carac_ads item=option}
		<tr>
		  <td><h4>{$option.name}:</h4></td>
		  <td>
			{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><h4>{$lang.comments}:</h4></td>
          <td><textarea cols="30" rows="8" name="plot" id="plot" wrap="virtual">{$person.q_plot}</textarea></td>
        </tr>
      </table>
      </td>
    </tr>
	<tr>
		<td colspan="2"><a class="opt-group" href="javascript:" onclick="blocking('addinfo','yes', 'block'); return false;">{$lang.additionalinfo}</a></td>
	</tr>
	<tr>
		<td colspan="2">
		<div id="addinfo" style="display:none;">
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td><h4>{$lang.email} :</h4></td>
				<td><input type="text" name="email" id="email" value="{$person.q_email}" size="40"/></td>
				<td><h4>{$lang.stop_mail} :</h4></td>
				<td><input name="stop_mail" id="stop_mail"{if $person.q_stop_mail} checked{/if} value="1" type="checkbox"> (0 - {$lang.no} / 1 - {$lang.yes})</td>
			</tr>
			<tr>
				<td><h4>{$lang.phone} 1 :</h4></td>
				<td><input type="text" name="tel1" id="tel1" value="{$person.q_tel1}" size="40" /></td>
				<td><h4>{$lang.phone} 2 :</h4></td>
				<td><input type="text" name="tel2" id="tel2" value="{$person.q_tel2}" size="40"/></td>
			</tr>
			<tr>
				<td><h4>{$lang.license} :</h4></td>
				<td><input type="text" name="license" id="license" value="{$person.q_license}" size="40"/></td>
				<td><h4>{$lang.contribution} :</h4></td>
				<td><input name="contribution" id="contribution"{if $person.q_contribution} checked{/if} value="1" type="checkbox"> (0 - {$lang.no} / 1 - {$lang.yes})</td>
			</tr>
			<tr>
				<td><h4>{$lang.adresse}:</h4></td>
				<td>
				<textarea style="width:95%; height:30px;" name="address" id="address" wrap="virtual">{$person.q_address}</textarea>
				</td>
				<td colspan="2">&nbsp;</td>
			</tr>
			</table>
			</div>
		</td>
	<tr>
	<td 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>

<script language="JavaScript" type="text/javascript">
document.edi.name.focus();
</script>
</div>
<!-- /edit -->
<br />
{if $person.q_type == 1 || $person.q_type == 2  || $person.q_type == 4}
<div id="effectif">

<form action="edit_persons.php" name="effectif" method="post">
<input type="hidden" name="personid" id="personid" value="{$person.q_id}" />
<input type="hidden" name="effectif" id="effectif" value="1" />
<table id="tableshow" width="100%" cellpadding="2" cellspacing="1" border="0">
<tr>
	<td colspan="4" id="theme">{$lang.careermanagement}</td>
</tr>
<tr>
	<td colspan="4">
		<span class="footer-links">
		{if $pageno && $maxpageno}
			{if $pageno != 1}<a href="?pageno={$pageno-1}&id={$person.q_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}&id={$person.q_id}"><img src="templates/classic/images/next.gif" align="absmiddle" hspace="5" width="22" height="18"></a>{/if}
			{$totalresults} {$lang.records}.
		{/if}
		</span>
	</td>
</tr>
{counter start=0 print=false name=tablecount}
<tr>
{foreach item=season from=$allseasons}
{assign var="nextyear" value="`$season.season+1`"}
{counter assign=count name=tablecount}
	<td>{$lang.season} {$season.season} / {$nextyear}</td>
	<td>
	<select name="season{$season.id}">
		<option value="">---------------</option>
		{foreach item=club from=$allclubs}
		<option value="{$club.id}" {if $club.id == $carrier[$season.id]}Selected{/if}>{$club.shortname}</option>
		{/foreach}
	</select>					
	</td>
{if $count==2}
</tr><tr>
{counter start=0 print=false name=tablecount}
{/if}
	

{/foreach}
</tr>
<tr>
	<td colspan="4">
		<input style="width:100%;" type="submit" class="btn-search" value="{$lang.save}" id="savebutton" accesskey="s" />
	</td>
</tr>

</table>
{/if}
</div>
<!-- /content -->
