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

<!-- {$smarty.template} -->
<!-- {$smarty.template} -->
<div id="title">{if $carac.id}<a href="show_news.php?id=$carac.id">{$carac.q_longname}</a>{else}{$lang.editcaracs}{/if}</div>
	<!-- /barre-onglet -->
<div id="actions">
	<div id="barre-onglet">
		<form action="show_caracs.php" method="get" name="show">
			<input type="hidden" name="id" value="{$carac.id}" />
			<input class="onglet" type="submit"  value="{$lang.view}" />
			</span>
		</form>
		{if $carac.seegallery}
			<form action="gallery.php" name="galleryform">
				<input type="hidden" name="subcat" value="{$carac.id}"/>
				<input type="hidden" name="cat" value="1" />
				<input class="onglet" type="submit" value="{$lang.gallery}" />
			</form>
		{/if}
		{if $carac.prev_id || $carac.next_id}
				<form action="show_caracs.php" name="prevform">
					<input type="hidden" name="id" value="{$carac.prev_id}"/>
					<input class="onglet" type="submit"  value="<" {if !$carac.prev_id}disabled="disabled"{/if} accesskey="," />
				</form>
				<form action="show_caracs.php" name="nextform">
					<input type="hidden" name="id" value="{$carac.next_id}"/>
					<input class="onglet" type="submit"  value=">" {if !$carac.next_id}disabled="disabled"{/if} accesskey="." />
				</form>
		{/if}
	</div>
	<!-- /actions -->	
    <div id="barre-season">
		<form action="edit_caracs.php" name="editform">
				<input class="onglet" type="submit" value="{$lang.newdata}" />
		</form>
		<form action="edit_caracs.php" name="editform">
				<input type="hidden" name="id" value="{$carac.id}"/>
				<input class="onglet" type="submit" value="{$lang.edit}" />
		</form>
		<form action="delete.php" name="deleteform">
				<input type="hidden" name="id" value="{$carac.id}"/>
				<input type="hidden" name="cat" value="1"/>
				<input class="onglet" type="submit" value="{$lang.del}" onclick="return(confirm('{$carac.shorttname|escape:javascript}: {$lang.msg_really_del}?'))" />
		</form>
	</div>
</div>

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


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


<form action="edit_caracs.php" id="edi" name="edi" method="post">
<input type="hidden" name="id" id="id" value="{$caracs.q_id}" />
{if $type}
<input type="hidden" name="save" id="save" value="1" />
{/if}
<table id="tableshow" width="100%" cellspacing="0" cellpadding="1" border="2">
	<tr>
		<td width="60%">
			<table width="100%" cellspacing="0" cellpadding="1" border="0">
			<tr>
			
				<td class="lineodd"><b>» {$lang.caractype} :</b></td>
				<td class="lineodd">
				<select name="type" onchange="javascript:location='edit_caracs.php?type='+this.value;">
				<option value="0">---{$lang.type}---</option>
				{counter start=0 print=false name=typecount}
				{foreach item=typecarac from=$caractype}
				{counter assign=count name=typecount}
				<option value="{$count}" {if $count == $type}{assign var='mytypecarac' value=$typecarac}Selected{/if}>{$typecarac}</option>
				{/foreach}
				</select>
				</td>
			</tr>
		{if $type}
			<tr>
				<td class="lineeven"><b>» {$lang.name} :</b></td>
				<td class="lineeven">
				<input type="text" name="shortname" id="shortname" value="{$caracs.q_shortname}"  size="40" maxlength="255" />
				</td>
			</tr>
			<tr>
				<td class="lineodd"><b>» {$lang.carackey} :</b></td>
				<td class="lineodd">
				<input type="text" name="lib_key" id="lib_key" value="{$caracs.q_lib_key}"  size="40" maxlength="255" />
				</td>
			</tr>
			<tr>
				<td class="lineeven"><b>» {$lang.genre} :</b></td>
				<td class="lineeven">
				<select name="genre">
				<option value="0">---{$lang.genre}---</option>
				{counter start=0 print=false name=genrecount}
				{foreach item=genrecarac from=$caracgenre}
				{counter assign=count name=genrecount}
				<option value="{$count}" {if $count == $caracs.q_genre}Selected{/if}>{$genrecarac}</option>
				{/foreach}
				</select>
				</td>
			</tr>
			<tr>
				<td class="lineeven"><b>» {$lang.perm} :</b></td>
				<td class="lineeven">
				<select name="perm">
				<option value="0">---{$lang.permission}---</option>
				<option value="0" {if !$caracs.q_perm}Selected{/if}>{$lang.all}</option>
				<option value="255" {if $caracs.q_perm == 255}Selected{/if}>{$lang.admin}</option>
				</select>
				</td>
			</tr>
			<tr>
			<td colspan="2" align="center">	
				<div>
					<input class="btn-search" style="width:49%" type="submit" value="{$lang.save}" id="savebutton" accesskey="s" />
					<input class="btn-search" style="width:49%" type="button" value="{$lang.back}" id="backbutton" onclick="javascript:history.go(-1);" accesskey="b" />
				</div>
			</td>
			</tr>
		</table>
		</form>
		</td>

		<td width="40%" valign="top">
		{if $type}
			<form action="edit_caracs.php" method="post">
			<input type="hidden" name="type" value="{$type}" />
			<table id="tableshow" width="100%" cellspacing="0" cellpadding="1" border="0">
			<tr>
				<td><a class="opt-group" href="#">
				{$lang.caracs_addon}
				{$mytypecarac}
				</a></td>
			</tr>
			<tr>
				<td>
				<select name="id" size="10" style="width:100%;">
				{foreach item=carac from=$allcaracs}
				<option value="{$carac.id}">{$carac.shortname}</option>
				{/foreach}
				</select>
				<br />
				<input class="btn-search" style="width:100%;" type="submit" value="{$lang.edit}" name="action" />
				<br />
				<input class="btn-search" style="width:100%;" type="submit" value="{$lang.del}" name="action" />
				</td>
			</tr>
			</table>
			</form>
		{/if}
		</td>
	</tr>
	
{/if}
  </table>




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


