{include file="$admingentemplates/admin_top.tpl"}
{strip}
<div class="back">
    <a href="{$form.back}">{$lang.button.back}</a>
</div>
<div class="cr"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$lang.cards.admin.name}</div>
<div class="cr">&nbsp;</div>
<div class="cr">&nbsp;</div>
<div class="help_text" style="display:block;">
    <div class="close_help">
        <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
    </div>
    <div class="help_body">
        <span class="help_title">{$lang.help}:</span>{$lang.admin_help.cards_item_edit}
    </div>
</div>

<div class="panel_section">
<div class="panel_content">
<form name="form" method="post" action="{$form.action}" enctype="multipart/form-data">
<input type="hidden" name="par" value="{$form.par}">
<input type="hidden" name="id_category" value="{$form.id_category}">
<input type="hidden" name="id_subcategory" value="{$form.id_subcategory}">
{if $form.par eq 'edit'}
<input type="hidden" name="id" value="{$data.id}">
{/if}
<table border="0" cellspacing=3 cellpadding=0 width="100%">
	<tr >
		<td width="200" class="main_header_text" align="left">{$lang.cards.admin.card_name} <font class=main_error_text>*</font>:&nbsp;</td>
		<td><input name="card_name" value="{$data.card_name}" style="width: 195px;"></td>
	</tr>

	<tr >
		<td class="main_header_text" align="left">{$lang.cards.admin.card_status}:&nbsp;</td>
		<td><input type="checkbox" name="card_status" {if $data.card_status eq 1}checked{/if} value="1"></td>
	</tr>
	<tr >
		<td class="main_header_text" align="left">{$lang.cards.admin.card_price}:&nbsp;</td>
		<td><input name="card_price" value="{$data.card_price}" style="width: 100px;">&nbsp;{$cur}</td>
	</tr>
	<tr >
		<td class="main_header_text" align="left">{$lang.cards.admin.card_category}:&nbsp;</td>
		<td>
			<select name="id_category" onchange="ajaxRequest('admin_cards.php?sel=ajax_subcategories&id_category='+this.value+'&', 'null', document.getElementById('subcategory_div'), '{$lang.cards.admin.loading}&nbsp;<img src=\'{$site_root}{$template_root}/images/ajax-loader.gif\'>', true);">
				{foreach item=item from=$categories}
				<option value="{$item.id}" {if $data.id_category eq $item.id}selected{/if}>{$item.name}</option>
				{/foreach}
			</select>
		</td>
	</tr>
	<tr >
		<td class="main_header_text" align="left">{$lang.cards.admin.card_subcategory}:&nbsp;</td>
		<td height="30">
			<div id="subcategory_div">
			<select name="id_subcategory">
				{foreach item=item from=$subcategories}
				<option value="{$item.id}" {if $data.id_subcategory eq $item.id}selected{/if}>{$item.name}</option>
				{/foreach}
			</select>
			</div>
		</td>
	</tr>
	<tr >
		<td class="main_header_text" align="left" valign="top">{$lang.cards.admin.card_image}:&nbsp;</td>
		<td>
			<div>{if $data.card_image}<img src="{$data.card_image}">{else}{$lang.cards.admin.no_image}{/if}</div>
			<div style="padding-top: 5px;"><input type="file" name="card_image"></div>
		</td>
	</tr>
</table>
</form>
</div>
</div>
<table>
	<tr >
		<td align="left">
			{if $form.par eq 'edit'}
                <a onclick="javascript: document.form.submit();" class="admin_button_major" >{$lang.button.save}<span>&nbsp;</span></a>&nbsp;&nbsp;
            {else}
                <a onclick="javascript: document.form.submit();" class="admin_button_major" >{$lang.button.add}<span>&nbsp;</span></a>&nbsp;&nbsp;
            {/if}
            {*<a onclick="document.location.href='{$form.back}'" class="admin_button btn_upload" >{$lang.button.back}<span>&nbsp;</span></a>&nbsp;&nbsp;&nbsp;*}
		</td>
	</tr>
</table>
{/strip}
{include file="$admingentemplates/admin_bottom.tpl"}