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

<!-- {$smarty.template} -->
<br>
<table id="tableshow" border="0" cellpadding="0" cellspacing="0" width="100%">
	<tr>
		<td id="toppage">{if $person.id}<a href="show_persons.php?id={$person.id}">{$person.q_lastname} {$person.q_firstname}</a>{else}<a href="#">{$lang.newperson}</a>{/if}</td>
	</tr>
{if $person.id || $xmlimport}
	<tr>
		<td>
		<form action="edit_persons.php" name="editform">
				<span class="onglet-admin">
					<input type="submit" value="{$lang.newdata}" />
				</span>
		</form>
		<form action="edit_persons.php" name="editform">
				<input type="hidden" name="id" value="{$person.id}"/>
				<span class="onglet-admin">
					<input type="submit" value="{$lang.edit}" />
				</span>
		</form>
		<form action="delete.php" name="deleteform">
				<input type="hidden" name="id" value="{$person.id}"/>
				<input type="hidden" name="cat" value="8"/>
				<span class="onglet-admin">
				<input type="submit" value="{$lang.del}" onclick="return(confirm('{$person.lastname|escape:javascript}: {$lang.msg_really_del}?'))" />
				</span>
		</form>
		</td>
	</tr>
	<tr>
		<td>
		{if $person.id}
			<form action="show_persons.php" method="get" name="show">
				<input type="hidden" name="id" value="{$person.id}" />
				<span class="onglet">
					<input type="submit"  value="{$lang.view}" />
				</span>
			</form>
		{else}
			<form action="edit_persons.php" method="get" name="import">
				<input type="hidden" name="import" value="xml" />
				<span class="onglet">
					<input type="submit"  value="Import" />
				</span>
			</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" />
				<span class="onglet">
					<input type="submit" value="{$lang.gallery}" />
				</span>
			</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" />
					<span class="onglet">
					<input type="submit" value="{$lang.comment}" />
					</span>
				</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}"/>
					<span class="onglet">
					<input type="submit"  value="&laquo;" {if !$person.prev_id}disabled="disabled"{/if} accesskey="," />
					</span>
				</form>
				<form action="show_persons.php" name="nextform">
					<input type="hidden" name="id" value="{$person.next_id}"/>
					<span class="onglet">
					<input type="submit"  value="&raquo;" {if !$person.next_id}disabled="disabled"{/if} accesskey="." />
					</span>
				</form>
		{/if}
		</td>
	</tr>
	
{/if}
</table>

<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_persons.php" id="edi" name="edi" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" id="id" value="{$person.id}" />
<input type="hidden" name="save" id="save" value="1" />
<table id="tableshow" width="100%" cellpadding="2" cellspacing="0" border="0">

	<tr>
		<td class="lineeven"><b>» {$lang.lastname}:</b></td>
		<td class="lineeven">
		<input type="text" name="lastname" id="longname" value="{$person.q_lastname}"  size="35" maxlength="255" />
		</td>
	</tr>		
	<tr>
    	<td class="lineodd"><b>» {$lang.firstname}:</b></td>
        <td class="lineodd">
        <input type="text" name="firstname" id="firstname" value="{$person.q_firstname}"  size="35" maxlength="255" />
        </td>
    </tr>
	<tr>
    	<td class="lineodd"><b>» {$lang.aka}:</b></td>
        <td class="lineodd">
        <input type="text" name="aka" id="aka" value="{$person.q_aka}"  size="35" maxlength="255" />
        </td>
    </tr>
	<tr>
    	<td class="lineeven"><b>» {$lang.country}:</b></td>
        <td class="lineeven">
		<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>
	<tr>
    	<td class="lineodd"><b>» {$lang.birthday}:</b></td>
        <td class="lineodd"><input type="text" name="birthday" id="birthday" value="{$person.q_birthday}" size="10" maxlength="10" />  (DDMMYYYY)</td>
    </tr>
	<tr>
    	<td class="lineeven"><b>» {$lang.birthcity}:</b></td>
        <td class="lineeven"><input type="text" name="birthcity" id="birthcity" value="{$person.q_birthcity}" size="40" maxlength="255" /></td>
    </tr>
	<tr>
    	<td class="lineodd"><b>» {$lang.deathday}:</b></td>
        <td class="lineodd"><input type="text" name="deathday" id="deathday" value="{$person.q_deathday}" size="10" maxlength="10" />  (DDMMYYYY)</td>
    </tr>
	<tr>
    	<td class="lineodd"><b>» {$lang.position}:</b></td>
        <td class="lineodd">
		<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 class="lineeven"><b>» {$lang.height}:</b></td>
        <td class="lineeven"><input type="text" name="height" id="height" value="{$person.q_height}" size="5" maxlength="3" /> cm</td>
    </tr>
	<tr>
    	<td class="lineodd"><b>» {$lang.weight}:</b></td>
        <td class="lineodd"><input type="text" name="weight" id="weight" value="{$person.q_weight}" size="5" maxlength="3" /> Kg</td>
    </tr>
	
	<tr>
    	<td class="lineodd"><b>» {$lang.website}:</b></td>
        <td class="lineodd"><input type="text" name="website" id="website" value="{$person.q_website}" size="40" maxlength="255" /></td>
    </tr>
	<tr>
		<td colspan="2" class="lineeven">
		<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 class="lineeven">
				<b>» {$lang.email}:</b>
				</td>
				<td class="lineeven">
				<input type="text" name="email" id="email" value="{$person.q_email}" size="40"/>
				</td>
			</tr>
			<tr>
				<td class="lineodd">
				<b>» {$lang.stop_mail}:</b>
				</td>
				<td class="lineodd">
				<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 class="lineeven">
				<b>» {$lang.license}:</b>
				</td>
				<td class="lineeven">
				<input type="text" name="license" id="license" value="{$person.q_license}" size="40"/>
				</td>
			</tr>
			<tr>
				<td class="lineeven">
				<b>» {$lang.contribution}:</b>
				</td>
				<td class="lineeven">
				<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 class="lineeven">
				<b>» {$lang.phone} 1 :</b>
				</td>
				<td class="lineeven">
				<input type="text" name="tel1" id="tel1" value="{$person.q_tel1}" size="40" />
				</td>
			</tr>
			<tr>
				<td class="lineodd">
				<b>» {$lang.phone} 2 :</b>
				</td>
				<td class="lineodd">
				<input type="text" name="tel2" id="tel2" value="{$person.q_tel2}" size="40"/>
				</td>
			</tr>
			
			<tr>
				<td colspan="2" class="lineeven"><b>» {$lang.adresse}:</b></td>
			</tr>
			<tr>
				<td colspan="2" class="lineeven" align="center">
				<textarea style="width:95%; height:30px;" name="address" id="address" wrap="virtual">{$person.q_address}</textarea>
				</td>
			</tr>
			</table>
			</div>
		</td>
	</tr>
	<tr>
    	<td class="lineodd"><b>» {$lang.logourl}:</b></td>
        <td class="lineodd">
        <input type="text" name="imgurl" id="imgurl" value="{$person.q_imgurl}"  size="40" maxlength="255" />
        </td>
    </tr>		
    <tr>
    	<td class="lineeven"><b>» {$lang.logoupload}:</b></td>
        <td class="lineeven"><input type="file" name="coverupload" id="coverupload" size="35" /></td>
    </tr>
    <tr>
    	<td class="lineodd"><b>» {$lang.international}:</b></td>
        <td class="lineodd">
		<input name="international" id="international"{if $person.q_international} checked{/if} value="1" type="checkbox">(0 - {$lang.no} / 1 - {$lang.yes})
		</td>
    </tr>
	<tr>
    	<td class="lineeven"><b>» {$lang.type} : </b></td>
        <td class="lineeven">
		<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 class="lineodd"><b>{$option.name}:</b></td>
	  <td class="lineodd">
		{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 colspan="2" class="lineodd"><b>» {$lang.comments}:</b></td>
	</tr>
	<tr>
        <td colspan="2" class="lineodd" align="center"><textarea style="width:95%; height:150px;" name="plot" id="plot" wrap="virtual">{$person.q_plot}</textarea></td>
	</tr>
	<tr>
		<td colspan="2">	
			<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" accesskey="b" onclick="javascript:history.go(-1);"/>
			</span>
		</td>
	</tr>
	<tr>
		<td colspan="2" id="bottompage">&nbsp;</td>
	</tr>
  </table>
</form>

<script language="JavaScript" type="text/javascript">
document.edi.name.focus();
</script>

<br />
{if $person.q_type == 1 || $person.q_type == 2  || $person.q_type == 4}
<div id="effectif">

<form action="edit_persons.php" id="effectif" 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="0" border="0">
<tr>
	<td colspan="4" id="toppage"><a href="#">{$lang.careermanagement}</a></td>
</tr>
<tr>
	<td colspan="4">
		{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}
	</td>
</tr>
{counter start=0 print=false name=tablecount}
<tr>
{foreach item=season from=$allseasons}
{cycle values="lineeven,lineodd" assign=CLASS print=false}
{assign var="nextyear" value="`$season.season+1`"}
{counter assign=count name=tablecount}
	<td class="{$CLASS}" width="25%" nowrap><b>{$season.season} / {$nextyear}</b></td>
	<td class="{$CLASS}" width="25%">
	<select name="season{$season.id}" style="width:95%;">
		<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="2">
		<span class="onglet">
		<input style="width:100%;" type="submit" value="{$lang.save}" id="savebutton" />
		</span>
		<span class="onglet">
		<input style="width:100%;" type="button" value="{$lang.back}" id="backbutton" onclick="javascript:history.go(-1);"/>
		</span>
	</td>
	</form>
	
	<td>
		{if $playerstats}
		<form action="edit_statspersons.php" id="effectif" name="effectif" method="post">
    	<input type="hidden" name="id" id="personid" value="{$person.q_id}" />
		<span class="onglet">
		<input style="width:100%;" type="submit" value="{$lang.stats}" id="statsbutton" />
		</span>
		</form>
		{/if}
	</td>
</tr>

</table>
{/if}

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